telegram api method · layer 229 · #92ceddd4

messages.createChat

usable by users

Creates a new chat.

definition

messages.createChat#92ceddd4 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = messages.InvitedUsers;

parameters

nametypedescription
flags#Flags, see TL conditional fields
usersVector<InputUser>List of user IDs to be invited
titlestringChat name
ttl_periodflags.0?intTime-to-live of all messages that will be sent in the chat: once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. You can use messages.setDefaultHistoryTTL to edit this value later.

returns

messages.InvitedUsers

errors (11)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400CHAT_INVALIDInvalid chat.
400CHAT_MEMBER_ADD_FAILEDCould not add participants.
400CHAT_TITLE_EMPTYNo chat title provided.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400TTL_PERIOD_INVALIDThe specified TTL period is invalid.
400USERS_TOO_FEWNot enough users (to create a chat, for example).
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403USER_RESTRICTEDYou're spamreported, you can't create channels or chats.
406USER_RESTRICTEDYou're spamreported, you can't create channels or chats.
500CHAT_ID_GENERATE_FAILEDFailure while generating the chat ID.

history

present in layers 2–229 · constructor id changed 3×

idlayers
#419d9aee2–23
#09cb126e46–149
#0034a818150–176
#92ceddd4177–229