# Contact

Manage your contacts.

## List contact

> Retrieve a collection of contacts.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Contact","description":"Manage your contacts.\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":{"/contacts":{"get":{"tags":["Contact"],"operationId":"listContacts","summary":"List contact","description":"Retrieve a collection of contacts.\n","parameters":[{"name":"skip","in":"query","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","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 the resource.\n"}],"description":"The unique ID of contact.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"},"sync_type":{"type":"string","enum":["Microsoft 365"],"description":"The synchronization method.   \nCan be either:   \n- `Microsoft 365`: Sync from Microsoft 365.\n"}}}}}}}}},"4XX":{"description":"Error"}}}}}}
```

## POST /contacts

> Add a new contact

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Contact","description":"Manage your contacts.\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":{"/contacts":{"post":{"tags":["Contact"],"operationId":"createContact","summary":"Add a new contact","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"}}}}},"required":true},"responses":{"201":{"description":"Created contact","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"allOf":[{"type":"string","description":"The unique ID of the resource.\n"}],"description":"The unique ID of contact.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Retrieve contact

> Retrieves details of a contact.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Contact","description":"Manage your contacts.\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":{"/contacts/{id}":{"get":{"tags":["Contact"],"operationId":"showContact","summary":"Retrieve contact","description":"Retrieves details of a contact.\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 contact.\n"},"description":"The unique ID of the contact."}],"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 contact.\n"},"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"},"sync_type":{"type":"string","enum":["Microsoft 365"],"description":"The synchronization method.   \nCan be either:   \n- `Microsoft 365`: Sync from Microsoft 365.\n"}}}}}},"4XX":{"description":"Error"}}}}}}
```

## Update a contact

> Update an contact.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Contact","description":"Manage your contacts.\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":{"/contacts/{id}":{"post":{"tags":["Contact"],"operationId":"updateContact","summary":"Update a contact","description":"Update an contact.\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 contact.\n"},"description":"The unique ID of the contact."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"description":"The name of contact.\n"},"email":{"type":"string","maxLength":128,"description":"The email of contact.\n"},"company":{"type":"string","maxLength":128,"description":"The company name of contact.\n"},"title":{"type":"string","maxLength":128,"description":"The title of contact.\n"},"business":{"type":"string","maxLength":128,"description":"The business phone number of contact.\n"},"business2":{"type":"string","maxLength":128,"description":"The secondary business phone number of contact.\n"},"mobile_phone":{"type":"string","maxLength":128,"description":"The mobile phone number of contact.\n"},"mobile_phone2":{"type":"string","maxLength":128,"description":"The secondary mobile phone number of contact.\n"},"home_phone":{"type":"string","maxLength":128,"description":"The home phone number of contact.\n"},"home_phone2":{"type":"string","maxLength":128,"description":"The secondary home phone number of contact.\n"},"other":{"type":"string","maxLength":128,"description":"The other phone number of contact.\n"},"business_fax":{"type":"string","maxLength":128,"description":"The business fax of contact.\n"},"home_fax":{"type":"string","maxLength":128,"description":"The home fax of contact.\n"},"address":{"type":"string","maxLength":128,"description":"The address.\n"},"notes":{"type":"string","maxLength":1024,"description":"The notes of contact.\n"}}}}},"required":true},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error"}}}}}}
```

## Delete a contact

> Delete a certain contact by it's unique id.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Contact","description":"Manage your contacts.\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":{"/contacts/{id}/destroy":{"post":{"tags":["Contact"],"operationId":"deleteContact","summary":"Delete a contact","description":"Delete a certain contact by it's unique id.\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 contact.\n"},"description":"The unique ID of the contact."}],"responses":{"204":{"description":"No Content"},"4XX":{"description":"Error"}}}}}}
```

## Export contacts

> Export a collection of contacts to file.<br>

```json
{"openapi":"3.1.0","info":{"title":"PortSIP PBX Rest API","version":"22.0"},"tags":[{"name":"Contact","description":"Manage your contacts.\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":{"/contacts/export":{"get":{"tags":["Contact"],"operationId":"exportContacts","summary":"Export contacts","description":"Export a collection of contacts to file.\n","responses":{"200":{"description":"OK","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"the format is `attachment; filename=\"example\"`"}},"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"4XX":{"description":"Error"}}}}}}
```
