Invites

Create an invite

Changed on
post/invites.json

Request

  • Base URL
    https://discourse.example.com
  • Auth
    none declared. Required headers: Api-Key, Api-Username

Headers

Api-Keystring required
Api-Usernamestring required

Request body

emailstring

required for email invites only

skip_emailboolean
custom_messagestring

optional, for email invites

max_redemptions_allowedinteger

optional, for link invites

topic_idinteger
group_idsstring

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

group_namesstring

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

expires_atstring

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

Example request

{
  "email": "not-a-user-yet@example.com",
  "max_redemptions_allowed": 5,
  "group_ids": "42,43",
  "group_names": "foo,bar"
}

Response

success response

idinteger required
invite_keystring required
linkstring required
descriptionstring nullable required
emailstring required
domainstring nullable required
emailedboolean required
can_delete_inviteboolean required
custom_messagestring nullable required
created_atstring required
updated_atstring required
expires_atstring required
expiredboolean required
grants_adminboolean required
grants_moderatorboolean required
topicsobject[] required
groupsobject[] required

Example response

{
  "id": 42,
  "link": "http://example.com/invites/9045fd767efe201ca60c6658bcf14158",
  "email": "not-a-user-yet@example.com",
  "custom_message": "Hello world!",
  "created_at": "2021-01-01T12:00:00.000Z",
  "updated_at": "2021-01-01T12:00:00.000Z",
  "expires_at": "2021-02-01T12:00:00.000Z",
  "topics": [],
  "groups": []
}

Changes

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • breaking

      the / response's property type changed from no type to object for status

    • breaking

      the / response's property type changed from no type to object for status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status