invites_create_channel
invites_create_channel
Section titled “invites_create_channel”Category: invites
Create a new invite for a channel.
When to use
Section titled “When to use”- Issue a fresh invite with custom expiry / use cap.
- Generate a stream-target invite (
target_type=1, target_user_id=…).
When NOT to use
Section titled “When NOT to use”- Reuse an existing invite →
invites_list_channelthen pick one.
| Field | Type | Required | Description |
|---|---|---|---|
channel_id | string | yes | Channel to create the invite for |
max_age | integer | no | Seconds until expiry (0 = never). Default 86400. |
max_uses | integer | no | Max uses (0 = unlimited). Default 0. |
temporary | boolean | no | If true, kicks members who do not get assigned a role. Default false. |
unique | boolean | no | Force a brand-new invite even if one with same parameters exists. |
target_type | integer | no | 1 = STREAM, 2 = EMBEDDED_APPLICATION |
target_user_id | string | no | User whose stream to target (target_type=1) |
target_application_id | string | no | Embedded application to target (target_type=2) |
audit_reason | string | no | Reason recorded in audit log (X-Audit-Log-Reason header) |
Returns
Section titled “Returns”\{code, expires_at, max_age, max_uses, temporary, unique, inviter_id\}.
Output schema
Section titled “Output schema”| Field | Type | Required | Description |
|---|---|---|---|
code | string | yes | Discord invite code (base62, NOT a snowflake) |
expires_at | unknown | no | |
max_age | number | no | |
max_uses | number | no | |
temporary | boolean | no | |
unique | boolean | no | |
inviter_id | string | no | Discord user ID |
Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | no |
| Destructive | no |
| Idempotent | no |
| Open-world | yes |
| Confirmation required | no |