POST/api/admin/invite-codesAdmin

Create 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_codesAdministration

Authentication & permissionsAdmin

Platform administrators only

Accepted credentials
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
PropertyTypeDescription
invite_code*string

minLength: 8maxLength: 64pattern: ^[A-Za-z0-9_-]+$

created_at*number

minimum: 0

max_uses*integer

exclusiveMinimum: 0

descriptionstring

maxLength: 128

created_bystring (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
PropertyTypeDescription
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"
}'

Other methods on this path