Before going live with real users, always ensure that you create clients using a Portal API Key from your Portal’s Production environment. Read more here on going live with real users.
Clients
Create a new client
POST https://api.portalhq.io/api/v3/custodians/me/clients
Registers a new client and returns a client API key, client session token, and whether they are AA enabled.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
isAccountAbstracted | Boolean (optional) | The client will use ERC-4337 Account Abstraction (AA). |
Example Request
Be sure to replace the[token] with a Custodian API Key.
Example Response
- 200: Created Success
- 400: Bad Request
Create a Client Session Token (CST) for a client
POST https://api.portalhq.io/api/v3/custodians/me/clients/[clientId]/sessions
Creates a new Client Session Token for a client.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
clientId* | String | The ID of a client. |
Example Request
Be sure to replace the[token] with a Custodian API Key and the [clientId] with the relevant Portal client ID.
Example Response
- 200: OK Success
- 400: Bad Request
Create a one-time password (OTP) for a client using the Web SDK
GET https://api.portalhq.io/api/v1/custodians/clients/[clientId]/web-otp
Generate a one-time password for a client.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
clientId* | String | The ID of a client. |
Example Request
Be sure to replace the[token] with a Custodian API Key and the [clientId] with the relevant Portal client ID.
Example Response
- 200: OK Success
- 400: Bad Request Bad Request
Get a single client
GET https://api.portalhq.io/api/v3/custodians/me/clients/[clientId]
Fetches the specified client for the authorized custodian.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
clientId* | String | The ID of the client. |
Example Request
Be sure to replace the[token] with a Custodian API Key and the [clientId] with the relevant Portal client ID.
Example Response
- 200: OK Success
- 400: Bad Request
Get a list of clients
GET https://api.portalhq.io/api/v3/custodians/me/clients
Fetches all clients for the authorized custodian.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Query Parameters
| Name | Type | Description |
|---|---|---|
cursor | String | The ID of the last client in the list. Used for cursor-based pagination. |
take | Number | The number of records to retrieve. Maximum is 100. Default is 100. |
Example Request
Be sure to replace the[token] with a Custodian API Key.
Example Response
- 200: OK Success
- 400: Bad Request
Get a list of assets for a client
GET https://api.portalhq.io/api/v3/custodians/me/clients/:clientId/chains/:chain/assets
This endpoint retrieves the asset balances (native and token balances) for a specified client and blockchain. It provides detailed information on the native balance and token balances held by a given address on the specified chain.
Supported Chains
You can use either the full chain identifier or the shortcut for popular chains.- Monad Testnet (
eip155:10143ormonad-testnet) - Solana Mainnet (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdporsolana) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1orsolana-devnet) - Bitcoin (
bip122:000000000019d6689c085ae165831e93-p2wpkhorbitcoin-p2wpkhorbitcoin-segwit) - Bitcoin Testnet (
bip122:000000000933ea01ad0ee984209779ba-p2wpkhorbitcoin-p2wpkh-testnetorbitcoin-segwit-testnet) - Tron (
tron:mainnet) - Tron Nile (
tron:nile) - Tron Shasta (
tron:shasta) - Stellar (
stellar:pubnet) - Stellar Testnet (
stellar:testnet) - Ethereum Mainnet (
eip155:1orethereum) - Ethereum Sepolia (
eip155:11155111orsepolia) - Base Mainnet (
eip155:8453orbase) - Base Sepolia (
eip155:84532orbase-sepolia) - Polygon Mainnet (
eip155:137orpolygon) - Polygon Amoy (
eip155:80002orpolygon-amoy) - Optimism Mainnet (
eip155:10) - Binance Smart Chain (
eip155:56) - Binance Smart Chain Testnet (
eip155:97) - Fantom (
eip155:250) - Moonbeam (
eip155:1284) - Arbitrum Mainnet (
eip155:42161) - Avalanche Mainnet (
eip155:43114) - Linea Mainnet (
eip155:59144) - Celo (
eip155:42220) - Celo Alfajores Testnet (
eip155:44787)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143), ensure the URL is URI encoded to accommodate the ”:” character.Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
clientId* | String | The ID of the client. |
chainId* | String | Must be in CAIP-2 format or chain identifier shortcut (e.g. eip155:10143 or monad-testnet). |
Example Request
Be sure to replace the[token] with a Custodian API Key, the chain with a valid chain value, and the clientId with the relevant Portal client ID.
Example Response
- 200: Success
- 400: Bad Request
Build transaction for a client
POST https://api.portalhq.io/api/v3/custodians/me/clients/:clientId/chains/:chain/assets/send/build-transaction
Creates an unsigned transaction for transferring assets to another address on a specific chain. You can then use this unsigned transaction to sign and submit the transaction.
Supported Chains
- You can use any of the following friendly chain names for the
chainpath param (or alternatively you can use the CAIP-2chainId):ethereum(eip155:1)sepolia(eip155:11155111)base(eip155:8453)base-sepolia(eip155:84531)polygon(eip155:137)polygon-mumbai(eip155:80001)celo(eip155:42220)celo-alfajores(eip155:44787)solana(solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp)solana-devnet(solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1)tron(tron:mainnet)tron-nile(tron:nile)tron-shasta(tron:shasta)stellar(stellar:pubnet)stellar-testnet(stellar:testnet)bitcoin-segwit(bip122:000000000019d6689c085ae165831e93-p2wpkh)bitcoin-segwit-testnet(bip122:000000000933ea01ad0ee984209779ba-p2wpkh)bitcoin-p2wpkh(bip122:000000000019d6689c085ae165831e93-p2wpkh)bitcoin-p2wpkh-testnet(bip122:000000000933ea01ad0ee984209779ba-p2wpkh)
When using CAIP-2 chain formats in the URL (e.g.
eip155:10143), ensure the URL is URI encoded to accommodate the ”:” character.Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
clientId* | String | The ID of the client. |
chain* | String | Must be one of the chains in “Supported Chains”. |
Body Parameters
| Name | Type | Description |
|---|---|---|
to* | String | The recipient’s address. |
token* | String | The token symbol (e.g., “USDC”) or contract address or mint address (for Solana). |
amount* | String | The amount to transfer (as a string, in the token’s primary denomination). For example, “0.01” is 1 cent of USDC. |
Example Request
Be sure to replace the[token] with a Custodian API Key, the chain with a valid chain value, and the clientId with the relevant Portal client ID.
Example Response
The response includes the unsigned transaction details and metadata. The structure of the response differs depending on whether the chain is Solana or an EIP-155 chain (e.g., Ethereum, Polygon, Base).- 200: EIP-155 Response
- 200: Solana Response
- 200: Bitcoin Response
- 400: Bad Request
Notes
- The
tokenfield can accept either a token symbol (e.g. “USDC” or “USDT”) or a contract address (for EIP-155 tokens) or a mint address (for Solana tokens). - The
amountshould be provided in the token’s primary denomination (e.g. whole USDC, not micro-USDC). - This endpoint creates an unsigned transaction. The client is responsible for signing the transaction before broadcasting it to the network.
- The response structure differs between Solana and EIP-155 chains. Make sure to handle both response types in your implementation.
Client Shares
Prepare a client for eject
PATCH https://api.portalhq.io/api/v3/custodians/me/clients/[clientId]/enable-eject
Your custodian must be using Portal-Managed Backups to use this endpoint. Prepare a wallet for ejection of its private keys. This endpoint will enable a Portal client to be ejected for 5 minutes.
You can find the walletId parameter from the Get a Single Client endpoint.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
ejectableUntil | String (ISO format) | The time the wallet will no longer be ejectable. Must be a date at least 1 minute from now. |
walletId* | String | The walletId of the wallet to eject. |
Example Request
Be sure to replace the[token] with a Custodian API Key and the [clientId] with the relevant Portal client ID.
Example Response
- 200: Success
- 400: Bad Request
Get a client’s backup shares
GET https://api.portalhq.io/api/v3/custodians/me/clients/:clientId/wallets/:walletId/ejectable-backup-shares
Your custodian must be using Portal-Managed Backups to use this endpoint. Fetches a client’s encrypted backup share (if you sent it to Portal previously) and their custodian backup share. This endpoint is used when running eject while using the Enclave MPC API with a Portal-Managed Backup configuration.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Client API Key> |
| Content-Type* | String | application/json |
Example Request
Be sure to replace the[token] with a Custodian API Key, the [walletId] with the Portal client’s wallet ID, and the [clientId] with the relevant Portal client ID.
Example Response
- 200: Success
- 400: Bad Request
Alert Webhooks
Get a list of alert webhooks
GET https://api.portalhq.io/api/v3/custodians/me/alerts/webhooks
Retrieve a list of your alert webhooks configured in your Portal Admin Dashboard.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Example Request
Be sure to replace the[token] with a Custodian API Key.
Example Response
- 200: Success
- 400: Bad Request
Get a list of events sent to your alert webhook
GET https://api.portalhq.io/api/v3/custodians/me/alerts/webhooks/:alertWebhookId/events
Retrieve a list of the events sent to your alert webhook (including those that failed to be delivered).
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Query Parameters
| Name | Type | Description |
|---|---|---|
eventTypesd;”>* | “EIP_155_TX_V1” | The alert webhook event types. |
deliveryStatuses | ”success”, “failed”, “pending” | Returns only alert webhook events with one of the specified delivery statuses. |
since | Unix Number | Returns only alert webhook events that occurred after this time. |
until | Unix Number | Returns only alert webhook events that occurred before this time. |
cursor | String | The alert webhook event “id” for cursor-based pagination. |
limit | Number (default: 100) | The amount of alert webhook events to get back in the request. |
transactionHash | String | Returns only alert webhook events that include this transaction hash. |
blockNumbers | String (multiple delimited by ”,“) | Returns only alert webhook events that include these block numbers. |
chainIds | CAIP-2 chains (multiple delimited by ”,“) | Returns only alert webhook events that include these chainIds. |
Example Request
Be sure to replace the[token] with a Custodian API Key and the [webhookId] with the alert webhook ID you are interested in.
Example Response
- 200: Success
- 400: Bad Request
Replay failed-to-deliver alert webhook events
POST https://api.portalhq.io/api/v3/custodians/me/alerts/webhooks/:alertWebhookId/events/failed/replay
Replays a list of alert webhook events with a delivery status of "failed".
If the
"failed" alert webhook event has already been replayed successfully, you cannot replay the alert webhook event again with this endpoint.Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
alertWebhookIdd;”>* | String | The “id” of the alert webhook. You can get this from the list alert webhooks endpoint. |
Body Parameters
| Name | Type | Description |
|---|---|---|
eventIdsd;”>* | String[] | A list of “failed” alert webhook event “id”s to replay. |
Example Request
Be sure to replace the[token] with a Custodian API Key and the [webhookId] with the alert webhook ID you are interested in.
Example Response
- 200: Success
- 400: Bad Request
Gas Sponsorship:
Get historical gas sponsorship usage by chain
GET https://api.portalhq.io/api/v3/custodians/me/gas-sponsors/chains/:chainId/usage
Retrieves historical gas sponsorship usage by chain for your Portal environment.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Path Parameters
| Name | Type | Description |
|---|---|---|
chainIdd;”>* | CAIP-2 chain | The CAIP-2 chain ID. Be sure it is URL encoded. |
Example Request
Be sure to replace the[token] with a Custodian API Key.
Example Response
- 200: Success
- 400: Bad Request
Deprecated Endpoints:
Format a raw alert webhook event (@deprecated)
POST https://api.portalhq.io/api/v3/custodians/me/alerts/wallets/format
This endpoint formats a raw webhook request body for wallet events.
Supported Chains
You can use either the full chain identifier or the shortcut for popular chains.- Ethereum Mainnet (
eip155:1orethereum) - Ethereum Sepolia (
eip155:11155111orsepolia) - Solana Mainnet (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdporsolana) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1orsolana-devnet) - Base Mainnet (
eip155:8453orbase) - Base Sepolia (
eip155:84531orbase-sepolia) - Polygon Mainnet (
eip155:137orpolygon) - Polygon Mumbai (
eip155:80001orpolygon-mumbai)
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chain* | "eip155" | The chain the raw webhook event is from. |
rawAlert* | String | The stringified raw webhook event. |
Example Response
- 200: Success
- 400: Bad Request
Format raw alert webhook events (@deprecated)
POST https://api.portalhq.io/api/v3/custodians/me/alerts/format
This endpoint formats a raw webhook request body for wallet events, which may include one or many transactions at once.
Supported Chains
You can use either the full chain identifier or the shortcut for popular chains.- Ethereum Mainnet (
eip155:1orethereum) - Ethereum Sepolia (
eip155:11155111orsepolia) - Solana Mainnet (
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdporsolana) - Solana Devnet (
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1orsolana-devnet) - Base Mainnet (
eip155:8453orbase) - Base Sepolia (
eip155:84531orbase-sepolia) - Polygon Mainnet (
eip155:137orpolygon) - Polygon Mumbai (
eip155:80001orpolygon-mumbai)
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chain* | "eip155" | The chain the raw webhook event is from. |
rawAlert* | String | The stringified raw webhook event. |
Example Response
- 200: Success
- 400: Bad Request
Replay an alert webhook event by block number (@deprecated)
POST https://api.portalhq.io/api/v3/custodians/me/alerts/retry-by-block-number
This endpoint attempts to resend a wallet event scoped by a block number in the scenario you need to replay a transaction.
Supported Chains
EVM chains.Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer <Custodian API Key> |
| Content-Type* | String | application/json |
Body Parameters
| Name | Type | Description |
|---|---|---|
chainReferenceId* | String | The EVM chain reference ID. (e.g. "11155111" for Sepolia) |
blockNumber* | Number | The block number of the transaction(s) you want to resend. |
streamId* | String | The ID of the stream that Portal configured for you. (Reach out to our team to get this.) |
Example Response
- 204: Success No Content
- 400: Bad Request
No content