> For the complete documentation index, see [llms.txt](https://docs.ushahidi.com/v3-ushahidi-platform-rest-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ushahidi.com/v3-ushahidi-platform-rest-api-documentation/v3/contacts.md).

# Contacts

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/contacts" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

## add contact

<mark style="color:green;">`POST`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/contacts`

#### Request Body

| Name          | Type    | Description                                                  |
| ------------- | ------- | ------------------------------------------------------------ |
| user\_id      | Integer | The user identifier                                          |
| country\_code | String  | Country code                                                 |
| can\_notify   | Boolean | Set True to enable contact notification and False to disable |
| contact       | String  | Contact number                                               |
| type          | String  | The type of contact e.g. "phone"                             |
| data\_source  | String  | The data source                                              |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": 1,
    "url": "http://localhost:8000/api/v3/contacts/1",
    "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
    },
    "data_source": null,
    "type": "phone",
    "contact": "123456789",
    "created": "1970-01-01T00:00:00+00:00",
    "updated": null,
    "can_notify": false,
    "country_code": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/contacts/1" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

## edit contact

<mark style="color:orange;">`PUT`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/contacts/3`

#### Request Body

| Name          | Type    | Description                                                  |
| ------------- | ------- | ------------------------------------------------------------ |
| user\_id      | Integer | The user identifier                                          |
| country\_code | String  | Country code                                                 |
| can\_notify   | Boolean | Set True to enable contact notification and False to disable |
| contact       | String  | Contact number                                               |
| type          | String  | The type of contact e.g. "phone"                             |
| data\_source  | String  | The data source                                              |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": 1,
    "url": "http://localhost:8000/api/v3/contacts/1",
    "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
    },
    "data_source": null,
    "type": "phone",
    "contact": "123456789",
    "created": "1970-01-01T00:00:00+00:00",
    "updated": null,
    "can_notify": false,
    "country_code": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/contacts/9" method="delete" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}
