Skip to main content
POST
/
api
/
v1
/
organizations
/
{org_id}
/
users
/
{user_id}
/
token
Create User Token
curl --request POST \
  --url https://anaconda.com/api/v1/organizations/{org_id}/users/{user_id}/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expires_at": "2023-11-07T05:31:56Z",
  "expiration_tolerance_months": 0,
  "send_token_email": true
}
'
{
  "token": "<string>",
  "expires_at": "<string>"
}
If send_token_email is true (the default), the user receives their token via email. The token enables the user to access packages from their organization’s repository channels.

Authorizations

Authorization
string
header
required

Bearer token obtained by authenticating with service account credentials (client_id and client_secret).

See the Getting started page for the full authentication flow.

Path Parameters

org_id
string
required

Your organization ID, found in your organization's URL: anaconda.com/app/organizations/<ORG_ID>/.

user_id
string<uuid>
required

The unique identifier of the user to assign a token to.

Body

application/json
expires_at
string<date-time>
required

The expiration date and time for the token in ISO 8601 format (for example, 2026-12-31T00:00:00+00:00).

expiration_tolerance_months
integer
default:0

Number of additional months to extend the token beyond the expires_at date as a grace period.

send_token_email
boolean
default:true

Whether to send the token to the user via email.

Response

Token created successfully

token
string
required

The generated access token value.

expires_at
string | null

The expiration date and time of the token.