Skip to main content
POST
/
api
/
servers
/
{serverID}
/
invites
Create invite
curl --request POST \
  --url http://localhost:8091/api/servers/{serverID}/invites \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expiresIn": "<string>",
  "maxUses": 123,
  "email": "<string>"
}
'
{
  "data": {
    "id": "<string>",
    "code": "<string>",
    "serverId": "<string>",
    "createdBy": "<string>",
    "useCount": 123,
    "active": true,
    "createdAt": "2023-11-07T05:31:56Z",
    "expiresAt": "2023-11-07T05:31:56Z",
    "maxUses": 123,
    "server": {
      "id": "<string>",
      "name": "<string>",
      "createdBy": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "iconPath": "<string>",
      "role": "<string>",
      "memberCount": 123
    }
  }
}

Authorizations

Authorization
string
header
required

Session token obtained from /api/auth/login or /api/auth/register. Pass as: Authorization: Bearer

Path Parameters

serverID
string
required

Server ID

Body

application/json
expiresIn
string

Duration until expiry (e.g. '24h', '7d')

maxUses
integer

Maximum number of times the invite can be used

email
string

Email address to send the invite to

Response

201 - application/json

Invite created

data
object