Method: spaces.messages.create

Creates a message in a Google Chat space. The maximum message size, including text and cards, is 32,000 bytes. For an example, see Send a message.

Calling this method requires authentication and supports the following authentication types:

  • For text messages, user authentication or app authentication are supported.
  • For card messages, only app authentication is supported. (Only Chat apps can create card messages.)

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Required. The resource name of the space in which to create a message.

Format: spaces/{space}

Query parameters



Optional. Deprecated: Use thread.thread_key instead. ID for the thread. Supports up to 4000 characters. To start or add to a thread, create a message and specify a threadKey or the For example usage, see Start or reply to a message thread.



Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message.


enum (MessageReplyOption)

Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces.



Optional. A custom ID for a message. Lets Chat apps get, update, or delete a message without needing to store the system-assigned ID in the message's resource name (represented in the message name field).

The value for this field must meet the following requirements:

  • Begins with client-. For example, client-custom-name is a valid custom ID, but custom-name is not.
  • Contains up to 63 characters and only lowercase letters, numbers, and hyphens.
  • Is unique within a space. A Chat app can't use the same custom ID for different messages.

For details, see Name a message.

Request body

The request body contains an instance of Message.

Response body

If successful, the response body contains a newly created instance of Message.

Authorization scopes

Requires one of the following OAuth scopes:


For more information, see the Authorization guide.


Specifies how to reply to a message. More states might be added in the future.

MESSAGE_REPLY_OPTION_UNSPECIFIED Default. Starts a new thread. Using this option ignores any thread ID or threadKey that's included.
REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD Creates the message as a reply to the thread specified by thread ID or threadKey. If it fails, the message starts a new thread instead.
REPLY_MESSAGE_OR_FAIL Creates the message as a reply to the thread specified by thread ID or threadKey. If a new threadKey is used, a new thread is created. If the message creation fails, a NOT_FOUND error is returned instead.