Token Management

Token management endpoints allow you to handle authentication and token refresh.

POST/v1/token

Obtain a token

This endpoint allows you to obtain a new authentication token.

Required attributes

  • Name
    username
    Type
    string
    Description

    The username of the user.

  • Name
    password
    Type
    string
    Description

    The password of the user.

Request

POST
/v1/token
curl -X POST https://api.protocol.chat/v1/token \
  -H "Content-Type: application/json" \
  -d '{"username": "your_username", "password": "your_password"}'

Response

{
  "access": "your_access_token",
  "refresh": "your_refresh_token"
}

POST/v1/token/refresh

Refresh a token

This endpoint allows you to refresh an existing authentication token.

Required attributes

  • Name
    refresh
    Type
    string
    Description

    The refresh token obtained during the initial authentication.

Request

POST
/v1/token/refresh
curl -X POST https://api.protocol.chat/v1/token/refresh \
  -H "Content-Type: application/json" \
  -d '{"refresh": "your_refresh_token"}'

Response

{
  "access": "your_new_access_token"
}

Was this page helpful?