Skip to main content

Create a new tag in a tag group

Call signature

TypeScript
create(tag: ICreateTag): Promise<Tag>;

Parameters

NameTypeDescription
tagICreateTagA tag-like object containing the minimum required fields to create a tag (groupId, value and one label)

Returns

A Promise that will resolve with a created Tag

Remarks

Throws any error that is returned by the API for any unsuccessful request echoing the HTTP status returned from the API

Example

Create a new tag in a specific group with the minumum required fields

TypeScript
const tag = await client.tags.create({
    groupId: "topics",
    value: "books",
    label: { "en-GB": "Books" }
});

console.log(`Successfully created tag`);

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request