POST /devices/token

Regenerate JWT token for a device. This invalidates all previous tokens for this device.

Use case: If a token is compromised, regenerate to revoke access.

application/json

Body Required

  • device_id string Required
  • device_secret string Required

    Device secret returned at creation time

Responses

  • 200 application/json

    Token regenerated successfully

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • device_id string
      • token string

        New JWT token (old tokens are now invalid)

POST /devices/token
curl \
 --request POST 'http://localhost:7001/devices/token' \
 --header "Content-Type: application/json" \
 --data '{"device_id":"550e8400-e29b-41d4-a716-446655440000","device_secret":"a1b2c3d4e5f6g7h8"}'
Request examples
{
  "device_id": "550e8400-e29b-41d4-a716-446655440000",
  "device_secret": "a1b2c3d4e5f6g7h8"
}
Response examples (200)
{
  "status": true,
  "code": 200,
  "message": "Token regenerated successfully. All previous tokens are now invalid.",
  "data": {
    "device_id": "string",
    "token": "string"
  }
}