> For the complete documentation index, see [llms.txt](https://support.portsip.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.portsip.com/development-portsip/rest-apis/version-22.9/sms-mms.md).

# SMS/MMS

## List SMS/MMS services.

> Retrieve a collection of SMS/MMS services.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[],"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":{"/sms":{"get":{"tags":["SMS/MMS"],"operationId":"listSms","summary":"List SMS/MMS services.","description":"Retrieve a collection of SMS/MMS services.\n","parameters":[{"name":"filter","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `filter` query parameter to retrieve just a subset of a collection.\n"},{"name":"search","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `search` query parameter to restrict the results of a request to match a search criterion.\n"},{"name":"orderby","in":"query","required":false,"schema":{"type":"string"},"description":"Use the `orderby` query parameter to specify the sort order of the items returned from server.  \nThe default order is ascending order.\n"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":0,"default":0},"description":"Use the `skip` query parameter to set the number of items to skip at the start of a collection.\n"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","format":"int32","minimum":1,"maximum":100,"default":100},"description":"Use the `top` query parameter to specify the page size of the result set.\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 SMS/MMS service.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of SMS/MMS service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the SMS/MMS service is enabled.\n"},"sender_id":{"type":"string","description":"The sender ID of SMS/MMS service.\n"},"provider_id":{"allOf":[{"type":"string"}],"description":"The unique ID of trunk.\n"},"prepend_add":{"type":"string","description":"Prepend “+” to outbound SMS recipient numbers.\n"},"provider_name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of the trunk.\n"},"provider_brand":{"type":"string","minLength":1,"maxLength":64,"description":"The brand of trunk.\n"},"provider_hostname":{"allOf":[{"type":"string","description":"Server hostname or IP address\n"}],"description":"The hostname of trunk.\n"},"webhook":{"type":"string","minLength":1,"description":"The `Universal Resource Locator` of some resource.\n"},"channel_type":{"type":"string","enum":["SMS","MMS"],"default":"SMS","description":"The channel type of SMS Trunk.  \nCan be either:  \n- `SMS` Only text messages are allowed.\n- `MMS`: Multimedia messages are allowed.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create SMS/MMS service

> Create SMS/MMS service.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[],"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":{"/sms":{"post":{"tags":["SMS/MMS"],"operationId":"createSms","summary":"Create SMS/MMS service","description":"Create SMS/MMS service.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of SMS/MMS service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the SMS/MMS service is enabled.\n"},"provider_id":{"allOf":[{"type":"string"}],"description":"The unique ID of trunk.\n"},"sender_id":{"type":"string","description":"The sender ID of SMS/MMS service.\n"},"prepend_add":{"type":"string","description":"Prepend “+” to outbound SMS recipient numbers.\n"},"credentials":{"type":"string","description":"The credentials of SMS/MMS service.\n"},"channel_type":{"type":"string","enum":["SMS","MMS"],"default":"SMS","description":"The channel type of SMS Trunk.  \nCan be either:  \n- `SMS` Only text messages are allowed.\n- `MMS`: Multimedia messages are allowed.\n"}},"required":["name","provider_id","credentials"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of SMS/MMS service.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve a SMS/MMS service

> Retrieve a SMS/MMS service.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[],"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":{"/sms/{id}":{"get":{"tags":["SMS/MMS"],"operationId":"getSms","summary":"Retrieve a SMS/MMS service","description":"Retrieve a SMS/MMS service.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of SMS/MMS service.\n"},"description":"The unique ID of the SMS/MMS service."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of SMS/MMS service.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of SMS/MMS service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the SMS/MMS service is enabled.\n"},"sender_id":{"type":"string","description":"The sender ID of SMS/MMS service.\n"},"provider_id":{"allOf":[{"type":"string"}],"description":"The unique ID of trunk.\n"},"prepend_add":{"type":"string","description":"Prepend “+” to outbound SMS recipient numbers.\n"},"provider_name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of the trunk.\n"},"provider_brand":{"type":"string","minLength":1,"maxLength":64,"description":"The brand of trunk.\n"},"provider_hostname":{"allOf":[{"type":"string","description":"Server hostname or IP address\n"}],"description":"The hostname of trunk.\n"},"webhook":{"type":"string","minLength":1,"description":"The `Universal Resource Locator` of some resource.\n"},"channel_type":{"type":"string","enum":["SMS","MMS"],"default":"SMS","description":"The channel type of SMS Trunk.  \nCan be either:  \n- `SMS` Only text messages are allowed.\n- `MMS`: Multimedia messages are allowed.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update the SMS/MMS service

> Update the SMS/MMS service.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[],"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":{"/sms/{id}":{"post":{"tags":["SMS/MMS"],"operationId":"updateSms","summary":"Update the SMS/MMS service","description":"Update the SMS/MMS service.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of SMS/MMS service.\n"},"description":"The unique ID of the SMS/MMS service."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of SMS/MMS service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the SMS/MMS service is enabled.\n"},"sender_id":{"type":"string","description":"The sender ID of SMS/MMS service.\n"},"prepend_add":{"type":"string","description":"Prepend “+” to outbound SMS recipient numbers.\n"},"credentials":{"type":"string","description":"The credentials of SMS/MMS service.\n"},"channel_type":{"type":"string","enum":["SMS","MMS"],"default":"SMS","description":"The channel type of SMS Trunk.  \nCan be either:  \n- `SMS` Only text messages are allowed.\n- `MMS`: Multimedia messages are allowed.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete SMS/MMS service

> Destroy a SMS/MMS service<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.8"},"tags":[],"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":{"/sms/{id}/destroy":{"post":{"tags":["SMS/MMS"],"operationId":"deleteSms","summary":"Delete SMS/MMS service","description":"Destroy a SMS/MMS service\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of SMS/MMS service.\n"},"description":"The unique ID of the SMS/MMS service."}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error"}}}}}}
```
