POST
/api/admin/invite-codesAdminCreate an invite code
Registers a new invite code. created_at must be within 30 seconds of the server clock (a stale definition is refused with 412) and created_by is overwritten with the caller's uid.
operationId
post_api_admin_invite_codesAdministrationAuthentication & permissionsAdmin
Platform administrators only
- Accepted credentials
- Auth server session (refresh token cookie)
cookie "refresh_token_<auth_server_app_id>" - Access token (cookie)
cookie "access_token_<auth_server_app_id>" - Access token (Bearer)
Authorization: Bearer <JWT>
- Auth server session (refresh token cookie)
- Who may call
- Platform administrators only
Request body
Required — The invite code definition; created_by is ignored and set to the caller.
application/json
InviteCodeDefinition
| Property | Type | Description |
|---|---|---|
| invite_code* | string | minLength: 8maxLength: 64pattern: ^[A-Za-z0-9_-]+$ |
| created_at* | number | minimum: 0 |
| max_uses* | integer | exclusiveMinimum: 0 |
| description | string | maxLength: 128 |
| created_by | string (uuid) |
JSONExample
"invite_code""string"
"created_at"1.5
"max_uses"1
"description""string"
"created_by""123e4567-e89b-12d3-a456-426614174000"
Responses
application/json
ResourceCreationResponse
| Property | Type | Description |
|---|---|---|
| success* | true | |
| message* | string | |
| resource_id* | string | Identifier of the created / affected resource |
JSONExample
"success"true
"message""string"
"resource_id""string"
Example request
bashcurl
curl -X POST 'https://auth.schemavaults.com/api/admin/invite-codes' \
-b 'refresh_token_<auth_server_app_id>=<value>' \
-H 'Content-Type: application/json' \
-d '{
"invite_code": "string",
"created_at": 1.5,
"max_uses": 1,
"description": "string",
"created_by": "123e4567-e89b-12d3-a456-426614174000"
}'