Skip to main content

API Keys

List all API keys for the current user​

GET /api-keys

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/api-keys \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Lists every API key created by the authenticated user across all APIs in the organization. Powers the API Portal's global "API Keys" page. Each item additionally carries the owning API's name, version, and type. Secret material is never returned.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:read`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
limitqueryintegerfalseMaximum number of records to return.
offsetqueryintegerfalseNumber of records to skip before returning results.

Example responses

200 Response

{
"list": [
{
"id": "weather_prod_key",
"displayName": "Weather Prod Key",
"apiId": "weather-api-v1",
"appId": "my-weather-app",
"appDisplayName": "My Mobile App",
"status": "ACTIVE",
"expiresAt": "2026-12-31T23:59:59Z",
"createdAt": "2019-08-24T14:15:22Z",
"revokedAt": "2019-08-24T14:15:22Z"
}
],
"count": 1,
"pagination": {
"total": 42,
"limit": 20,
"offset": 0
}
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKList of API key metadata records.Inline
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
» list[ApiKeyMetadataResponse]falsenone[API key metadata returned by list operations. Secret material is omitted.]
»» idstringfalsenonenone
»» displayNamestringfalsenonenone
»» apiIdstringfalsenoneAPI ID the key belongs to.
»» appIdstring¦nullfalsenoneID of the application this key is associated with, if any. Analytics attribution only.
»» appDisplayNamestring¦nullfalsenoneDisplay name of the associated application, if any.
»» statusstringfalsenonenone
»» expiresAtstring(date-time)¦nullfalsenonenone
»» createdAtstring(date-time)falsenonenone
»» revokedAtstring(date-time)¦nullfalsenonenone
» countintegerfalsenoneNumber of items returned in this page.
» paginationPaginationfalsenoneStandard pagination metadata returned with collection responses.
»» totalintegertruenoneTotal number of records matching the query.
»» limitintegertruenoneMaximum number of records returned in this response.
»» offsetintegertruenoneNumber of records skipped before this page.

Enumerated Values​

PropertyValue
statusACTIVE
statusREVOKED

Enumerated Values​

PropertyValue
statuserror

Generate an API key​

POST /apis/{apiId}/api-keys/generate

Code samples


curl -X POST https://localhost:9543/api-portal/api/v0.9/apis/{apiId}/api-keys/generate \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Generates an API key stored in the API Portal (devportal is source of truth). The plaintext secret is returned once in the response and never persisted. A apikey.generated webhook event is published to the organization's configured webhook subscribers so they can register the key (e.g. with a gateway). Key id is optional — a UUID handle is generated when it is omitted; when provided it must match ^[a-z0-9][a-z0-9_-]{0,127}$. expiresAt must include a timezone when sent as an ISO-8601 string.

Payload

{
"id": "weather_prod_key",
"expiresAt": "2026-12-31T23:59:59Z"
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:create`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyApiKeyRequesttrueAPI key payload. id must be lowercase and may contain numbers, underscores, and hyphens. displayName is an optional human-readable label that defaults to id when omitted. expiresAt can be an ISO-8601 datetime with timezone, epoch seconds, or epoch milliseconds. The parent resource (API or MCP server, depending on the path) is identified by the corresponding path parameter.
apiIdpathstringtrueThe API's handle (unique per org). Resolves only to REST, SOAP, WebSocket, WebSub, and GraphQL APIs. Model Context Protocol (MCP) servers are addressed via /mcp-servers.

Example responses

201 Response

