Label schema
See Management API schema for every domain, the endpoint and authentication.
Mutations
labelsSet
Creates or replaces labels on an owner. Labels the call does not name are unchanged. Each owner
type needs the write scope LabelOwnerType lists for it.
Scope: ORGANIZATION_LEADS_UPDATE, ORGANIZATION_PROJECTS_UPDATE, ORGANIZATION_APPS_UPDATE or ORGANIZATION_UPDATE.
labelsSet(input: LabelsSetInput!): LabelsSetPayload! @authlabelsDelete
Deletes labels from an owner. Deleting a label that is not set succeeds. Each owner type needs
the write scope LabelOwnerType lists for it.
Scope: ORGANIZATION_LEADS_UPDATE, ORGANIZATION_PROJECTS_UPDATE, ORGANIZATION_APPS_UPDATE or ORGANIZATION_UPDATE.
labelsDelete(input: LabelsDeleteInput!): LabelsDeletePayload! @authTypes
LabelType
"""How to read the `value` of a label."""
enum LabelType {
"""A plain string."""
TEXT
"""A number, serialised as a string."""
NUMBER
"""A boolean, serialised as `true` or `false`."""
BOOLEAN
"""A JSON document, serialised as a string."""
JSON
}LabelOwnerType
"""
The kind of entity a label is on. Each kind is read and written under its own scopes:
| Owner type | Read scope | Write scope |
| --- | --- | --- |
| `LEAD` | `ORGANIZATION_LEADS_READ` | `ORGANIZATION_LEADS_UPDATE` |
| `PROJECT` | `ORGANIZATION_PROJECTS_READ` | `ORGANIZATION_PROJECTS_UPDATE` |
| `WORKFLOW_RUN` | `ORGANIZATION_WORKSPACE_READ` | `ORGANIZATION_PROJECTS_UPDATE` |
| `APP_INSTALLATION` | `ORGANIZATION_APPS_READ` | `ORGANIZATION_APPS_UPDATE` |
| `ORGANIZATION` | `ORGANIZATION_READ` | `ORGANIZATION_UPDATE` |
A workflow run reads and writes its own labels without a scope, and so does an app installation
calling with its own token. Every member of an organisation holds `ORGANIZATION_READ` on it and
reads its labels; writing them takes `ORGANIZATION_UPDATE` granted across the organisation. An
API key limited to one project reaches neither.
"""
enum LabelOwnerType {
"""A lead. Its labels are deleted with it."""
LEAD
"""A project. The owner ID is the project ID."""
PROJECT
"""A workflow run."""
WORKFLOW_RUN
"""
An app installation. Its labels are deleted when the app is uninstalled.
"""
APP_INSTALLATION
"""
An organisation. The owner ID is the organization ID, and every project in the organization
shares its labels.
"""
ORGANIZATION
}Label
"""
A name and a value on a lead, a project, a workflow run, an app installation or an organization.
An owner holds one label per namespace and key, and an expired label reads as absent everywhere.
"""
type Label {
"""The ID of the label."""
id: ID!
"""The first part of the name of the label, which groups related keys."""
namespace: String!
"""The name of the label within its namespace."""
key: String!
"""How to read `value`."""
type: LabelType!
"""
The value, as a string to read through `type`. A secret label's value is empty, except to the
app installation that owns it.
"""
value: String!
"""
Whether the value is kept in Vault. Only an app installation's labels are secret.
"""
secret: Boolean!
"""When the label was created."""
createdAt: DateTime!
"""When the label last changed."""
updatedAt: DateTime!
"""When the label expires. Null when it does not expire."""
expiresAt: DateTime
"""
The lead, project, workflow run, app installation or organization the label is on.
"""
owner: LabelOwner!
}LabelOwner
"""
The entity a label is on: a lead, a project, a workflow run, an app installation or an
organization.
"""
union LabelOwner = Lead | Project | WorkflowRun | AppInstallation | OrganizationLabelOperation
"""
A change to a label, made by a workflow run task, a person or an integration.
"""
type LabelOperation implements Operation {
"""The ID of the operation."""
id: ID!
"""What the operation did to the label."""
type: OperationType!
"""When the operation happened."""
occurredAt: DateTime!
"""
The workflow run task that made the change. Null when a workflow did not make it.
"""
task: WorkflowTask
"""The label. Null when the label was deleted or has expired."""
label: Label
}LabelInput
"""
A label to set. A namespace and a key are each 1-64 lowercase letters, digits, underscores or
hyphens. Exactly one of `value` and `increment` is required.
"""
input LabelInput {
"""The first part of the name of the label, which groups related keys."""
namespace: String!
"""The name of the label within its namespace."""
key: String!
"""How to read `value`. Must be `NUMBER` with `increment`."""
type: LabelType!
"""
The value, as a string that parses as `type`. Without `expiresIn`, the label does not expire.
"""
value: String
"""
A finite number to add to the current value; a negative number subtracts. An absent or expired
label counts as 0, concurrent increments all count, and a live label keeps its expiry. Cannot
be combined with `onlyIfAbsent`.
"""
increment: Float
"""
The number of seconds until the label expires, from 1 to 31536000 (365 days).
"""
expiresIn: Int
"""
Whether to write the label only when no live label has this namespace and key. Of several
concurrent writes to an absent label, exactly one takes effect. A live label with this type and
value counts as written and is unchanged; a live label with another value is unchanged and is
listed in `LabelsSetPayload.skipped`.
"""
onlyIfAbsent: Boolean
"""
Whether to keep the value in Vault, where it reads as empty to anyone but the installation. Only an app installation's `TEXT`
and `JSON` labels can be secret, and a secret label takes no `increment` or `onlyIfAbsent`.
Defaults to false.
"""
secret: Boolean
}LabelIdentifierInput
"""A label to delete, named by namespace and key."""
input LabelIdentifierInput {
"""The first part of the name of the label, which groups related keys."""
namespace: String!
"""The name of the label within its namespace."""
key: String!
"""
The value the label must hold to be deleted. A live label with another value is unchanged and
is not listed in `deletedLabelIds`.
"""
ifValue: String
}LabelsSetInput
"""The input of `labelsSet`."""
input LabelsSetInput {
"""The kind of entity the labels are on."""
ownerType: LabelOwnerType!
"""The ID of the entity the labels are on."""
ownerId: ID!
"""The labels to create or replace, one per namespace and key."""
labels: [LabelInput!]!
"""
Whether to write every label or none. When an `onlyIfAbsent` label is skipped, the call writes
nothing and lists the blocking labels in `skipped`. Defaults to false.
"""
atomic: Boolean
}LabelsSetPayload
"""The result of `labelsSet`."""
type LabelsSetPayload {
"""
The labels the call wrote, and the `onlyIfAbsent` labels that already held this type and value.
Empty when the call has `userErrors`, or when an `atomic` call wrote nothing.
"""
labels: [Label!]!
"""
The live labels that an `onlyIfAbsent` label left in place because they held another value.
"""
skipped: [Label!]!
"""The errors, one per invalid label. Empty on success."""
userErrors: [LabelUserError!]!
}LabelsDeleteInput
"""The input of `labelsDelete`."""
input LabelsDeleteInput {
"""The kind of entity the labels are on."""
ownerType: LabelOwnerType!
"""The ID of the entity the labels are on."""
ownerId: ID!
"""The labels to delete."""
labels: [LabelIdentifierInput!]!
}LabelsDeletePayload
"""The result of `labelsDelete`."""
type LabelsDeletePayload {
"""The IDs of the labels the call deleted."""
deletedLabelIds: [ID!]!
"""The errors, one per invalid label. Empty on success."""
userErrors: [LabelUserError!]!
}LabelUserErrorCode
"""What went wrong in a label mutation."""
enum LabelUserErrorCode {
"""
The namespace has a character outside the allowed set, or a wrong length.
"""
NAMESPACE_INVALID
"""The key has a character outside the allowed set, or a wrong length."""
KEY_INVALID
"""
The value does not parse as the type, or the incremented label is not a `NUMBER`.
"""
VALUE_INVALID_FOR_TYPE
"""No owner of that type has that ID."""
OWNER_NOT_FOUND
"""
A malformed write: both or neither of `value` and `increment`, `increment` with `onlyIfAbsent`
or a type other than `NUMBER`, `expiresIn` out of range, a repeated namespace and key, or a
`secret` label that is not an app installation's `TEXT` or `JSON` value without `increment` and
`onlyIfAbsent`.
"""
LABEL_WRITE_INVALID
}LabelUserError
"""An error from `labelsSet` or `labelsDelete`."""
type LabelUserError {
"""
The path to the input field that caused the error, such as `["labels", "0", "namespace"]`.
"""
field: [String!]
"""A message that describes the error."""
message: String!
"""The error code."""
code: LabelUserErrorCode!
}