Add a tag to contact

Applies one existing tag to one contact. contact is a contact id and tag is a tag id; they are different id spaces, so the tag id must come from GET /tags or POST /tags, never from a contact record. The response's contactTag id is the association id used by DELETE /contactTags/{id}. A new association returns 201. The contact is included under contacts; the tag definition is included under tags when activity logging is enabled for the account, so do not rely on it and fetch the tag from GET /tags/{id} if needed. In the 201 body, contact and tag inside contactTag are numbers as sent, while every other response returns them as strings. If the tag is already applied, the request returns 200 with the existing association only, so it is safe to repeat. A tag name in the tag field fails with 400 ("No tag id provided"); to apply tags by name, or several tags at once, use POST /contacts/{id}/tags instead. Returns 404 if the contact does not exist or the tag does not exist or was deleted. Requires the contact edit permission; users outside the main user group can only tag contacts they have access to.

{
	"contactTag": {
		"contact": "1",
		"tag": "20"
	}
}
{
	"contactTag": {
		"cdate": "2017-06-08T16:11:53-05:00",
		"contact":"1",
		"id":"1",
		"links":{
			"contact":"/1/contact",
			"tag":"/1/tag"
		},
		"tag":"20"
	}
}
Body Params
contactTag
object

The contact and the tag to apply to it.

Responses

Language
Credentials
Header
URL
LoadingLoading…
Response
Choose an example:
application/json