Admiral

Api keys

Create an API key

POST
/v1/api-keys

Scope: apikey:write

Authorization

bearerAuth
AuthorizationBearer <token>

An API key, or an access token minted from one. Pass it in the Authorization header: Bearer admp_...

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

CreateApiKeyRequest creates an API key for the caller.

Response Body

application/json

curl -X POST "https://example.com/v1/api-keys" \  -H "Content-Type: application/json" \  -d '{    "api_key": {}  }'
{  "api_key": {    "id": "string",    "name": "string",    "scopes": [      "string"    ],    "status": "API_KEY_STATUS_UNSPECIFIED",    "expires_at": "2023-01-15T01:30:15.01Z",    "last_used_at": "2023-01-15T01:30:15.01Z",    "revoked_at": "2023-01-15T01:30:15.01Z",    "created_by": {      "id": "string",      "display_name": "string",      "email": "string"    },    "created_at": "2023-01-15T01:30:15.01Z"  },  "secret": "string"}