# External Message

Manage external message service.

## List external messages

> Retrieve a collection of external messages.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.3"},"tags":[{"name":"External Message","description":"Manage external message service.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/external_messages":{"get":{"tags":["External Message"],"operationId":"listExternalMessages","summary":"List external messages","description":"Retrieve a collection of external messages.\n","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","format":"int64","minimum":0,"description":"Total number of resource.\n"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of external message.\n"},"config_id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of external message.\n"},"sender":{"type":"string","description":"The sender number of the message.\n"},"sender_name":{"type":"string","description":"The sender name of the message.\n"},"receiver":{"type":"string","description":"The receiver number of the message.\n"},"receiver_name":{"type":"string","description":"The receiver name of the message.\n"},"channel_name":{"type":"string","description":"The channel name of the message.\n"},"channel_number":{"type":"string","description":"The channel number of the message.\n"},"brand":{"type":"string","description":"The brand of the message.\n"},"did":{"type":"string","description":"The did of the message.\n"},"msg_type":{"type":"string","enum":["UNKNOWN","SMS","WHATSAPP"],"description":"The type of message:  \nCan be either:  \n- `UNKNOWN`:   \n- `SMS`:   \n- `WHATSAPP`:\n"},"direction":{"type":"string","enum":["IN","OUT"],"description":"The direction of message:   \n- `IN`:   \n- `OUT`:\n"},"content":{"type":"string","description":"The content of the message.\n"},"reason":{"type":"string","description":"The reason of the message.\n"},"delivery":{"type":"string","enum":["ERR","SENT","RECV","DELIVERED"],"description":"The delivery status of message:  \nCan be either:  \n- `ERR`:\n- `SENT`:\n- `RECV`:\n- `DELIVERED`:   \n"},"provider_msg_id":{"type":"string","description":"The provider message ID of the message.\n"},"created_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"The creation time of the message.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve external message detailed information.

> Retrieve details of external message.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.3"},"tags":[{"name":"External Message","description":"Manage external message service.\n"}],"servers":[{"url":"{protocol}://{hostname}:{port}/api","variables":{"protocol":{"description":"Self-hosted Enterprise Server protocol.","default":"https"},"hostname":{"description":"Self-hosted Enterprise Server hostname.","default":"HOSTNAME"},"port":{"description":"Self-hosted Enterprise Server port.","default":"8887"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/external_messages/{id}":{"get":{"tags":["External Message"],"operationId":"retrieveExternalMessage","summary":"Retrieve external message detailed information.","description":"Retrieve details of external message.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of external message.\n"},"description":"The unique ID of the external message."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of external message.\n"},"config_id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of external message.\n"},"sender":{"type":"string","description":"The sender number of the message.\n"},"sender_name":{"type":"string","description":"The sender name of the message.\n"},"receiver":{"type":"string","description":"The receiver number of the message.\n"},"receiver_name":{"type":"string","description":"The receiver name of the message.\n"},"channel_name":{"type":"string","description":"The channel name of the message.\n"},"channel_number":{"type":"string","description":"The channel number of the message.\n"},"brand":{"type":"string","description":"The brand of the message.\n"},"did":{"type":"string","description":"The did of the message.\n"},"msg_type":{"type":"string","enum":["UNKNOWN","SMS","WHATSAPP"],"description":"The type of message:  \nCan be either:  \n- `UNKNOWN`:   \n- `SMS`:   \n- `WHATSAPP`:\n"},"direction":{"type":"string","enum":["IN","OUT"],"description":"The direction of message:   \n- `IN`:   \n- `OUT`:\n"},"content":{"type":"string","description":"The content of the message.\n"},"reason":{"type":"string","description":"The reason of the message.\n"},"delivery":{"type":"string","enum":["ERR","SENT","RECV","DELIVERED"],"description":"The delivery status of message:  \nCan be either:  \n- `ERR`:\n- `SENT`:\n- `RECV`:\n- `DELIVERED`:   \n"},"provider_msg_id":{"type":"string","description":"The provider message ID of the message.\n"},"created_at":{"allOf":[{"type":"string","format":"date_time","description":"The RFC 3339 format is defined by\nThe date_time notation as defined by [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6), \nfor example, 2017-07-21T17:32:28Z\n"}],"description":"The creation time of the message.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```


---

# Agent Instructions: 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://support.portsip.com/development-portsip/rest-apis/version-22.3/external-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.
