Authentication

Generate an API token

Allows generating a new API token with a custom expiration time. The expiration time must be between 1 hour and 4 years and supports these formats:

  • ISO 8601 duration as string
  • [-][DD]D[,][HH:MM:]SS[.ffffff] as string
    • Ex: '1d,01:02:03.000004' or '1D01:02:03.000004' or '01:02:03'
  • Any positive int or float; assumed to be seconds

The token cannot be refreshed and is intended for API access. Secure storage of the token must be handled by the client (we only store the token identifier).

A maximum of 20 active API tokens are allowed per user.

POST
/auth/token

Authorization

token_auth
AuthorizationBearer <token>

Token-based authentication using access tokens.

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://v2.api.piktid.com/auth/token" \  -H "Content-Type: application/json" \  -d '{    "expiration": "string"  }'
{
  "token": "string",
  "expiration_date": "string"
}
{
  "error": "Invalid request",
  "detail": [
    {
      "field": null,
      "message": "string",
      "position": "query"
    }
  ]
}
Empty