Search + K

Command Palette

Search for a command to run...

Sign In

create_channel_invite

POST /channels/{channel_id}/invites
Copy endpoint
https://discord.com/api/v10

Parameters

path Path Parameters

Name Type
channel_id required
type SnowflakeType = string

Request Body

application/json required
interface CreateGroupDMInviteRequest {
max_age?: number | null;
}
| interface CreateGuildInviteRequest {
max_age?: number | null;
temporary?: boolean | null;
max_uses?: number | null;
unique?: boolean | null;
target_user_id?: SnowflakeType
type SnowflakeType = string
| null
;
target_application_id?: SnowflakeType
type SnowflakeType = string
| null
;
target_type?: 1 & InviteTargetTypes
type InviteTargetTypes = 1 | 2 | 3
| 2 & InviteTargetTypes
type InviteTargetTypes = 1 | 2 | 3
| null
;
}

Responses

200 application/json

200 response for create_channel_invite

interface FriendInviteResponse {
type: 2 & InviteTypes
type InviteTypes = 0 | 1 | 2
;
code: string;
inviter?: UserResponse
interface UserResponse {
id: SnowflakeType;
username: string;
avatar?: string | null;
discriminator: string;
public_flags: number;
flags: Int53Type;
bot?: boolean;
system?: boolean;
banner?: string | null;
accent_color?: number | null;
global_name?: string | null;
avatar_decoration_data?: UserAvatarDecorationResponse | null;
collectibles?: UserCollectiblesResponse | null;
primary_guild?: UserPrimaryGuildResponse | null;
}
;
max_age?: number;
created_at?: string;
expires_at?: string | null;
friends_count?: number;
channel?: InviteChannelResponse
interface InviteChannelResponse {
id: SnowflakeType;
type: ChannelTypes;
name?: string | null;
icon?: string;
recipients?: InviteChannelRecipientResponse[];
}
| null
;
is_contact?: boolean;
uses?: number;
max_uses?: number;
flags?: number;
}
| interface GroupDMInviteResponse {
type: 1 & InviteTypes
type InviteTypes = 0 | 1 | 2
;
code: string;
inviter?: UserResponse
interface UserResponse {
id: SnowflakeType;
username: string;
avatar?: string | null;
discriminator: string;
public_flags: number;
flags: Int53Type;
bot?: boolean;
system?: boolean;
banner?: string | null;
accent_color?: number | null;
global_name?: string | null;
avatar_decoration_data?: UserAvatarDecorationResponse | null;
collectibles?: UserCollectiblesResponse | null;
primary_guild?: UserPrimaryGuildResponse | null;
}
;
max_age?: number;
created_at?: string;
expires_at?: string | null;
channel: InviteChannelResponse
interface InviteChannelResponse {
id: SnowflakeType;
type: ChannelTypes;
name?: string | null;
icon?: string;
recipients?: InviteChannelRecipientResponse[];
}
;
approximate_member_count?: number | null;
}
| interface GuildInviteResponse {
type: 0 & InviteTypes
type InviteTypes = 0 | 1 | 2
;
code: string;
inviter?: UserResponse
interface UserResponse {
id: SnowflakeType;
username: string;
avatar?: string | null;
discriminator: string;
public_flags: number;
flags: Int53Type;
bot?: boolean;
system?: boolean;
banner?: string | null;
accent_color?: number | null;
global_name?: string | null;
avatar_decoration_data?: UserAvatarDecorationResponse | null;
collectibles?: UserCollectiblesResponse | null;
primary_guild?: UserPrimaryGuildResponse | null;
}
;
max_age?: number;
created_at?: string;
expires_at?: string | null;
is_contact?: boolean;
flags?: number;
guild: InviteGuildResponse
interface InviteGuildResponse {
id: SnowflakeType;
name: string;
splash?: string | null;
banner?: string | null;
description?: string | null;
icon?: string | null;
features: GuildFeatures[];
verification_level?: VerificationLevels | null;
vanity_url_code?: string | null;
nsfw_level?: GuildNSFWContentLevel | null;
nsfw?: boolean | null;
premium_subscription_count: number;
}
;
guild_id: SnowflakeType
type SnowflakeType = string
;
channel: InviteChannelResponse
interface InviteChannelResponse {
id: SnowflakeType;
type: ChannelTypes;
name?: string | null;
icon?: string;
recipients?: InviteChannelRecipientResponse[];
}
;
target_type?: InviteTargetTypes
type InviteTargetTypes = 1 | 2 | 3
;
target_user?: UserResponse
interface UserResponse {
id: SnowflakeType;
username: string;
avatar?: string | null;
discriminator: string;
public_flags: number;
flags: Int53Type;
bot?: boolean;
system?: boolean;
banner?: string | null;
accent_color?: number | null;
global_name?: string | null;
avatar_decoration_data?: UserAvatarDecorationResponse | null;
collectibles?: UserCollectiblesResponse | null;
primary_guild?: UserPrimaryGuildResponse | null;
}
;
target_application?: InviteApplicationResponse
interface InviteApplicationResponse {
id: SnowflakeType;
name: string;
icon?: string | null;
description: string;
type?: ApplicationTypes | null;
cover_image?: string;
primary_sku_id?: SnowflakeType;
bot?: UserResponse;
slug?: string;
guild_id?: SnowflakeType;
rpc_origins?: (string | null)[];
bot_public?: boolean;
bot_require_code_grant?: boolean;
terms_of_service_url?: string;
privacy_policy_url?: string;
custom_install_url?: string;
install_params?: ApplicationOAuth2InstallParamsResponse;
integration_types_config?: { };
verify_key: string;
flags: number;
max_participants?: number | null;
tags?: string[];
}
;
guild_scheduled_event?: ScheduledEventResponse
interface ScheduledEventResponse {
id: SnowflakeType;
guild_id: SnowflakeType;
name: string;
description?: string | null;
channel_id?: SnowflakeType | null;
creator_id?: SnowflakeType | null;
creator?: UserResponse;
image?: string | null;
scheduled_start_time: string;
scheduled_end_time?: string | null;
status: GuildScheduledEventStatuses;
entity_type: GuildScheduledEventEntityTypes;
entity_id?: SnowflakeType | null;
user_count?: number;
privacy_level: GuildScheduledEventPrivacyLevels;
user_rsvp?: ScheduledEventUserResponse | null;
}
;
uses?: number;
max_uses?: number;
temporary?: boolean;
approximate_member_count?: number | null;
approximate_presence_count?: number | null;
is_nickname_changeable?: boolean;
}
204

204 response for create_channel_invite

unknown

Client Errors

429 application/json

Client ratelimited response

type RatelimitedResponse = never
4XX application/json

Client error response

type ErrorResponse = never