Supported APIs and scopes
A workload identity's API access tokens can use a subset of the Buildkite REST API. This page summarizes what tokens can do in each product area and the limits to plan for. For endpoint details, see the linked API references.
How access works
A token can call an API when it has the API's scope and, for most APIs, access to the resource through the workload identity's Resource Access setting. Lists only include resources that the token can reach, and other resources return 404 Not Found. A token acts as the workload identity itself, not as an organization administrator or the person who created the workload identity.
| Product area | Resource access | Scopes | |||
|---|---|---|---|---|---|
| Product area | Pipelines and builds | Resource access | Pipelines | Scopes |
read_pipelines, write_pipelines, read_builds, write_builds, retry_builds, read_job_env, read_job_errors, read_build_logs, write_build_logs, read_artifacts, write_artifacts, read_pipeline_templates, write_pipeline_templates, read_rules, write_rules
|
| Product area | Agents and clusters | Resource access | Clusters | Scopes |
read_agents, write_agents, read_clusters, write_clusters, read_secrets_details, write_secrets
|
| Product area | Teams | Resource access | Teams | Scopes |
read_teams, write_teams
|
| Product area | Test Engine | Resource access | Test suites | Scopes |
read_suites, write_suites, read_test_plan, write_test_plan, read_test_pool
|
| Product area | Package Registries | Resource access | Package registries | Scopes |
read_registries, write_registries, delete_registries, read_packages, write_packages, delete_packages
|
| Product area | Organization administration | Resource access | Not limited | Scopes |
read_organizations, write_organizations, read_organization_settings, write_organization_settings, read_notification_services, write_notification_services, read_audit_events, read_organization_invitations, write_organization_invitations, read_api_request_logs, read_organization_repository_connections, read_portals
|
Choose the scopes in Grantable Scopes, as described in Create a workload identity.
Pipelines and builds
With pipeline access, a token can work with those pipelines in Buildkite Pipelines: manage the pipelines, their schedules, triggers, and rules, create and manage builds and jobs, and read and delete job logs and artifacts. Learn more in the Pipelines, Builds, and Jobs API references.
Creating pipelines and managing pipeline templates require All pipeline access, because they affect pipelines outside any selection. To create a pipeline in a cluster other than the default, or assign it to teams, a token also needs access to that cluster and those teams. Rebuilds and retries, including retries of trigger jobs, don't reach builds in pipelines outside the token's access. A token can't change a pipeline's visibility. A token can't unblock jobs on behalf of another person, or unblock jobs that are restricted to specific teams.
Agents and clusters
With cluster access, a token can manage those clusters and their queues, agent tokens, maintainers, and secrets, and read, pause, and stop the agents that connect to them. Learn more in the Clusters and Agents API references.
Creating clusters requires All cluster access. A cluster grant covers every queue and secret in the cluster, and never includes unclustered agents.
Teams
With team access, a token can read and manage those teams and their pipeline assignments. Changing a team's pipeline assignment also requires access to the pipeline. Creating teams requires All team access. A token can't add or remove team members. Learn more in the Teams API reference.
Test Engine
With test suite access, a token can work with those suites in Buildkite Test Engine: read their runs, tests, and test plans, and with write_suites, update and delete the suites, manage their workflows, and change test states, such as muting or skipping tests. With write_test_plan, a token can also create test plans. Learn more in the Suites API reference.
Creating test suites requires All test suite access, and in organizations with teams, at least one team that the token can reach. Assigning a test suite to a team requires access to both. Reads that start from a build or pipeline, such as a build's tests or test pools, also require access to that pipeline.
A token with read_suites can read the API token of every test suite that it can reach, which lets it upload test results to those suites. Workflow webhook endpoints stay hidden.
Package Registries
With package registry access, a token can work with those registries in Buildkite Package Registries: read and manage the registries and their registry tokens, and publish, copy, and delete their packages. Package clients, such as npm, pip, or Docker, can also use the token with packages.buildkite.com, and the same scopes and access apply. Learn more in the Registries API reference.
Creating registries requires All package registry access. In organizations with teams, a new registry must also be assigned to at least one team that the token can reach. Copying a package to another registry requires access to both registries.
Organization administration
Organization administration scopes reach across your whole Buildkite organization, and Resource Access doesn't limit them. They let a token manage members, invitations, organization settings, security settings such as two-factor authentication enforcement, and notification services, and read the audit log, API request logs, repository connections, and portals. A token with these scopes can read or change data about pipelines, teams, and clusters that it can't otherwise reach, so grant them only when the workload needs that access.
A token can't create, update, or delete portals.
Access that outlives the token
Some access that a token creates or reads stays in place after the token expires or the workload identity is disabled:
- Agent tokens that it creates keep working, and their agents can run jobs from any pipeline that uses the cluster.
- Users and teams that it adds as cluster maintainers keep their access.
- Schedules that it creates keep running builds.
- Workflows that it adds to a test suite keep sending notifications.
- Registry tokens that it creates don't expire, so they keep working.
- Test suite API tokens that it reads keep working until you regenerate them in the suite's settings.
- People that it invites keep their access after they accept.
Remove or regenerate these separately when you no longer need them, and grant write_clusters, write_pipelines, read_suites, write_suites, and write_registries only to workloads that you trust.
Unsupported APIs and scopes
GraphQL, secrets outside clusters, and workload identity management aren't supported.