Create Invite Code
POST
/api/superadmin/invite-codes
const url = 'https://example.com/api/superadmin/invite-codes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"example","description":"example","max_uses":1,"expires_at":"example","org_id":"example","role":"member"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/superadmin/invite-codes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "description": "example", "max_uses": 1, "expires_at": "example", "org_id": "example", "role": "member" }'Create a new invite code.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Responses
Section titled “ Responses ”Successful Response
Media type application/json
InviteCodeResponse
object
id
required
Id
string
code
required
Code
string
created_by
required
Created By
string
uses_count
required
Uses Count
integer
role
required
Role
string
is_active
required
Is Active
boolean
Example generated
{ "id": "example", "code": "example", "description": "example", "created_by": "example", "max_uses": 1, "uses_count": 1, "expires_at": "example", "org_id": "example", "role": "example", "is_active": true, "created_at": "example"}Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}