Tags

Create or update tags

Upserts a batch of tags in the caller's tenant in a single transaction:

  • a record without id creates a new tag and publishes a tag-created domain event (ETagCreatedEvent);
  • a record with id updates the label and active flag of that existing tag (no event is published for updates).

Tags not mentioned in the request are left untouched — this is not a full replace, and tags cannot be deleted through this operation (use DELETE /tags/{tagId}). The response contains only the created/updated tags, in request order.

Authorization: requires the global:metadata:manage scope.

Errors (400): empty tags list; the same label used twice in one request; a blank label or a label longer than 255 characters; missing active; an id that does not exist in the tenant; a concurrent modification of the same tag. Duplicate labels are only checked within the request, not against tags that already exist. Any error rolls back the whole batch.

put/tags

Request

  • Base URL
    https://api.surense.com/api/v1
  • URL
    https://api.surense.com/api/v1/tags
  • Auth
    OAuth 2
    Client credentials
    Token URL: https://api.surense.com/oauth/token scopes: global:metadata:manage

Request body

Example request

{
  "tags": [
    {
      "id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f4a9c13",
      "label": "VIP customer",
      "active": true
    }
  ]
}

Response

The created and updated tags, in request order.

tenantIdstring uuid
agencyIdstring uuid
createdDatestring date-time
createdBystring uuid
creatorNamestring
lastModifiedDatestring date-time
lastModifiedBystring uuid
versioninteger
idstring uuid

Tag ID

labelstring

Display label (1-255 characters)

activeboolean

Whether the tag is active (offered for selection)

Example response

[
  {
    "id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7f4a9c13",
    "label": "VIP customer",
    "active": true
  }
]

Changes

No recorded changes to this operation across all 1 revision of this API.