V3 endpoints

These endpoints require a Portal API Key (aka "Custodian API Key") as a bearer token.

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.

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

NameTypeDescription

Authorization*

String

Bearer <Portal API Key>

Content-Type*

String

application/json

Request Body

NameTypeDescription

isAccountAbstracted

Boolean (optional)

The client will use ERC-4337 Account Abstraction (AA).

{
  "id": "string",
  "clientApiKey": "string",
  "clientSessionToken": "string",
  "isAccountAbstracted": boolean
}

Fetches a single client

GET https://api.portalhq.io/api/v3/custodians/me/clients/[clientId]

Fetches the specified client for the authorized custodian.

Path Parameters

NameTypeDescription

clientId*

String

The ID of the client.

Headers

NameTypeDescription

Authorization*

String

Bearer <Portal API Key>

Content-Type*

String

application/json

{
  "createdAt": "2024-04-16T21:15:06.443Z",
  "custodian": {
    "id": "custodianId",
    "name": "Custodian Name"
  },
  "ejectedAt": null,
  "environment": {
    "id": "environmentId",
    "name": "Development"
  },
  "id": "clientId",
  "isAccountAbstracted": false,
  "metadata": {
    "namespaces": {
      "eip155": {
        "address": "0x6e818d8f9b6c53c59a2d957d36c2146e28906195",
        "curve": "SECP256K1"
      }
    }
  },
  "wallets": [
    {
      "createdAt": "2024-04-16T21:15:45.144Z",
      "curve": "SECP256K1",
      "id": "wallet1Id",
      "backupSharePairs": [
        {
          "backupMethod": "PASSWORD",
          "createdAt": "2024-04-16T21:16:48.723Z",
          "id": "backupSharePairId1",
          "status": "completed"
        },
        {
          "backupMethod": "GDRIVE",
          "createdAt": "2024-04-16T21:17:02.074Z",
          "id": "backupSharePairId2",
          "status": "incomplete"
        },
        {
          "backupMethod": "ICLOUD",
          "createdAt": "2024-04-16T21:18:06.996Z",
          "id": "backupSharePairId3",
          "status": "incomplete"
        }
      ],
      "signingSharePairs": [
        {
          "createdAt": "2024-04-16T21:15:45.151Z",
          "id": "signingSharePairId1",
          "status": "completed"
        }
      ],
      "publicKey": "stringifiedJSON"
    }
  ]
}

Fetches a list of clients

GET https://api.portalhq.io/api/v3/custodians/me/clients

Fetches all clients for the authorized custodian.

Query Parameters

NameTypeDescription

cursor

String (optional)

The ID of the last client in the list. Used for cursor-based pagination.

take

Number (optional)

The number of records to retrieve. Maximum is 100. Default is 100.

Headers

NameTypeDescription

Authorization*

String

Bearer <Portal API Key>

Content-Type*

String

application/json

```json
{
  "results": [
    {
      "createdAt": "2024-04-16T21:15:06.443Z",
      "custodian": {
        "id": "custodianId",
        "name": "Custodian Name"
      },
      "ejectedAt": null,
      "environment": {
        "id": "environmentId",
        "name": "Development"
      },
      "id": "clientId",
      "isAccountAbstracted": false,
      "metadata": {
        "namespaces": {
          "eip155": {
            "address": "0x6e818d8f9b6c53c59a2d957d36c2146e28906195",
            "curve": "SECP256K1"
          }
        }
      },
      "wallets": [
        {
          "createdAt": "2024-04-16T21:15:45.144Z",
          "curve": "SECP256K1",
          "id": "wallet1Id",
          "backupSharePairs": [
            {
              "backupMethod": "PASSWORD",
              "createdAt": "2024-04-16T21:16:48.723Z",
              "id": "backupSharePairId1",
              "status": "completed"
            },
            {
              "backupMethod": "GDRIVE",
              "createdAt": "2024-04-16T21:17:02.074Z",
              "id": "backupSharePairId2",
              "status": "incomplete"
            },
            {
              "backupMethod": "ICLOUD",
              "createdAt": "2024-04-16T21:18:06.996Z",
              "id": "backupSharePairId3",
              "status": "incomplete"
            }
          ],
          "signingSharePairs": [
            {
              "createdAt": "2024-04-16T21:15:45.151Z",
              "id": "signingSharePairId1",
              "status": "completed"
            }
          ],
          "publicKey": "stringifiedJSON"
        }
      ]
    },
    ...
  ],
  "metadata": {
    "cursor": "nextCursorToUse",
    "take": 100,
    "total": 1000
  }
}

Refresh Client Session Token (CST)

POST https://api.portalhq.io/api/v3/custodians/me/clients/[clientId]/session

Refreshes a Client Session Token for a client.

Path Parameters

NameTypeDescription

clientId*

String

The ID of a client.

Headers

NameTypeDescription

Authorization*

String

Bearer <Portal API Key>

Content-Type*

String

application/json

{
  "id": "string",
  "clientSessionToken": "string",
  "isAccountAbstracted": boolean
}

Generate Client Web One-Time Password (OTP)

POST https://api.portalhq.io/api/v1/custodians/clients/[clientId]/web-otp

Generate a one-time password for a client.

Path Parameters

NameTypeDescription

clientId*

String

The ID of a client.

Headers

NameTypeDescription

Authorization*

String

Bearer <Portal API Key>

Content-Type*

String

application/json

{
  "id": "string"
  "otp": "string"
}

Last updated