> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.wanotifier.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Contacts API - Manage Your Contacts Using REST API

If you want to add contacts from 3rd party websites, apps or using automation tools like Zapier or Pabbly, you can use our API to do so.

||| View our full REST API [Postman collection here](https://www.postman.com/wanotifier/wanotifier/collection/xfjfce8/wanotifier-api)

**Note:** This is an advanced feature so you might need help of your developer to set this up for you if you’re not familiar with using REST API and webhooks. 

### Table of Contents

* [Get contacts](#3-get-contacts)
* [Get specific contact](#3-get-specific-contact)
* [Add / edit contacts](#3-add-edit-contacts)
* [Get contact lists](#3-get-contact-lists)
* [Get contact tags](#3-get-contact-tags)

### Get contacts

Get all contacts from your account

###### Request syntax

```
GET https://app.wanotifier.com/api/v1/contacts
  ?key=<YOUR_API_KEY>
  &search=<SEARCH_TERM>
  &list_ids=<LIST_IDS>
  &tag_ids=<TAG_IDS>
  &per_page=<PER_PAGE_LIMIT>
  &page=<PAGE_NUMBER>
```

###### Request fields

| Field name | Type | Description |
| ---- |
| key | string | Your WANotifier API key. You can get it from the [Automations > Integrations > API Integration](https://app.wanotifier.com/integrations/api/) page from the **API Keys** tab. |
| search | string | Search term to filter your contacts |
| list_ids | int | Comma separated list IDs. You can get list IDs from [Contacts > Lists](https://app.wanotifier.com/contacts/lists/) page |
| tag_ids | int | Comma separated tag IDs. You can get tag IDs from [Contacts > Tags](https://app.wanotifier.com/contacts/tags/) page |
| per_page | int | Total number of contacts to return per page. Default = 1 |
| page | int | Response page number |

###### Example request

```
curl --location 'https://app.wanotifier.com/api/v1/contacts?key=A7X4P9Q2MZ1D6T8R&search=john' \
--header 'Content-Type: application/json'
```

###### Example response

```
{
    "total": 123,					// Total number of filtered contacts
    "contacts": [
        {
            "id": "12345678",				// Contact ID
            "first_name": "John",			// Contact first name
            "last_name": "Doe",				// Contact last name
            "wa_number": "+919876543210",		// Contact phone number
            "status": "subscribed",			// Contact subscription status
            "created_time": "2025-07-16 05:35:42",	// Created date
            "modified_time": "2025-07-16 05:35:50"	// Last modified date
        }
		...
    ],
    "page": 1,						// Results page number
    "per_page": 10					// Contacts per page
}
```

---

### Get specific contact

Get a specific contact from your account using it's unique contact ID. 

###### Request syntax

```
GET https://app.wanotifier.com/api/v1/contacts/<CONTACT_ID>?key=<YOUR_API_KEY>
```

###### Request fields

| Field name | Type | Description |
| ---- |
| contact_id | int | Contact ID. **Required** |
| key | string | Your WANotifier API key. You can get it from the [Automations > Integrations > API Integration](https://app.wanotifier.com/integrations/api/) page from the **API Keys** tab. |

###### Example request

```
curl --location 'https://app.wanotifier.com/api/v1/12345678/contacts?key=A7X4P9Q2MZ1D6T8R' \
--header 'Content-Type: application/json'
```

###### Example response

```
{
    "id": 12345678,					// Contact ID
    "first_name": "John",				// Contact first name
    "last_name": "Doe",					// Contact last name
    "whatsapp_number": "+919876543210",			// Contact phone number
    "status": "Saved",					// Contact save status
    "subscription": "Subscribed",			// Contact subscription status
    "created_datetime": "16 Jul, 2025 05:58:24",	// Created time
    "modified_datetime": "16 Jul, 2025 05:58:24",	// Last modified time
    "profile_picture_url": "",				// Prifle picture URL
    "lists": [						// Contact lists
        {
            "term_id": 481371,				// Contact list ID
            "term_name": "WANotifier Users"		// Contact list name
        }
    ],
    "tags": [						// Contact tags
    	"new lead",
    	"ads"
    ],
    "attributes": {					// Contact attributes
        "website": "https://www.twilio.com/"
    }
}
```

---

### Add / edit contacts

Add or edit contacts

###### Request syntax

```
POST https://app.wanotifier.com/api/v1/contacts?key=<YOUR_API_KEY>
```

###### Request POST data

```
{
    "whatsapp_number": "<<whatsapp_number>>", 
    "first_name": "<<first_name>>", 
    "last_name": "<<last_name>>", 
    "attributes": {
        "<<attribute_key_1>>": "<<attribute_value_1>>", 
        "<<attribute_key_2>>": "<<attribute_value_2>>", 
        "<<attribute_key_3>>": "<<attribute_value_3>>" 
    },
    "list_ids": [
        "<<list_name_1>>", "<<list_name_2>>" 
    ],
    "tag_ids": [
        "<<tag_name_1>>", "<<tag_name_2>>" 
    ],
    "status": "<<subscription_status>>", 
    "replace": false 
}
```

###### Request fields

| Field name | Type | Description |
| ---- |
| key | string | Your WANotifier API key. You can get it from the [Automations > Integrations > API Integration](https://app.wanotifier.com/integrations/api/) page from the **API Keys** tab. **Required**. |
| whatsapp_number | string | WhatsApp phone number of the contact with country extension. **Required** |
| first_name | string | First name of the contact |
| last_name | string | Last name of the contact |
| attributes | array | Array of key value pairs of custom attributes. The keys must be in small letters with underscores. Special characters and spaces are not allowed |
| status | string | Subscription status of the contact. Can be either **subscribed** or **unsubscribed**. Default: subscribed |
| lists | array | Array of list names. You can either use this or **list_ids** field. Do not use both at once. |
| list_ids | array | Array of list ids. You can either use this or **lists** field. Do not use both at once. |
| tags | array | Array of tag names. You can either use this or **tag_ids** field. Do not use both at once. |
| tag_ids | array | Array of list ids. You can either use this or **tags** field. Do not use both at once. |
| replace | boolean | Keep this value true to replace existing custom attributes, lists and tags with data sent in the request. Else, keep false. |

###### Example request

```
curl --location 'https://app.wanotifier.com/api/v1/contacts?key=A7X4P9Q2MZ1D6T8R' \
--header 'Content-Type: application/json' \
--data '{
    "whatsapp_number": "+919876543210", 
    "first_name": "John", 
    "last_name": "Doe", 
    "attributes": {
        "dob": "01/01/1991", 
        "city": "Pune", 
        "website_url": "https://example.com" 
    },
    "list_ids": [
        12345
    ],
    "tag_ids": [
        45678, 56789
    ],
    "status": "subscribed", 
    "replace": false 
}'
```

###### Example response

```
{
    "message": "Contact updated successfully.",
    "error": false
}
```

---

### Get contact lists

Fetch all contact lists from your account

###### Request syntax

```
GET https://app.wanotifier.com/api/v1/contacts/lists?key=<YOUR_API_KEY>
```

###### Request fields

| Field name | Type | Description |
| ---- |
| key | string | Your WANotifier API key. You can get it from the [Automations > Integrations > API Integration](https://app.wanotifier.com/integrations/api/) page from the **API Keys** tab. **Required**. |

###### Example request

```
curl --location 'https://app.wanotifier.com/api/v1/contacts/lists?key=A7X4P9Q2MZ1D6T8R' \
--header 'Content-Type: application/json'
```

###### Example response

```
[
    {
        "id": 123456,
        "name": "Default"
    },
    {
        "id": 23456,
        "name": "Website Leads"
    },
    {
        "id": 345678,
        "name": "Customers"
    }
]
```

---

### Get contact tags

Fetch all contact tags from your account

###### Request syntax

```
GET https://app.wanotifier.com/api/v1/contacts/tags?key=<YOUR_API_KEY>
```

###### Request fields

| Field name | Type | Description |
| ---- |
| key | string | Your WANotifier API key. You can get it from the [Automations > Integrations > API Integration](https://app.wanotifier.com/integrations/api/) page from the **API Keys** tab. **Required**. |

###### Example request

```
curl --location 'https://app.wanotifier.com/api/v1/contacts/tags?key=A7X4P9Q2MZ1D6T8R' \
--header 'Content-Type: application/json'
```

###### Example response

```
[
    {
        "id": 987654,
        "name": "new lead"
    },
    {
        "id": 876543,
        "name": "paid customer"
    },
    {
        "id": 765432,
        "name": "free user"
    }
]
```