Skip to main content
POST
cURL
Workload identity federation is in Private Preview.

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Body

application/json

Request to create a trust rule.

name
string
required

Name, unique in the organization. Can be changed later.

Required string length: 1 - 255
identity_provider_id
string
required

Whose tokens the rule accepts. Can't be changed.

service_account_id
string
required

The service account its tokens act as. Can be changed later.

condition
string
required

A CEL expression over the token's claims that must evaluate to true. It must pin a specific claims.sub in a top-level && clause, plus any provider-required checks. Up to 4,096 characters. Can be changed later.

Example:

"claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'"

audience
string
required

The token's aud must equal this, or contain it when aud is a list. Up to 1,024 characters. Can be changed later.

description
string | null

Optional description

max_access_token_lifetime_seconds
integer
default:3600

Longest lifetime of a token the rule issues, 60 to 3600 seconds. Can be changed later.

Required range: 60 <= x <= 3600

Response

200 - application/json

Which tokens from an identity provider may act as a service account.

id
string
required

Trust rule ID. Workloads pass it when they exchange a token.

name
string
required

Name, unique in the organization

identity_provider_id
string
required

The identity provider whose tokens it accepts

identity_provider_name
string
required

Name of the identity provider

service_account_id
string
required

The service account its tokens act as

service_account_name
string
required

Name of the service account

condition
string
required

A CEL expression over the token's claims that must evaluate to true. It must pin a specific claims.sub in a top-level && clause, plus any provider-required checks. Up to 4,096 characters.

Example:

"claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'"

audience
string
required

The token's aud must equal this, or contain it when aud is a list. Up to 1,024 characters.

max_access_token_lifetime_seconds
integer
required

Longest lifetime of a token the rule issues, in seconds

created_by
string
required

ID of the user who created the rule

created_at
string<date-time>
required

Time the rule was created

updated_at
string<date-time>
required

Time the rule was last updated

description
string | null

Description

team_id
string | null

The service account's team. Null for an organization service account.

team_name
string | null

Name of the service account's team. Null for an organization service account.

last_used_at
string<date-time> | null

Last time a request authenticated with a token the rule issued, to within an hour. Null until the first.