Update token

POST /token/update


Description

The method allows you to change the expiration date of a user’s permanent access token by its identifier. JWT token in the header is required for access.


Request format

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

Query Parameters

ParameterTypeWhere PassedRequiredDescription
tokenstringHeaderUser’s JWT token

Request Body (JSON)

FieldTypeRequiredDescription
tokenstringUser’s JWT token
token_idstringToken identifier (UUID)
expiresstringNew token expiration date (ISO 8601 string)

Example Request (cURL)

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

Example Answers

Success (200 OK)
{
  "code": 0,
  "status": "ok",
  "token": {
    "expires": "2025-12-31T23:59:59.000Z",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }
}
Error (400 Bad Request)
{
  "message": "invalid schema",
  "status": "error"
}
Error (401 Unauthorized)
{
  "message": "access denied",
  "status": "error"
}