# Send text message The API to send a text message. Endpoint: POST /v1/messaging/{serviceId}/message Version: 1.0.0 Security: bearerAuth ## Path parameters: - `serviceId` (string, required) The Id of service that will be used to send the message ## Request fields (application/json): - `from` (string, required) The number or text that will appear to the recipient as the sender of the message. Example: "Unimsgs" - `to` (string, required) The receipient's destination address. It is usually the recipient's phone number or channel address. This parameter supports the channels format to descibe a destination address for each channel. Example: "9665xxxxxxxx" - `type` (string) The type of the message. If the type is not specified, it will default to 'text'. Enum: "text" - `text` (string) The text of the message. The text can be in any language. Example: "This is a text message" - `template` (object) The options to overide the message content and use the content from a predefined template. - `template.key` (string) A string that represents the template's key. Example: "string" - `template.language` (string) A two letter language code that is supported by the template, for example 'en' for English or 'ar' for Arabic. If not specified, the default template's content will be used. Example: "en" - `template.variables` (object) ِA key-value collection that represents the values of variables within the template. - `referenceId` (string) A custom identifier provided by the client. The referenceId will be associated with the same message and allows clients to track and link specific messages across multiple interactions. Example: "string" - `tag` (string) A custom string that can be used to control the flow and the actions performed on the message. Example: "string" ## Response 200 fields (application/json): - `jobId` (string, required) The ID that uniquely identifies the message job. Example: "string" - `attempts` (integer, required) The total number of attempts made to send the message. - `gateway` (string, required) A key that identifies the gateway used for the final attempt. Example: "string" - `gatewayId` (string, required) The Id of the gateway used for the final attempt. Example: "string" - `to` (string, required) The final destination address the message was sent to. Example: "string" - `channel` (string, required) The final channel used to send the message. Example: "string" ## Response 400 fields (application/json): - `errorCode` (string, required) An error code that identifies the error. Example: "string" - `errorDesc` (string, required) A detailed description of the error. Example: "string" ## Response 401 fields (application/json): - `errorCode` (string, required) An error code that identifies the error. Example: "string" - `errorDesc` (string, required) A detailed description of the error. Example: "string" ## Response 403 fields (application/json): - `errorCode` (string, required) An error code that identifies the error. Example: "string" - `errorDesc` (string, required) A detailed description of the error. Example: "string"