Create a new permanent access token

POST /token/create


Description

The method creates a new permanent access token with a specified expiration date (number of days or exact date and time of expiration). A JWT token is required in the header for access.


Request format

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

Query Parameters

ParameterTypePassed InRequiredDescription
tokenstringHeaderUser’s JWT token

Request Body (JSON)

FieldTypeRequiredDescription
tokenstringToken identifier (e.g., UUID)
expiresstringToken expiration date and time (ISO 8601) or number of days

Example Request (cURL)

curl -X POST "https://api.neuro-vision.ru/v1/token/create" 
  -H "Content-Type: application/json" 
  -H "Authorization: Bearer jwt.temporary.token" 
  -d '{
    "token": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "expires": "2025-06-30T23:59:59.000Z"
  }'

Example Answers

Success (200 OK)
{
  "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"
}