Token and uid mapping
Token issuance, renewal, verification and uid mapping.
Group overview
Generated at build time from the public REST API definition: tag tokens, 5 operations (out of 189). For authentication, envelope and pagination conventions see REST API overview.
| Method | Path | Summary |
|---|---|---|
GET | /v1/meta/privileges | Privilege catalogue per role |
POST | /v1/tokens | Issue a channel token |
POST | /v1/tokens/renew | Renew a token |
GET | /v1/tokens/verify | Verify a token and return its payload |
POST | /v1/uids:resolve | Resolve rtc uids to IM user ids |
Operation details
GET /v1/meta/privileges
Privilege catalogue per role
Authentication: project credentials (Base64 of customerId:customerSecret)
Response
| Status codes | Description / schema |
|---|---|
200 | privilege catalogue per role — object{ privileges, roles } |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/meta/privileges" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/tokens
Issue a channel token
getRTCTokenInfo implementation for the IM RTC Provider. Wildcard tokens (channelName: "*" or wildcard: true) are allowed; uid may be supplied explicitly or derived from userId.
Authentication: project credentials (Base64 of customerId:customerSecret)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
channelName | string | ||
channel | string | alias of channelName | |
uid | integer | 1..2147483647 | |
userId | string | IM user id; when supplied the rtcUid is derived and bound | |
role | enum(host | audience) | default "host" | |
ttlSeconds | integer | 60..86400 | |
wildcard | boolean |
{
"channelName": "weekly-sync",
"uid": 10001,
"role": "host",
"ttlSeconds": 3600
}Response
| Status codes | Description / schema |
|---|---|
200 | issued — TokenIssueResponse |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
403 | Banned or service not enabled — Error |
415 | Content-Type must be application/json — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/tokens" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"channelName":"weekly-sync","uid":10001,"role":"host","ttlSeconds":3600}'POST /v1/tokens/renew
Renew a token
Accepts a token within its renewal grace window and returns a fresh token with the same channel, uid and (non-escalated) privileges.
Authentication: project credentials (Base64 of customerId:customerSecret)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
token | string | is |
{
"token": "$RTC_TOKEN"
}Response
| Status codes | Description / schema |
|---|---|
200 | renewed — TokenIssueResponse |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/tokens/renew" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"token":"$RTC_TOKEN"}'GET /v1/tokens/verify
Verify a token and return its payload
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
token | query | is | string | |
channelName | query | string |
Response
| Status codes | Description / schema |
|---|---|
200 | valid — object{ valid, payload } |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/tokens/verify?token=%24RTC_TOKEN&channelName=weekly-sync" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/uids:resolve
Resolve rtc uids to IM user ids
getUserIdsWithRTCUids implementation. Partial results are returned; unknown uids are omitted.
Authentication: project credentials (Base64 of customerId:customerSecret)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
rtcUids | array<integer> | is | up to 200 items |
channelName | string |
{
"rtcUids": [
10001,
10002,
99999
],
"channelName": "weekly-sync"
}Response
| Status codes | Description / schema |
|---|---|
200 | mapping keyed by uid — object |
400 | Invalid parameter — Error |
401 | Missing/invalid credentials — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/uids:resolve" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"rtcUids":[10001,10002,99999],"channelName":"weekly-sync"}'Schemas used by this group
Error — object{ code, message, reason, sdkCode, details }
| Field | Type | Required | Description |
|---|---|---|---|
code | string | is | stable machine code, see errors.json |
message | string | is | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |
TokenIssueResponse — object
| Field | Type | Required | Description |
|---|---|---|---|
appId | string | is | |
channelName | string | is | |
rtcToken | string | is | |
rtcUid | integer | is | 1..2147483647 |
role | enum(host | audience) | is | |
privileges | array<string> | is | |
controlToken | string | Opaque control-plane token for REST diagnostics/renewal. TokenIssueResult.controlToken is optional; toResult() always sets it. | |
mediaRoom | string | SFU room name when the media adapter namespaces by App ID (TokenIssueResult.mediaRoom). | |
expireAt | string | is | format date-time |
privilegeExpireAt | string | is | format date-time |