> For the complete documentation index, see [llms.txt](https://api-docs.islash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.islash.io/session-message/send-session-message.md).

# Send Session Message

Sample Response

## Send a message in a session

> Sends a message to a specified contact number within a session. You can send a file along with text, but ensure that the message contains at least one of the following: text, file, file URL, or sticker.

```json
{"openapi":"3.0.0","info":{"title":"iSlash API","version":"1.0.1"},"servers":[{"url":"https://{ISLASH_API_ENDPOINT}/api/public","variables":{"ISLASH_API_ENDPOINT":{"default":"{ISLASH_API_ENDPOINT}","description":"The base hostname for the iSlash API platform."}}}],"paths":{"/send-session-message":{"post":{"summary":"Send a message in a session","description":"Sends a message to a specified contact number within a session. You can send a file along with text, but ensure that the message contains at least one of the following: text, file, file URL, or sticker.","parameters":[{"in":"header","name":"X-USER-TOKEN","schema":{"type":"string"},"required":true,"description":"The secret key provided by iSlash for accessing the iSlash API platform."}],"requestBody":{"description":"Message data to send. At least one of text, file, file_url, or sticker_id must be provided.","required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["session","identity"],"properties":{"session":{"type":"string","description":"The session key generated by your admin to control which channel can send messages via the API."},"identity":{"type":"string","description":"The target contact number (e.g., 85256872847)."},"text":{"type":"string","description":"The text message to send. At least one of text, file, file_url, or sticker_id must be provided."},"file":{"type":"string","format":"binary","description":"The file to upload as part of the message. At least one of text, file, file_url, or sticker_id must be provided."},"file_url":{"type":"string","description":"The URL of a file to send. At least one of text, file, file_url, or sticker_id must be provided."},"sticker_id":{"type":"string","description":"The ID of a sticker to send. At least one of text, file, file_url, or sticker_id must be provided."},"quoted_message_id":{"type":"integer","description":"The ID of the message to quote/reply to."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["meta","data"],"properties":{"meta":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"The response status code."},"message":{"type":"string","description":"A message describing the response status."}}},"data":{"type":"object","required":["message"],"properties":{"message":{"type":"object","required":["id","conversation_id","status","body","direction","is_auto_message","is_forwarded","is_template_message","is_sticker","is_cloned"],"properties":{"id":{"type":"integer","description":"The label ID in the iSlash system."},"conversation_id":{"type":"integer","description":"The conversation ID in iSlash."},"status":{"type":"string","enum":["pending","sent","delivered","received","read","revoked"],"description":"The status of the message."},"body":{"type":"string","description":"The body of the message."},"color":{"type":"string","description":"The color of the label.","nullable":true},"media_type":{"type":"string","description":"The media type of the file, if a file or sticker is sent.","nullable":true},"media_url":{"type":"string","description":"The URL of the media, if a file or sticker is sent.","nullable":true},"sid":{"type":"string","description":"The message ID from WhatsApp.","nullable":true},"direction":{"type":"string","description":"The direction of the message, always 'outbound' when sending."},"is_auto_message":{"type":"boolean","description":"Indicates if the message is automated. Always true."},"is_forwarded":{"type":"boolean","description":"Indicates if the message is forwarded. Always false."},"is_template_message":{"type":"boolean","description":"Indicates if the message is a template. Always false."},"is_sticker":{"type":"boolean","description":"Indicates if a sticker was sent."},"is_cloned":{"type":"boolean","description":"Indicates if the message is cloned. Always false."},"quote_message":{"type":"string","description":"The quoted message, always null.","nullable":true},"media_thumbnail":{"type":"string","description":"The thumbnail path for the media, if a file or sticker is sent.","nullable":true},"media_filename":{"type":"string","description":"The file name of the media, if a file or sticker is sent.","nullable":true},"media_status":{"type":"string","description":"The status of the media, if a file or sticker is sent.","nullable":true},"media_resolution_x":{"type":"integer","description":"The image width in pixels, if an image is sent.","nullable":true},"media_resolution_y":{"type":"integer","description":"The image height in pixels, if an image is sent.","nullable":true},"sent_at":{"type":"integer","description":"The timestamp when the message was sent."},"delivered_at":{"type":"string","description":"The timestamp when the message was delivered, always null.","nullable":true},"received_at":{"type":"string","description":"The timestamp when the message was received, always null.","nullable":true},"read_at":{"type":"string","description":"The timestamp when the message was read, always null.","nullable":true},"read_by":{"type":"string","description":"The user who read the message, always null.","nullable":true},"read_by_user":{"type":"string","description":"The user who read the message, always null.","nullable":true},"revoked_at":{"type":"string","description":"The timestamp when the message was revoked, always null.","nullable":true}}}}}}}}}}}}}}}
```

{% tabs %}
{% tab title="Sending Text" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "message": {
            "id": 9126,
            "conversation_id": 246,
            "user": null,
            "user_id": null,
            "contact": null,
            "status": "sent",
            "body": "Hello Testing",
            "media_type": null,
            "media_url": null,
            "sid": "gBGGhSlIRoQvAgn-vsCRNiIMutE",
            "direction": "outbound",
            "is_auto_message": true,
            "is_forwarded": false,
            "is_template_message": false,
            "is_sticker": false,
            "is_cloned": false,
            "quoted_message": null,
            "media_thumbnail": null,
            "media_filename": null,
            "media_status": null,
            "media_resolution_x": null,
            "media_resolution_y": null,
            "message_at": 1649755452,
            "sent_at": 1649755452,
            "delivered_at": null,
            "received_at": null,
            "read_at": null,
            "read_by": null,
            "read_by_user": null,
            "revoked_at": null
        }
    }
}
```

{% endtab %}

{% tab title="Sending image" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "message": {
            "id": 9127,
            "conversation_id": 246,
            "user": null,
            "user_id": null,
            "contact": null,
            "status": "sent",
            "body": null,
            "media_type": "image/jpeg",
            "media_url": "https://cms.islash.io/media/9127/1649755682845881.jpeg",
            "sid": "gBGGhSlIRoQvAgkCsO17FgACU_E",
            "direction": "outbound",
            "is_auto_message": true,
            "is_forwarded": false,
            "is_template_message": false,
            "is_sticker": false,
            "is_cloned": false,
            "quoted_message": null,
            "media_thumbnail": "https://cms.islash.io/media/9127/thumb/1649755682845881-thumb.jpg",
            "media_filename": "testing.jpg",
            "media_status": "ready",
            "media_resolution_x": 681,
            "media_resolution_y": 425,
            "message_at": 1649755682,
            "sent_at": 1649755682,
            "delivered_at": null,
            "received_at": null,
            "read_at": null,
            "read_by": null,
            "read_by_user": null,
            "revoked_at": null
        }
    }
}

```

{% endtab %}

{% tab title="Sending sticker" %}

```json
{
    "meta": {
        "code": "RESP_OKAY",
        "message": "Success"
    },
    "data": {
        "message": {
            "id": 9128,
            "conversation_id": 246,
            "user": null,
            "user_id": null,
            "contact": null,
            "status": "sent",
            "body": null,
            "media_type": "image/webp",
            "media_url": " https://cms.islash.io/media/9128/1649755748614211.webp",
            "sid": "gBGGhSlIRoQvAgkuFc1lWcIjD8Y",
            "direction": "outbound",
            "is_auto_message": true,
            "is_forwarded": false,
            "is_template_message": false,
            "is_sticker": true,
            "is_cloned": false,
            "quoted_message": null,
            "media_thumbnail": " https://cms.islash.io /media/9128/thumb/1649755748614211.webp",
            "media_filename": "sticker7.webp",
            "media_status": "ready",
            "media_resolution_x": 0,
            "media_resolution_y": 0,
            "message_at": 1649755748,
            "sent_at": 1649755748,
            "delivered_at": null,
            "received_at": null,
            "read_at": null,
            "read_by": null,
            "read_by_user": null,
            "revoked_at": null
        }
    }
}

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.islash.io/session-message/send-session-message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
