Przejdź do treści
SoulFire LogoSoulFire

Generate user API token

Ten poradnik jest dostępny tylko po angielsku.

POST
/v1/users/{id}/tokens/api:generate

Generates a new API token (JWT) for a specific user.

Authorization

headerAuthorizationBearer <JWT>

Preferred API authentication. Use a JWT with the api audience.

Path Parameters

id*string

The unique identifier (UUID) of the user to generate a token for. Cannot be the ID of the requesting user (cannot generate token for self via this method). Cannot be the root user ID (00000000-0000-0000-0000-000000000000).

Formatuuid

Response Body

Response message containing the newly generated API token.

application/json
  1. response

Response message containing the newly generated API token.

token*string

The generated JWT token for API authentication. This token is signed with the server's secret key and has the "api" audience. The token does not expire but can be invalidated by updating the user's min_issued_at. Should be stored securely as it grants full access as the specified user.

Example Request
curl -X POST 'http://127.0.0.1:38765/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/tokens/api:generate'
Example Response
{
  "token": "string"
}

Czy ta strona jest pomocna?