Contact TagsRename a Tag
Rename a Tag
Make a PUT call to the /contact_tags/{tag_id} endpoint to rename an existing tag name to a new unique tag name.
Tag names must:
- be unique to avoid returning a 409 error response.
- consist of at least one character and not more than 255 characters to avoid returning a 400 error response.
- be alphanumeric, which can include spaces, and common keyboard symbols (with the exception of
<and>).
The following shows an example response for a PUT call to the /contact_tags/{tag_id} endpoint:
{
"tag_id": "30c97dd0-332e-11eb-923c-fa163e56c9c1",
"name": "Dogs Rule 2021 Donors",
"created_at": "2020-11-30T17:05:04Z",
"updated_at": "2021-01-21T10:40:41Z"
}The response body returns the name and tag_id used to uniquely identify the tag, and timestamps (in ISO format) showing when the tag was first created (created_at) and last updated (updated_at).
Parameters
When making a PUT call to the /contact_tags/{tag_id}, use the tag_id query parameter in the path to specify which tag to rename and use the name query parameter in the request body to rename the tag.
Authorization Requirements
User privileges: contacts:writeAuthorization scopes: contact_data
Example PUT Tag Requests
PUT
https://api.cc.email/v3/contact_tags/{tag_id}OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"Dogs Rule 2021 Donors\"\n}");
Request request = new Request.Builder()
.url("https://api.cc.email/v3/contact_tags/7a587488-4085-11eb-9b48-fa163e56c9c1")
.method("PUT", body)
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Response
{
"tag_id": "7a587488-4085-11eb-9b48-fa163e56c9c1",
"name": "Dogs Rule 2021 Donors",
"created_at": "2020-12-17T16:32:39Z",
"updated_at": "2021-01-13T17:15:47Z"
}Tagscontacts_tags