Customers

Customer Labels

A CustomerLabel is an organisation-wide tag that can be attached to customers (and other resources) to categorise them for reporting and filtering purposes. These endpoints manage the labels themselves and attach or detach them on individual Customers.

The CustomerLabel 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/customers/{customerId}/labels

Get a Customer's Labels

getCustomerLabels

Returns a list of the labels attached to the customer.

Path parameters

  • customerIduuidrequired

    The unique identifier of the customer this operation is scoped to. Customer IDs are stable across renames and email changes; treat them as opaque strings even though the underlying format is a UUID.

Responses

  • 200

    The customer's labels were successfully retrieved

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

post/customers/customers/{customerId}/labels

Attach Labels to a Customer

createCustomerLabels

Attaches the given existing labels to the customer. Labels already attached are ignored.

Path parameters

  • customerIduuidrequired

    The unique identifier of the customer this operation is scoped to. Customer IDs are stable across renames and email changes; treat them as opaque strings even though the underlying format is a UUID.

Request body

  • labelsstring[]required

    An array of label IDs to attach to (or detach from) the customer.

Responses

  • 200

    The customer's labels were 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/customers/{customerId}/labels

Detach Labels from a Customer

deleteCustomerLabels

Detaches the given labels from the customer. Labels that are not currently attached are ignored.

Path parameters

  • customerIduuidrequired

    The unique identifier of the customer this operation is scoped to. Customer IDs are stable across renames and email changes; treat them as opaque strings even though the underlying format is a UUID.

Request body

  • labelsstring[]required

    An array of label IDs to attach to (or detach from) the customer.

Responses

  • 200

    The customer's labels were 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

get/customers/labels

List Labels

listCustomerLabels

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.

  • organisation_iduuidoptional

    Only return labels that belong to the given organisation.

  • 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

createCustomerLabel

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 40 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

getCustomerLabel

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

updateCustomerLabel

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 40 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

deleteCustomerLabel

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

restoreCustomerLabel

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