Company logoTrust Center Documentation
API v1 ReferenceIntegrationsApi keys

Create API key

Create a new API key with specified permissions and metadata. The bearer key is returned by this call and never again: listing keys only returns a masked…

POST
/api/v1/integrations/api-keys

Create a new API key with specified permissions and metadata.

The bearer key is returned by this call and never again: listing keys only returns a masked value, so there is no way to recover it later. Write it straight into server-side secret storage, and if it is lost, create a replacement rather than trying to retrieve it.

A key carries the permissions of its tenant, so never ship it in a browser, a mobile app, or anything else running on someone else's device. Rotate by creating the new key before deleting the old one, because deleting revokes access immediately.

Authorization

bearerAuth
AuthorizationBearer <token>

Use an Admin Center JWT access token to list, create, or delete API keys.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/integrations/api-keys" \  -H "Content-Type: application/json" \  -d '{    "name": "Production Integration",    "role": "account_manager"  }'
{  "success": true,  "data": {    "token": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "description": "string",      "token": "string",      "role": "string",      "expires_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z"    },    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"  }}

How is this guide?