HostingDelivery

Create Delivery API token

POST/api/delivery/accounts/{id}/api_tokens

Creates an API token for a Delivery account. The plain token is returned only once.

X-Api-Token<token>

API token used to authenticate requests.

In: header

Path Parameters

id*integer
Format int32

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

label*string

Human-readable API token label.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/delivery/accounts/0/api_tokens" \  -H "X-Api-Token: YOUR_API_TOKEN" \  -H "Accept: application/json" \  -H "Content-Type: application/json" \  -d '{    "label": "string"  }'
{
  "resources": [
    {
      "id": "string",
      "label": "string",
      "token_preview": "string",
      "allow_nets": "string",
      "created_at": "string",
      "last_used_at": "string"
    }
  ],
  "pagination": {}
}
{
  "message": "Unauthorized",
  "errors": []
}
{
  "message": "Forbidden",
  "errors": []
}
{
  "message": "Not found",
  "errors": []
}
{
  "message": "Validation failed",
  "errors": [
    {
      "field": "name",
      "description": "is not valid"
    }
  ]
}