> For the complete documentation index, see [llms.txt](https://en.help.firstline.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://en.help.firstline.cc/developer/api/contact-tag.md).

# Customer tags

## Search

```javascript
GET https://{API_DOMAIN}/api/v1/contact-tag
```

```javascript
curl -X GET
    -H "Content-Type: application/json"
    '{"name": "vip"}'
    https://{API_HOST}/api/v1/contact-tag
```

### Form Data

The table below shows available filter conditions

| PARAMETER | REQUIRED | DEFAULT | TYPE   | DESCRIPTION           |
| --------- | -------- | ------- | ------ | --------------------- |
| **name**  | false    | NULL    | String | Fuzzy search tag name |

### Response

| PROPERTY | TYPE             | DESCRIPTION               |
| -------- | ---------------- | ------------------------- |
| **data** | Array of objects | Array of contact tag data |
| **meta** | Object           | Pagination meta           |

```javascript
{
    "data": [
        {
            "id": 1,
            "name": "High spender",
            "description": null,
            "contacts_count": 1
        },
        {
            "id": 2,
            "name": "Married",
            "description": null,
            "contacts_count": 5
        }
    ],
    "links": {
        "first": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=1",
        "last": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2",
        "prev": null,
        "next": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "http://dev.dev.firstline.cc/api/v1/contact-tag?page=2",
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "http://dev.dev.firstline.cc/api/v1/contact-tag",
        "per_page": 15,
        "to": 15,
        "total": 30
    }
}
```

## Get single record

```javascript
GET https://{API_DOMAIN}/api/v1/contact-tag/{id}
```

```javascript
curl -X GET
    -H "Content-Type: application/json"
    https://{API_HOST}/api/v1/contact-tag/1
```

### URL Parameters

| PARAMETER            | REQUIRED | DEFAULT | TYPE   | DESCRIPTION           |
| -------------------- | -------- | ------- | ------ | --------------------- |
| **contact\_tag\_id** | true     | NULL    | Number | Contact tag system ID |

### Response

| PROPERTY | TYPE   | DESCRIPTION |
| -------- | ------ | ----------- |
| **data** | Object | Contact tag |

```javascript
{
    "data": {
        "id": 1,
        //tag name
        "name": "High spender",
        //tag description
        "description": null,
        //number of contacts with this tag
        "contacts_count": 1
    }
}
```

## Create

```javascript
POST https://{API_DOMAIN}/api/v1/contact-tag
```

```javascript
    '{"name": "Premium Member", "description": "Annual payment" }'
    https://{API_HOST}/api/v1/contact-tag
```

### Form Data

| PARAMETER       | REQUIRED | DEFAULT | TYPE   | DESCRIPTION     |
| --------------- | -------- | ------- | ------ | --------------- |
| **name**        | true     | NULL    | String | Tag name        |
| **description** | false    | NULL    | String | Tag description |

> Returns JSON format

```javascript
{
    "data": {
        "id": 1,
        "name": "Premium Member",
        "description": "Annual member",
        "contacts_count": 0
    }
}
```

## Update

```javascript
PUT https://{API_DOMAIN}/api/v1/contact-tag/{id}
```

```javascript
curl -X PUT
    -H "Content-Type: application/json"
    '{"name": "Monthly member" }'
    https://{API_HOST}/api/v1/contact-tag/1
```

### URL Parameters

| PARAMETER       | REQUIRED | DEFAULT | TYPE   | DESCRIPTION    |
| --------------- | -------- | ------- | ------ | -------------- |
| **name**        | true     | null    | String | Tag name       |
| **description** | false    | null    | String | Tag name count |

### Response

```javascript
{
    "data": {
        "id": 1,
        "name": "High spender",
        "description": null,
        "contacts_count": 1
    }
}
```

## Delete

```
DELETE https://{API_HOST}/api/v1/contact-tag/{id}
```

### URL Parameters

| PARAMETER | DESCRIPTION                          |
| --------- | ------------------------------------ |
| **id**    | System number of the contact tag #ID |

```javascript
curl -X DELETE
    -H "Content-Type: application/json"
    https://{API_HOST}/api/v1/contact-tag/22
```

## General data
