# Create Message **POST /api/v1.0/messages** This endpoint creates a new message. ## Servers - https://openapi.niftypm.com: https://openapi.niftypm.com () ## Parameters ### Body: application/json (object) - **type** (string) Specifies the message type. Supported values include `text`, `gif`, and `document`. - **text** (string) The message content. Required only when the message type is set to `text`. - **url** (string) URL of the GIF. Required only when the message type is set to `gif`. - **doc_attachment** (string) Document attachment identifier. Required only when the message type is set to `document`. - **entity_key** (string) Unique identifier for the document thread. Required only when `doc_id` is provided. - **chat_id** (string) Unique identifier of the chat to which the message belongs. Required when no other reference (`message_id`, `task_id`, `file_id`, or `doc_id`) is provided. - **message_id** (string) Unique identifier of the parent message (used for replies). Required when no `chat_id`, `task_id`, `file_id`, or `doc_id` is provided. - **task_id** (string) Unique identifier of the task associated with this message. Required when no other entity (`chat_id`, `message_id`, `file_id`, or `doc_id`) is specified. - **file_id** (string) Unique identifier of the file associated with this message. Required when no other entity (`chat_id`, `message_id`, `task_id`, or `doc_id`) is specified. - **doc_id** (string) Unique identifier of the document associated with this message. Required when no other entity (`chat_id`, `message_id`, `task_id`, or `file_id`) is specified. - **task** (object) Details of the related task, if applicable. Optional field for embedding task data. - **external_files** (array[string]) List of external file attachments associated with this message. - **nifty_files** (array[string]) List of file identifiers from Nifty linked with this message. - **date** (string(date-time)) Timestamp representing the date and time of message creation. - **bot_name** (string) Name of the bot that created or sent the message, if applicable. - **bot_avatar** (string) Avatar URL of the bot that created or sent the message, if applicable. - **hidden** (array[string]) List of user IDs for whom the message should remain hidden. - **emails** (string) Comma-separated list of email addresses mentioned in the message, if any. - **annotation_id** (string) Identifier of the annotation linked with this message. - **context_text** (string) Contextual text related to the message (for example, quoted or referenced text). - **audio_duration** (string) Duration of the attached audio message, represented as a string (e.g., "00:30"). - **created_by_type** (string) Specifies the type of the user who created the message (e.g., "user", "bot"). - **created_by** (string) Unique identifier of the user who created the message. ## Responses ### 201 The resource created successfully #### Body: application/json (object) - **message** (string) - **data** (object) ### 401 The client request has not been completed because it lacks valid authentication credentials for the requested resource. ### 403 The client does not have access rights to the content. ### 405 The request method is known by the server but is not supported by the target resource. [Powered by Bump.sh](https://bump.sh)