Create a new permanent access token

POST /token/create


Description

The method creates a new permanent access token with a specified expiration date. A token is required, see Authorization.


Request format

  • HTTP method: POST
  • URL: /token/create
  • Content type: application/json

Authorization

Pass the token in one of two ways:

  • the token: <jwt-token> header — a temporary JWT token obtained with user/login;
  • the token field in the request body — a permanent API token (UUID) from your account.

Without a token the request returns 401 access denied.


Request Body (JSON)

FieldTypeRequiredDescription
tokenstring—Permanent API token (UUID), if the token header is not sent
expiresstring—Expiration date and time in UTC, format YYYY-MM-DDTHH:MM:SSZ. If omitted, the token does not expire

Example Request (cURL)

curl -X POST "https://api.neuro-vision.ru/v1/token/create" -H "Content-Type: application/json" -H "token: <jwt-token>" -d '{"expires": "2025-06-30T23:59:59.000Z"}'

Example Answers

Success (201 Created)

{
  "message": "new token created",
  "status": "ok",
  "token": {
    "expires": "2020-04-27T23:09:06.970Z",
    "id": "1252cb60-88dc-11ea-b6b1-bc0e87309155"
  }
}

Error (400 Bad Request)

{
  "message": "invalid schema",
  "status": "error"
}

Error (401 Unauthorized)

{
  "message": "access denied",
  "status": "error"
}