REST: Admin, invites

Management endpoints. Each operation names the permission it needs: Owner only, a permission such as Manage members, Ban members or Manage channels, or the Administrator permission. Generated from mnema-talk v3.3.13 (cca4f0fdb723).

List invites

GET /api/admin/invites

Requires the Manage invites permission (403 otherwise).

Authentication: Session cookie

Responses

StatusMeaningBody
200Invites, newest first.Invite[]
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing the Manage invites permission.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse

Create an invite

POST /api/admin/invites

Requires the Manage invites permission (403 otherwise).

Authentication: Session cookie

Request body (application/json, required): CreateInviteRequest

FieldTypeDescription
codestringCode is generated (12 characters) when omitted or empty.
expires_in_hoursinteger | nullExpiresInHours never expires when null or omitted.
max_usesinteger | nullMaxUses is unlimited when null or omitted.

Responses

StatusMeaningBody
201Created invite.Invite
400Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected.ErrorResponse
409CONFLICT: the resource already exists.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Invite
FieldTypeDescription
channel_idstring | nullChannelID is the channel the invite lands the joiner in; null: the default channel. Only invites created from a channel's menu have one.
code (required)string
created_at (required)string (date-time)
created_by_idstring (uuid)CreatedByID and CreatedByName say who created the invite (a server before member invites sends neither, so a client treats them as optional).
created_by_namestring
expires_at (required)string | null
id (required)string (uuid)
max_uses (required)integer | null
uses_count (required)integer
weak (required)booleanWeak is true for a custom code that is easy to guess (too short, a common word). New codes like that are refused and old ones no longer work for sign-up; regenerate them.

Read the limits of member invites

GET /api/admin/invites/limits

Requires the Manage invites permission (403 otherwise).

Authentication: Session cookie

Responses

StatusMeaningBody
200The limits.MemberInviteLimits
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing the Manage invites permission.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
MemberInviteLimits
FieldTypeDescription
max_active (required)integerMaxActive is how many invites of one member may be valid at once.
max_expires_in_hours (required)integerMaxExpiresInHours is the longest an invite of a member may stay valid.
max_per_hour (required)integerMaxPerHour is how many invites one member may create per hour.
max_uses (required)integerMaxUses is the most uses one invite of a member may have.

Set the limits of member invites

PUT /api/admin/invites/limits

Requires the Manage invites permission (403 otherwise). Replaces all four limits. They apply to invites created from now on; invites that exist keep what they have.

Authentication: Session cookie

Request body (application/json, required): MemberInviteLimits

FieldTypeDescription
max_active (required)integerMaxActive is how many invites of one member may be valid at once.
max_expires_in_hours (required)integerMaxExpiresInHours is the longest an invite of a member may stay valid.
max_per_hour (required)integerMaxPerHour is how many invites one member may create per hour.
max_uses (required)integerMaxUses is the most uses one invite of a member may have.

Responses

StatusMeaningBody
200The limits now in force.MemberInviteLimits
400Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields or a value out of range.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
MemberInviteLimits
FieldTypeDescription
max_active (required)integerMaxActive is how many invites of one member may be valid at once.
max_expires_in_hours (required)integerMaxExpiresInHours is the longest an invite of a member may stay valid.
max_per_hour (required)integerMaxPerHour is how many invites one member may create per hour.
max_uses (required)integerMaxUses is the most uses one invite of a member may have.

Delete an invite

DELETE /api/admin/invites/{id}

Requires the Manage invites permission (403 otherwise).

Authentication: Session cookie

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesResource ID.

Responses

StatusMeaningBody
204Success, no content.
400Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: the resource, or the route, does not exist.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse

Change an invite's expiry or use limit

PATCH /api/admin/invites/{id}

Requires the Manage invites permission (403 otherwise). Absent fields are kept; null removes the expiry or the limit. A max_uses below the uses already consumed is refused (400).

Authentication: Session cookie

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)yesResource ID.

Request body (application/json, required): UpdateInviteRequest

FieldTypeDescription
expires_atstring | nullExpiresAt is a future time (within 8760 hours); null removes the expiry.
max_usesinteger | nullMaxUses is at least the uses consumed so far; null (or 0) makes the invite unlimited.

Responses

StatusMeaningBody
200Updated invite.Invite
400Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation.ErrorResponse
401No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled.ErrorResponse
403FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected.ErrorResponse
404NOT_FOUND: the resource, or the route, does not exist.ErrorResponse
429RATE_LIMITED: too many requests.ErrorResponse
500INTERNAL_ERROR: sanitized server failure.ErrorResponse
Invite
FieldTypeDescription
channel_idstring | nullChannelID is the channel the invite lands the joiner in; null: the default channel. Only invites created from a channel's menu have one.
code (required)string
created_at (required)string (date-time)
created_by_idstring (uuid)CreatedByID and CreatedByName say who created the invite (a server before member invites sends neither, so a client treats them as optional).
created_by_namestring
expires_at (required)string | null
id (required)string (uuid)
max_uses (required)integer | null
uses_count (required)integer
weak (required)booleanWeak is true for a custom code that is easy to guess (too short, a common word). New codes like that are refused and old ones no longer work for sign-up; regenerate them.

Something wrong on this page? Tell us.