v66

OpenAPI 3.1.0raw.githubusercontent.com2026-08-0174265626.3 KB
portal

List portal keys

Retrieve a paginated list of API keys owned by the authenticated portal session's end user.

This is the portal-scoped variant of apis.listKeys. It authenticates only with a portal session cookie and always restricts results to the keys owned by the session's external identity, within the keyspaces configured on the portal configuration. Both the identity and the keyspaces come from the session, so the request body has no externalId or apiId field.

post/v2/portal.listKeys

Request body

limitinteger

Maximum number of keys to return per request. Balance between response size and number of pagination calls needed.

cursorstring

Pagination cursor from a previous response to fetch the next page. Use when hasMore: true in the previous response.

Example request

{
  "cursor": "key_1234abcd"
}

Response

Successfully retrieved paginated keys. Use the pagination cursor for additional results when hasMore: true.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": [
    {
      "keyId": "key_1234567890abcdef",
      "start": "sk_test_abc123",
      "enabled": true,
      "name": "Production API Key",
      "createdAt": 1701425400000,
      "updatedAt": 1701425400000,
      "lastUsedAt": 1701425400000,
      "expires": 1735689600000,
      "permissions": [
        "documents.read",
        "documents.write"
      ],
      "roles": [
        "editor",
        "viewer"
      ],
      "credits": {
        "remaining": 1000,
        "refill": {
          "interval": "daily",
          "amount": 1000,
          "refillDay": 15
        }
      },
      "identity": {
        "ratelimits": [
          {
            "id": "rl_1234567890abcdef",
            "name": "api_requests",
            "limit": 1000,
            "duration": 3600000,
            "autoApply": true
          }
        ]
      },
      "plaintext": "sk_test_abc123def456",
      "ratelimits": [
        {
          "id": "rl_1234567890abcdef",
          "name": "api_requests",
          "limit": 1000,
          "duration": 3600000,
          "autoApply": true
        }
      ]
    }
  ],
  "pagination": {
    "cursor": "eyJrZXkiOiJrZXlfMTIzNCIsInRzIjoxNjk5Mzc4ODAwfQ==",
    "hasMore": true
  }
}