Sites & Organisation

Labels

A Label is an organisation-wide tag that can be attached to customers (and other resources) to categorise them for reporting and filtering purposes.

The Label object

Attributes

  • iduuidrequired

    The ID of the label

  • valuestringrequired

    The name of the label

  • colourstringrequired

    A hex colour code excluding the preceding # which this label will be rendered as.

  • organisation_iduuidrequired

    The organisation which this label belongs to

  • created_atdate-timerequired

    The datetime which the label was created

  • updated_atdate-timerequired

    The datetime which the label was last updated

{
  "id": "000000-000000-000000-000000",
  "value": "VIP",
  "colour": "ff6634",
  "organisation_id": "000000-000000-000000-000000",
  "created_at": "2021-01-01T00:00:00.000Z",
  "updated_at": "2021-01-01T00:00:00.000Z"
}
get/customers/labels

List Labels

listLabels

Retrieves a list of all the labels set up against the authenticated user's organisation.

Query parameters

  • archivedbooleanoptional

    Whether to include archived resources in the response. When true, archived resources are returned; when false or omitted, only non-archived resources are returned.

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

Responses

  • 200

    The labels were successfully retrieved

  • 401

    The user is unauthenticated

post/customers/labels

Create a Label

createLabel

Creates a new Label on the authenticated user's organisation. Labels are then available to attach to any Customer in the organisation for ad-hoc segmentation in reports and Customer Hub searches.

Request body

  • valuestringrequired

    Display text shown on the label badge against a customer. Operator-facing only — there is no guest-visible surface for labels. Limited to 20 characters so the badge fits in customer-list rows.

  • colourstringrequired

    A hex colour code excluding the preceding # which this label will be rendered as.

  • organisation_iduuidoptional

    The organisation which this label belongs to

Responses

  • 201

    The label was successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/customers/labels/{labelId}

Get a Label

getLabel

Retrieves details about the given label.

Path parameters

  • labelIduuidrequired

    The unique identifier of the label this operation is scoped to.

Responses

  • 200

    The label was successfully retrieved

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

put/customers/labels/{labelId}

Update a Label

updateLabel

Updates the given Label. The change applies retroactively everywhere the label is currently attached — there is no versioning, so renaming a label changes how it appears against every customer that already carries it.

Path parameters

  • labelIduuidrequired

    The unique identifier of the label this operation is scoped to.

Request body

  • valuestringoptional

    Display text shown on the label badge against a customer. Operator-facing only — there is no guest-visible surface for labels. Limited to 20 characters so the badge fits in customer-list rows.

  • colourstringoptional

    A hex colour code excluding the preceding # which this label will be rendered as.

Responses

  • 200

    The label was successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/customers/labels/{labelId}

Delete a Label

deleteLabel

Soft-deletes the given label.

Path parameters

  • labelIduuidrequired

    The unique identifier of the label this operation is scoped to.

Responses

  • 204

    The label was successfully soft-deleted

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/customers/labels/{labelId}/restore

Restore a Label

restoreLabel

Restores a soft-deleted label.

Path parameters

  • labelIduuidrequired

    The unique identifier of the label this operation is scoped to.

Responses

  • 200

    The label was successfully retrieved

  • 400

    The label could not be restored

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found