The Tags API provides a simple interface to manage tags. The API allows you to create, delete and update your tags. You can retrieve a single tag, a list of all tags, and search for tags.

JSON format

NameRead OnlyTypeDescription
idtruenumberUnique identifier of the tag.
creator_idtruenumberUser ID of the tag's creator.
namefalsestringName of the tag.
resource_typefalsestringType name of the resource the tag is attached to. Possible values: lead, contact, deal
created_attruestringDate and time of creation in UTC (ISO8601 format).
updated_attruestringDate and time of the last update in UTC (ISO8601 format).

Retrieve all tags

GET /v2/tags

Returns all tags available to the user, according to the parameters provided.

Parameters

NameRequiredTypeInDescription
pagefalsenumberQueryPage number to start from. Page numbering starts at 1, and omitting the page parameter will return the first page.
per_pagefalsenumberQueryNumber of records to return per page. The default limit is 25 and the maximum number that can be returned is 100.
sort_byfalsestringQueryA field to sort by. The default order is ascending. If you want to change the sort order to descending, append :desc to the field e.g. sort_by=name:desc. Possible values: name, updated_at, created_at
idsfalsestringQueryComma-separated list of deal tag IDs to be returned in a request.
creator_idfalsenumberQueryUser ID. Returns all tags created by that user.
namefalsestringQueryName of the tag to search for. This parameter is used in a strict sense.
resource_typefalsestringQueryType name of resource to search for. Possible values: lead, contact, deal

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/tags \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "items": [    {      "data": {        "id": 1,        "creator_id": 1,        "name": "publisher",        "resource_type": "contact",        "created_at": "2014-08-27T16:32:56Z",        "updated_at": "2014-08-27T16:32:56Z"      },      "meta": {        "type": "tag"      }    },    {      "data": {        "id": 2,        "creator_id": 1,        "name": "marketer",        "resource_type": "contact",        "created_at": "2014-08-27T16:32:57Z",        "updated_at": "2014-08-27T16:32:57Z"      },      "meta": {        "type": "tag"      }    },    {      "data": {        "id": 3,        "creator_id": 1,        "name": "vendor",        "resource_type": "contact",        "created_at": "2014-08-27T16:32:58Z",        "updated_at": "2014-08-27T16:32:58Z"      },      "meta": {        "type": "tag"      }    },    {      "data": {        "id": 4,        "creator_id": 1,        "name": "retailer",        "resource_type": "contact",        "created_at": "2014-08-27T16:32:59Z",        "updated_at": "2014-08-27T16:32:59Z"      },      "meta": {        "type": "tag"      }    }  ],  "meta": {    "type": "collection",    "count": 4,    "links": {      "self": "http://api.getbase.com/v2/tags.json"    }  }}

Create a tag

POST /v2/tags

Creates a new tag. Notice the tag's name must be unique within the scope of the resource_type.

Parameters

NameRequiredTypeInDescription
nametruestringBodyMust be unique within the scope of the resource_type.
resource_typetruestringBodye.g. "resource_type": "contact"

Allowed for

  • Agents

Using cURL

curl -v -X POST https://api.getbase.com/v2/tags \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "name": "important",    "resource_type": "contact"  },  "meta": {    "type": "tag"  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 5,    "creator_id": 1,    "name": "important",    "resource_type": "contact",    "created_at": "2014-08-27T16:33:00Z",    "updated_at": "2014-08-27T16:33:00Z"  },  "meta": {    "type": "tag"  }}

Retrieve a single tag

GET /v2/tags/:id

Returns a single tag available to the user according to the unique ID provided. If the specified tag does not exist, this query will return an error.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the tag.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/tags/5 \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 5,    "creator_id": 1,    "name": "important",    "resource_type": "contact",    "created_at": "2014-08-27T16:33:00Z",    "updated_at": "2014-08-27T16:33:00Z"  },  "meta": {    "type": "tag"  }}

Update a tag

PUT /v2/tags/:id

Updates a tag's information. If the specified tag does not exist, this query will return an error.

Notice if you want to update a tag, you must make sure the tag's name is unique within the scope of the specified resource.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the tag.
namefalsestringBodyMust be unique within the scope of the resource_type.
resource_typefalsestringBodye.g. contact

Allowed for

  • Agents

Using cURL

curl -v -X PUT https://api.getbase.com/v2/tags/5 \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "name": "super important"  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 5,    "creator_id": 1,    "name": "super important",    "resource_type": "contact",    "created_at": "2014-08-27T16:33:00Z",    "updated_at": "2014-08-27T16:33:01Z"  },  "meta": {    "type": "tag"  }}

Delete a tag

DELETE /v2/tags/:id

Deletes an existing tag. If the specified tag is assigned to any resource, we will remove this tag from all such resources. If the specified tag does not exist, this query will return an error. This operation cannot be undone.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the tag.

Allowed for

  • Agents

Using cURL

curl -v -X DELETE https://api.getbase.com/v2/tags/1 \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 204 No Content