curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/auth/keys' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Two-Person Tent",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"rate_limit_per_minute": 8,
"scopes": [
"read"
]
}'
{
"created_at": "2026-08-31T14:22:05Z",
"expires_at": "2026-08-31T14:22:05Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"key": "string",
"name": "Two-Person Tent",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"prefix": "string",
"rate_limit_per_minute": 8,
"scopes": [
"read"
]
}
Create a new API key for the current org.
Required scope: admin
POST
/
api
/
v1
/
auth
/
keys
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/auth/keys' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Two-Person Tent",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"rate_limit_per_minute": 8,
"scopes": [
"read"
]
}'
{
"created_at": "2026-08-31T14:22:05Z",
"expires_at": "2026-08-31T14:22:05Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"key": "string",
"name": "Two-Person Tent",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"prefix": "string",
"rate_limit_per_minute": 8,
"scopes": [
"read"
]
}
Required scope:
admin
Request body
ApiKeyCreateRequest
string
required
Friendly name for the key.
string
Optional org id. Must match the authenticated org when provided.
integer (int32)
Optional rate limit override for this key. ·
0 disables rate limiting for this key. · positive values cap requests per minute. · values that are not positive are treated as unset.ApiScope[]
Scopes for the key (defaults to admin).
Response
ApiKeyCreateResponse
string
required
string
string
required
string
required
string
required
string
required
string
required
integer (int32)
ApiScope[]
required
Status codes
| Code | Meaning |
|---|---|
201 | API key created |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/auth/keys' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "Two-Person Tent",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"rate_limit_per_minute": 8,
"scopes": [
"read"
]
}'
{
"created_at": "2026-08-31T14:22:05Z",
"expires_at": "2026-08-31T14:22:05Z",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"key": "string",
"name": "Two-Person Tent",
"org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"prefix": "string",
"rate_limit_per_minute": 8,
"scopes": [
"read"
]
}
Last modified on August 31, 2026