> 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/whats-app.md).

# Whats App

## List WhatsApp services.

> Retrieve a collection of WhatsApp 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":{"/whatsapp":{"get":{"tags":["WhatsApp"],"operationId":"listWhatsApp","summary":"List WhatsApp services.","description":"Retrieve a collection of WhatsApp 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 WhatsApp service.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of WhatsApp service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the WhatsApp service is enabled.\n"},"phone_number":{"type":"string","description":"The phone number of WhatsApp service.\n"},"phone_number_id":{"type":"string","description":"The phone number id of WhatsApp service.\n"},"provider_id":{"allOf":[{"type":"string"}],"description":"The unique ID of trunk.\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"},"business_account_id":{"type":"string","description":"The business account id of WhatsApp service.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Create WhatsApp service

> Create WhatsApp 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":{"/whatsapp":{"post":{"tags":["WhatsApp"],"operationId":"createWhatsApp","summary":"Create WhatsApp service","description":"Create WhatsApp service.\n","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of WhatsApp service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the WhatsApp service is enabled.\n"},"provider_id":{"allOf":[{"type":"string"}],"description":"The unique ID of trunk.\n"},"phone_number":{"type":"string","description":"The phone number of WhatsApp service.\n"},"phone_number_id":{"type":"string","description":"The phone number id of WhatsApp service.\n"},"token":{"type":"string","description":"The token of WhatsApp service.\n"},"business_account_id":{"type":"string","description":"The business account id of WhatsApp service.\n"}},"required":["name","provider_id","phone_number_id","token"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of WhatsApp service.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve a WhatsApp service

> Retrieve a WhatsApp 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":{"/whatsapp/{id}":{"get":{"tags":["WhatsApp"],"operationId":"getWhatsApp","summary":"Retrieve a WhatsApp service","description":"Retrieve a WhatsApp service.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of WhatsApp service.\n"},"description":"The unique ID of the WhatsApp service."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string"}],"description":"The unique ID of WhatsApp service.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of WhatsApp service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the WhatsApp service is enabled.\n"},"phone_number":{"type":"string","description":"The phone number of WhatsApp service.\n"},"phone_number_id":{"type":"string","description":"The phone number id of WhatsApp service.\n"},"provider_id":{"allOf":[{"type":"string"}],"description":"The unique ID of trunk.\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"},"business_account_id":{"type":"string","description":"The business account id of WhatsApp service.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update the WhatsApp service

> Update the WhatsApp 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":{"/whatsapp/{id}":{"post":{"tags":["WhatsApp"],"operationId":"updateWhatsApp","summary":"Update the WhatsApp service","description":"Update the WhatsApp service.\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of WhatsApp service.\n"},"description":"The unique ID of the WhatsApp service."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of WhatsApp service.\n"},"enabled":{"type":"boolean","default":true,"description":"The flag for whether the WhatsApp service is enabled.\n"},"phone_number":{"type":"string","description":"The phone number of WhatsApp service.\n"},"phone_number_id":{"type":"string","description":"The phone number id of WhatsApp service.\n"},"token":{"type":"string","description":"The token of WhatsApp service.\n"},"business_account_id":{"type":"string","description":"The business account id of WhatsApp service.\n"}}}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete WhatsApp service

> Destroy a WhatsApp 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":{"/whatsapp/{id}/destroy":{"post":{"tags":["WhatsApp"],"operationId":"deleteWhatsApp","summary":"Delete WhatsApp service","description":"Destroy a WhatsApp service\n","parameters":[{"name":"id","in":"path","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of WhatsApp service.\n"},"description":"The unique ID of the WhatsApp service."}],"responses":{"204":{"description":"No Content"},"400":{"description":"Error"}}}}}}
```

## List WhatsApp templates services.

> List WhatsApp templates 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":{"/whatsapp/{id}/templates":{"get":{"tags":["WhatsApp"],"operationId":"listWhatsAppTemplates","summary":"List WhatsApp templates services.","description":"List WhatsApp templates services.\n","parameters":[{"name":"id","in":"path","description":"The WhatsApp ID.","required":true,"schema":{"type":"string"}},{"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":{"type":"string","description":"Unique identifier of the WhatsApp template.  \nThis ID is provided by the WhatsApp integration and is used to associate\nresources with a specific WhatsApp account.\n"},"name":{"type":"string","description":"The name of WhatsApp template.\n"},"language":{"type":"string","description":"The language of WhatsApp template.\n"},"category":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY"],"description":"The category of WhatsApp template.\n"},"parameter_format":{"type":"string","enum":["NAMED","POSITIONAL"],"description":"The parameter format of WhatsApp template.\n"},"components":{"type":"string","description":"The components of WhatsApp template.\n"},"status":{"type":"string","enum":["APPROVED","PENDING","REJECTED"],"description":"The status of WhatsApp template.\n"},"created_at":{"type":"string","format":"date-time","description":"The creation time of WhatsApp template.\n"},"updated_at":{"type":"string","format":"date-time","description":"The last update time of WhatsApp template.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## WhatsApp templates Info services.

> WhatsApp templates Info 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":{"/whatsapp/{id}/templates/{template_id}":{"get":{"tags":["WhatsApp"],"operationId":"WhatsAppTemplatesInfo","summary":"WhatsApp templates Info services.","description":"WhatsApp templates Info services.\n","parameters":[{"name":"id","in":"path","description":"The WhatsApp ID.","required":true,"schema":{"allOf":[{"type":"string"}],"description":"The unique ID of WhatsApp service.\n"}},{"name":"template_id","in":"path","description":"The WhatsApp template ID.","required":true,"schema":{"type":"string","description":"Unique identifier of the WhatsApp template.  \nThis ID is provided by the WhatsApp integration and is used to associate\nresources with a specific WhatsApp account.\n"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the WhatsApp template.  \nThis ID is provided by the WhatsApp integration and is used to associate\nresources with a specific WhatsApp account.\n"},"name":{"type":"string","description":"The name of WhatsApp template.\n"},"language":{"type":"string","description":"The language of WhatsApp template.\n"},"category":{"type":"string","enum":["AUTHENTICATION","MARKETING","UTILITY"],"description":"The category of WhatsApp template.\n"},"parameter_format":{"type":"string","enum":["NAMED","POSITIONAL"],"description":"The parameter format of WhatsApp template.\n"},"components":{"type":"string","description":"The components of WhatsApp template.\n"},"status":{"type":"string","enum":["APPROVED","PENDING","REJECTED"],"description":"The status of WhatsApp template.\n"},"created_at":{"type":"string","format":"date-time","description":"The creation time of WhatsApp template.\n"},"updated_at":{"type":"string","format":"date-time","description":"The last update time of WhatsApp template.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Refresh WhatsApp templates services.

> Refresh WhatsApp templates 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":{"/whatsapp/{id}/templates/refresh":{"post":{"tags":["WhatsApp"],"operationId":"refreshWhatsAppTemplates","summary":"Refresh WhatsApp templates services.","description":"Refresh WhatsApp templates services.\n","parameters":[{"name":"id","in":"path","description":"The WhatsApp ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```
