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
| Status | Meaning | Body |
|---|---|---|
| 200 | Invites, newest first. | Invite[] |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing the Manage invites permission. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_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
| Field | Type | Description |
|---|---|---|
code | string | Code is generated (12 characters) when omitted or empty. |
expires_in_hours | integer | null | ExpiresInHours never expires when null or omitted. |
max_uses | integer | null | MaxUses is unlimited when null or omitted. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Created invite. | Invite |
| 400 | Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected. | ErrorResponse |
| 409 | CONFLICT: the resource already exists. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Invite
| Field | Type | Description |
|---|---|---|
channel_id | string | null | ChannelID 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_id | string (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_name | string | |
expires_at (required) | string | null | |
id (required) | string (uuid) | |
max_uses (required) | integer | null | |
uses_count (required) | integer | |
weak (required) | boolean | Weak 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
| Status | Meaning | Body |
|---|---|---|
| 200 | The limits. | MemberInviteLimits |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing the Manage invites permission. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
MemberInviteLimits
| Field | Type | Description |
|---|---|---|
max_active (required) | integer | MaxActive is how many invites of one member may be valid at once. |
max_expires_in_hours (required) | integer | MaxExpiresInHours is the longest an invite of a member may stay valid. |
max_per_hour (required) | integer | MaxPerHour is how many invites one member may create per hour. |
max_uses (required) | integer | MaxUses 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
| Field | Type | Description |
|---|---|---|
max_active (required) | integer | MaxActive is how many invites of one member may be valid at once. |
max_expires_in_hours (required) | integer | MaxExpiresInHours is the longest an invite of a member may stay valid. |
max_per_hour (required) | integer | MaxPerHour is how many invites one member may create per hour. |
max_uses (required) | integer | MaxUses is the most uses one invite of a member may have. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The limits now in force. | MemberInviteLimits |
| 400 | Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields or a value out of range. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
MemberInviteLimits
| Field | Type | Description |
|---|---|---|
max_active (required) | integer | MaxActive is how many invites of one member may be valid at once. |
max_expires_in_hours (required) | integer | MaxExpiresInHours is the longest an invite of a member may stay valid. |
max_per_hour (required) | integer | MaxPerHour is how many invites one member may create per hour. |
max_uses (required) | integer | MaxUses 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | Resource ID. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 204 | Success, no content. | |
| 400 | Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: the resource, or the route, does not exist. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | Resource ID. |
Request body (application/json, required): UpdateInviteRequest
| Field | Type | Description |
|---|---|---|
expires_at | string | null | ExpiresAt is a future time (within 8760 hours); null removes the expiry. |
max_uses | integer | null | MaxUses is at least the uses consumed so far; null (or 0) makes the invite unlimited. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Updated invite. | Invite |
| 400 | Invalid input (INVALID_INPUT): malformed JSON, unknown JSON fields, bad IDs or failed validation. | ErrorResponse |
| 401 | No valid session (UNAUTHORIZED): missing, expired or revoked cookie, or the account was disabled. | ErrorResponse |
| 403 | FORBIDDEN: missing the Manage invites permission, or cross-origin request rejected. | ErrorResponse |
| 404 | NOT_FOUND: the resource, or the route, does not exist. | ErrorResponse |
| 429 | RATE_LIMITED: too many requests. | ErrorResponse |
| 500 | INTERNAL_ERROR: sanitized server failure. | ErrorResponse |
Invite
| Field | Type | Description |
|---|---|---|
channel_id | string | null | ChannelID 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_id | string (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_name | string | |
expires_at (required) | string | null | |
id (required) | string (uuid) | |
max_uses (required) | integer | null | |
uses_count (required) | integer | |
weak (required) | boolean | Weak 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. |