Invites

Create multiple invites

POST
https://discourse.example.com/invites/create-multiple.json

Body

application/json
emailstring

pass 1 email per invite to be generated. other properties will be shared by each invite.

Example
[
  "not-a-user-yet-1@example.com",
  "not-a-user-yet-2@example.com"
]
skip_emailbooleanfalse
custom_messagestring

optional, for email invites

max_redemptions_allowedinteger1

optional, for link invites

Example
5
topic_idinteger
group_idsstring

Optional, either this or group_names. Comma separated list for multiple ids.

Example
42,43
group_namesstring

Optional, either this or group_ids. Comma separated list for multiple names.

Example
foo,bar
expires_atstring

optional, if not supplied, the invite_expiry_days site setting is used

Parameters

Api-Keystringrequiredheader
Api-Usernamestringrequiredheader

Response

200OKobject

success response

Response fields application/json
num_successfully_created_invitationsinteger
Example
42
num_failed_invitationsinteger
Example
42
failed_invitationsArray<any>
Example
[]
successful_invitationsarray
Example
[
  {
    "id": 42,
    "link": "http://example.com/invites/9045fd767efe201ca60c6658bcf14158",
    "email": "not-a-user-yet-1@example.com",
    "emailed": true,
    "custom_message": "Hello world!",
    "topics": [],
    "groups": [],
    "created_at": "2021-01-01T12:00:00.000Z",
    "updated_at": "2021-01-01T12:00:00.000Z",
    "expires_at": "2021-02-01T12:00:00.000Z",
    "expired": false
  },
  {
    "id": 42,
    "link": "http://example.com/invites/c6658bcf141589045fd767efe201ca60",
    "email": "not-a-user-yet-2@example.com",
    "emailed": true,
    "custom_message": "Hello world!",
    "topics": [],
    "groups": [],
    "created_at": "2021-01-01T12:00:00.000Z",
    "updated_at": "2021-01-01T12:00:00.000Z",
    "expires_at": "2021-02-01T12:00:00.000Z",
    "expired": false
  }
]