{
"id": "weather_prod_key",
"displayName": "Weather Prod Key",
"key": "ak_dGhpcyBpcyBub3QgYSByZWFsIGtleQ",
"expiresAt": "2026-12-31T23:59:59Z",
"status": "ACTIVE"
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

403 Response

{
"status": "error",
"code": "FORBIDDEN",
"message": "Forbidden"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
201CreatedGenerated API key. The plaintext key is returned exactly once.ApiKeyResponse
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
403ForbiddenRequest is forbidden. The caller lacks the required permission, or the current runtime mode disallows the operation (read-only mode). It is also returned when the request names an organization other than the single one this instance serves. A nonexistent organization is answered identically to one belonging to someone else, so the response cannot be used to discover what a shared database holds.ErrorResponse
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Enumerated Values​

PropertyValue
statuserror

Response Headers​

StatusHeaderTypeFormatDescription
201LocationstringuriURL of the generated API key resource.

List API keys​

GET /apis/{apiId}/api-keys

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/apis/{apiId}/api-keys \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Lists API keys for the given API.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:read`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
appIdquerystringfalseOptional application ID used to filter API keys associated with that application.
limitqueryintegerfalseMaximum number of records to return.
offsetqueryintegerfalseNumber of records to skip before returning results.
apiIdpathstringtrueThe API's handle (unique per org). Resolves only to REST, SOAP, WebSocket, WebSub, and GraphQL APIs. Model Context Protocol (MCP) servers are addressed via /mcp-servers.

Example responses

200 Response

{
"list": [
{
"id": "weather_prod_key",
"displayName": "Weather Prod Key",
"apiId": "weather-api-v1",
"appId": "my-weather-app",
"appDisplayName": "My Mobile App",
"status": "ACTIVE",
"expiresAt": "2026-12-31T23:59:59Z",
"createdAt": "2019-08-24T14:15:22Z",
"revokedAt": "2019-08-24T14:15:22Z"
}
],
"count": 1,
"pagination": {
"total": 42,
"limit": 20,
"offset": 0
}
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKList of API key metadata records.Inline
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
» list[ApiKeyMetadataResponse]falsenone[API key metadata returned by list operations. Secret material is omitted.]
»» idstringfalsenonenone
»» displayNamestringfalsenonenone
»» apiIdstringfalsenoneAPI ID the key belongs to.
»» appIdstring¦nullfalsenoneID of the application this key is associated with, if any. Analytics attribution only.
»» appDisplayNamestring¦nullfalsenoneDisplay name of the associated application, if any.
»» statusstringfalsenonenone
»» expiresAtstring(date-time)¦nullfalsenonenone
»» createdAtstring(date-time)falsenonenone
»» revokedAtstring(date-time)¦nullfalsenonenone
» countintegerfalsenoneNumber of items returned in this page.
» paginationPaginationfalsenoneStandard pagination metadata returned with collection responses.
»» totalintegertruenoneTotal number of records matching the query.
»» limitintegertruenoneMaximum number of records returned in this response.
»» offsetintegertruenoneNumber of records skipped before this page.

Enumerated Values​

PropertyValue
statusACTIVE
statusREVOKED

Enumerated Values​

PropertyValue
statuserror

Regenerate an API key​

POST /apis/{apiId}/api-keys/regenerate

Code samples


curl -X POST https://localhost:9543/api-portal/api/v0.9/apis/{apiId}/api-keys/regenerate \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Regenerates the secret for an existing API key identified by keyId in the request body. An apikey.regenerated webhook event is published to the organization's configured webhook subscribers so they can invalidate the old secret (e.g. at a gateway). The new plaintext secret is returned once and never persisted.

Payload

{
"keyId": "weather_prod_key",
"expiresAt": "2027-01-01T00:00:00Z"
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:update`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyobjecttrueIdentifies the API key to regenerate by its keyId. expiresAt is optional and, if provided, updates the key's expiry; the key's id/displayName cannot be changed by this operation.
» keyIdbodystringtrueThe key's handle — the id returned by generate or list.
» expiresAtbodyanyfalseNew expiry for the key. The value can be an ISO-8601 datetime with timezone, epoch seconds, or epoch milliseconds. Omit to leave the current expiry unchanged.
»» anonymousbodystring(date-time)falsenone
»» anonymousbodynumberfalsenone
apiIdpathstringtrueThe API's handle (unique per org). Resolves only to REST, SOAP, WebSocket, WebSub, and GraphQL APIs. Model Context Protocol (MCP) servers are addressed via /mcp-servers.

Example responses

200 Response

{
"id": "weather_prod_key",
"displayName": "Weather Prod Key",
"key": "ak_dGhpcyBpcyBub3QgYSByZWFsIGtleQ",
"expiresAt": "2026-12-31T23:59:59Z",
"status": "ACTIVE"
}

403 Response

{
"status": "error",
"code": "FORBIDDEN",
"message": "Forbidden"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

409 Response

{
"status": "error",
"code": "CONFLICT",
"message": "Cannot regenerate a revoked key"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKGenerated or regenerated API key. The plaintext key is returned exactly once.ApiKeyResponse
403ForbiddenRequest is forbidden. The caller lacks the required permission, or the current runtime mode disallows the operation (read-only mode). It is also returned when the request names an organization other than the single one this instance serves. A nonexistent organization is answered identically to one belonging to someone else, so the response cannot be used to discover what a shared database holds.ErrorResponse
404Not FoundResource not found.ErrorResponse
409ConflictThe key has already been revoked and cannot be regenerated.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Revoke an API key​

POST /apis/{apiId}/api-keys/revoke

Code samples


curl -X POST https://localhost:9543/api-portal/api/v0.9/apis/{apiId}/api-keys/revoke \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Revokes an existing API key identified by keyId in the request body. An apikey.revoked webhook event is published to the organization's configured webhook subscribers so they can immediately reject requests carrying the key (e.g. at a gateway).

Payload

{
"keyId": "weather_prod_key"
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:revoke`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyobjecttrueIdentifies the API key to revoke by its keyId.
» keyIdbodystringtrueThe key's handle — the id returned by generate or list.
apiIdpathstringtrueThe API's handle (unique per org). Resolves only to REST, SOAP, WebSocket, WebSub, and GraphQL APIs. Model Context Protocol (MCP) servers are addressed via /mcp-servers.

Example responses

403 Response

{
"status": "error",
"code": "FORBIDDEN",
"message": "Forbidden"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

409 Response

{
"status": "error",
"code": "CONFLICT",
"message": "Key already revoked or not found"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
204No ContentAPI key revoked successfully.None
403ForbiddenRequest is forbidden. The caller lacks the required permission, or the current runtime mode disallows the operation (read-only mode). It is also returned when the request names an organization other than the single one this instance serves. A nonexistent organization is answered identically to one belonging to someone else, so the response cannot be used to discover what a shared database holds.ErrorResponse
404Not FoundResource not found.ErrorResponse
409ConflictThe key has already been revoked.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Associate an API key with an application​

POST /apis/{apiId}/api-keys/associate

Code samples


curl -X POST https://localhost:9543/api-portal/api/v0.9/apis/{apiId}/api-keys/associate \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Associates (or re-associates) an existing API key with an application, for analytics attribution only — it has no effect on the key's validity or authorization. An apikey.application_updated webhook event is published once for this key, with a payload of { key_id, application }.

Payload

{
"keyId": "weather_prod_key",
"appId": "my-weather-app"
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:update`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyobjecttrueIdentifies the API key and the application to associate it with.
» keyIdbodystringtrueThe key's handle — the id returned by generate or list.
» appIdbodystringtrueAPI Portal application ID to associate the key with.
apiIdpathstringtrueThe API's handle (unique per org). Resolves only to REST, SOAP, WebSocket, WebSub, and GraphQL APIs. Model Context Protocol (MCP) servers are addressed via /mcp-servers.

Example responses

200 Response

{
"application": {
"id": "my-weather-app",
"displayName": "My Mobile App"
}
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

403 Response

{
"status": "error",
"code": "FORBIDDEN",
"message": "Forbidden"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

409 Response

{
"status": "error",
"code": "CONFLICT",
"message": "Cannot associate a revoked key"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKAssociation updated.ApiKeyApplicationResponse
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
403ForbiddenRequest is forbidden. The caller lacks the required permission, or the current runtime mode disallows the operation (read-only mode). It is also returned when the request names an organization other than the single one this instance serves. A nonexistent organization is answered identically to one belonging to someone else, so the response cannot be used to discover what a shared database holds.ErrorResponse
404Not FoundResource not found.ErrorResponse
409ConflictThe key has already been revoked and cannot be associated with an application.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Enumerated Values​

PropertyValue
statuserror

Remove an API key's application association​

POST /apis/{apiId}/api-keys/dissociate

Code samples


curl -X POST https://localhost:9543/api-portal/api/v0.9/apis/{apiId}/api-keys/dissociate \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Removes the application association from an API key identified by keyId in the request body, if any. An apikey.application_updated webhook event is published once for this key, with application set to null.

Payload

{
"keyId": "weather_prod_key"
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:update`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyobjecttrueIdentifies the API key to remove the application association from.
» keyIdbodystringtrueThe key's handle — the id returned by generate or list.
apiIdpathstringtrueThe API's handle (unique per org). Resolves only to REST, SOAP, WebSocket, WebSub, and GraphQL APIs. Model Context Protocol (MCP) servers are addressed via /mcp-servers.

Example responses

403 Response

{
"status": "error",
"code": "FORBIDDEN",
"message": "Forbidden"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
204No ContentAssociation removed (or none existed).None
403ForbiddenRequest is forbidden. The caller lacks the required permission, or the current runtime mode disallows the operation (read-only mode). It is also returned when the request names an organization other than the single one this instance serves. A nonexistent organization is answered identically to one belonging to someone else, so the response cannot be used to discover what a shared database holds.ErrorResponse
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

List API keys associated with an application​

GET /applications/{applicationId}/api-keys

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/applications/{applicationId}/api-keys \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Lists all API keys (across every API) currently associated with the given application. Unlike listApiKeys, no apiId filter is required.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:api_key:read`, `dp:api_key:manage`

Parameters​

NameInTypeRequiredDescription
limitqueryintegerfalseMaximum number of records to return.
offsetqueryintegerfalseNumber of records to skip before returning results.
applicationIdpathstringtrueThe application's handle (unique per org).

Example responses

200 Response

{
"list": [
{
"id": "weather_prod_key",
"displayName": "Weather Prod Key",
"apiId": "weather-api-v1",
"appId": "my-weather-app",
"appDisplayName": "My Mobile App",
"status": "ACTIVE",
"expiresAt": "2026-12-31T23:59:59Z",
"createdAt": "2019-08-24T14:15:22Z",
"revokedAt": "2019-08-24T14:15:22Z"
}
],
"count": 1,
"pagination": {
"total": 42,
"limit": 20,
"offset": 0
}
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKList of API key metadata records.Inline
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
» list[ApiKeyMetadataResponse]falsenone[API key metadata returned by list operations. Secret material is omitted.]
»» idstringfalsenonenone
»» displayNamestringfalsenonenone
»» apiIdstringfalsenoneAPI ID the key belongs to.
»» appIdstring¦nullfalsenoneID of the application this key is associated with, if any. Analytics attribution only.
»» appDisplayNamestring¦nullfalsenoneDisplay name of the associated application, if any.
»» statusstringfalsenonenone
»» expiresAtstring(date-time)¦nullfalsenonenone
»» createdAtstring(date-time)falsenonenone
»» revokedAtstring(date-time)¦nullfalsenonenone
» countintegerfalsenoneNumber of items returned in this page.
» paginationPaginationfalsenoneStandard pagination metadata returned with collection responses.
»» totalintegertruenoneTotal number of records matching the query.
»» limitintegertruenoneMaximum number of records returned in this response.
»» offsetintegertruenoneNumber of records skipped before this page.

Enumerated Values​

PropertyValue
statusACTIVE
statusREVOKED

Was this page helpful?