create_channel_invite
POST
/channels/{channel_id}/invites 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 | null;
target_application_id?:SnowflakeType | null;
target_type?: 1 &InviteTargetTypes | 2 & InviteTargetTypes | null;
}
max_age?: number | null;
} | interface CreateGuildInviteRequest {
max_age?: number | null;
temporary?: boolean | null;
max_uses?: number | null;
unique?: boolean | null;
target_user_id?:
target_application_id?:
target_type?: 1 &
}
Responses
200 application/json
200 response for create_channel_invite
interface FriendInviteResponse {
type: 2 &InviteTypes ;
code: string;
inviter?:UserResponse ;
max_age?: number;
created_at?: string;
expires_at?: string | null;
friends_count?: number;
channel?:InviteChannelResponse | null;
is_contact?: boolean;
uses?: number;
max_uses?: number;
flags?: number;
} | interface GroupDMInviteResponse {
type: 1 &InviteTypes ;
code: string;
inviter?:UserResponse ;
max_age?: number;
created_at?: string;
expires_at?: string | null;
channel:InviteChannelResponse ;
approximate_member_count?: number | null;
} | interface GuildInviteResponse {
type: 0 &InviteTypes ;
code: string;
inviter?:UserResponse ;
max_age?: number;
created_at?: string;
expires_at?: string | null;
is_contact?: boolean;
flags?: number;
guild:InviteGuildResponse ;
guild_id:SnowflakeType ;
channel:InviteChannelResponse ;
target_type?:InviteTargetTypes ;
target_user?:UserResponse ;
target_application?:InviteApplicationResponse ;
guild_scheduled_event?:ScheduledEventResponse ;
uses?: number;
max_uses?: number;
temporary?: boolean;
approximate_member_count?: number | null;
approximate_presence_count?: number | null;
is_nickname_changeable?: boolean;
}
type: 2 &
code: string;
inviter?:
max_age?: number;
created_at?: string;
expires_at?: string | null;
friends_count?: number;
channel?:
is_contact?: boolean;
uses?: number;
max_uses?: number;
flags?: number;
} | interface GroupDMInviteResponse {
type: 1 &
code: string;
inviter?:
max_age?: number;
created_at?: string;
expires_at?: string | null;
channel:
approximate_member_count?: number | null;
} | interface GuildInviteResponse {
type: 0 &
code: string;
inviter?:
max_age?: number;
created_at?: string;
expires_at?: string | null;
is_contact?: boolean;
flags?: number;
guild:
guild_id:
channel:
target_type?:
target_user?:
target_application?:
guild_scheduled_event?:
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