logoAccess

Create API key

POST
/api/v1/api-keys/

Generate a new API key. The full key is returned only once — store it securely.

Authorization

apiKeyHeader
headerx-api-key<token>

API key for authentication. Generate from the dashboard or via POST /v1/api-keys.

Header Parameters

x-api-key*string

API key for authentication

Length1 <= length

Request Body

  1. body
name*string

Human-readable label for this API key

Length1 <= length
expires_in?number

Key expiry duration in seconds from now. Minimum 3600 (1 hour). Omit for no expiry.

Range3600 <= value
preset?string

A named bundle of permissions, such as read_only or developer. Provide this or permissions.

permissions?array<string>

Permissions granted to this key: resource:action, or wildcards (, payments:, *:read) that never match sensitive permissions. Provide this or preset. The new key can't hold permissions the calling key doesn't.

Response Body

Response for status 200

application/json
  1. response
id*string
key*string
name*string
status*string
permissions*array<string>
preset*string|null
expires_at*string|null
created_at*string
curl -X POST 'https://api.tryaccess.xyz/api/v1/api-keys/' \  -H 'x-api-key: string' \  -H 'Content-Type: application/json' \  -d '{  "name": "Production Key"}'
{  "id": "string",  "key": "string",  "name": "string",  "status": "string",  "permissions": [    "string"  ],  "preset": "string",  "expires_at": "string",  "created_at": "string"}

How is this guide?