Open MCP Portaldocs
ReferenceService accounts

Create a key (team owners and admins, browser session only); the secret is shown once

POST/v1/teams/{team}/service-accounts/{serviceAccountId}/keys

409 too_many_keys (at most 2 active keys, for rotation). 422 gateway_not_usable (details.gatewayIds) when a scoped gateway isn't one the service account can use. 409 disabled for a turned-off account.

Path Parameters

team*string

Team slug or ID

serviceAccountId*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/teams/string/service-accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/keys" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "data": {    "key": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "prefix": "string",      "status": "active",      "createdAt": "2019-08-24T14:15:22Z",      "createdByName": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "lastUsedAt": "2019-08-24T14:15:22Z",      "revokedAt": "2019-08-24T14:15:22Z",      "gateways": [        {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "slug": "string",          "name": "string",          "exists": true        }      ]    },    "secret": "string"  }}