API clients
Programs that call the API with credentials of their own, such as Terraform, CI, connectors and agents. Each gets access tokens from its organization's token endpoint with the client credentials grant, limited to its scopes.
The API client model
An API client: a program that calls the API with credentials of its own, such as Terraform, CI, a connector or an agent. It gets access tokens from its organization's token endpoint with the OAuth 2.0 client credentials grant (RFC 6749 §4.4), and every token carries at most the client's scopes. The secret is shown once, when the client is created or its secret is rotated.
Properties
- Name
id- Type
- string
- Description
API client ID. It is also the OAuth
client_id.
- Name
etag- Type
- string
- Description
Current version.
- Name
name- Type
- string
- Description
Display name, unique within the organization.
- Name
description- Type
- string
- Description
Free text.
- Name
scopes- Type
- array of strings
- Description
The scopes the client's access tokens may carry, from the
oauth2security scheme.
- Name
workload_audiences- Type
- array of strings
- Description
The audiences this may ask for workload tokens for: short-lived JWTs that other platforms trust, such as
sts.amazonaws.com. Exact strings; empty means none.
- Name
federated_credentials- Type
- array of objects
- Description
Outside identities this trusts instead of a secret (see
docs/federated-credentials.md).
- Name
federated_credentials[].name- Type
- string
- Description
A name for it, unique on the API client or agent, such as
github-main.
- Name
federated_credentials[].issuer- Type
- string
- Description
The platform's issuer, exactly as its tokens'
iss: anhttpsURL that serves/.well-known/openid-configuration.
- Name
federated_credentials[].subject- Type
- string
- Description
The
suba token must have, exactly. Set this orsubject_pattern. Can benull.
- Name
federated_credentials[].subject_pattern- Type
- string
- Description
A pattern the
submust match instead, where*stands for any run of characters. It must start with a literal part, sorepo:acme/infra:*is allowed and*:ref:refs/heads/mainis not. Can benull.
- Name
federated_credentials[].audience- Type
- string
- Description
The
auda token must carry: what the workload asks its platform for, such as the organization's issuer URL.
- Name
federated_credentials[].claims- Type
- object
- Description
Other claims a token must carry with exactly these values, such as GitHub's
repository_ownerorenvironment.
- Name
labels- Type
- object
- Description
Labels.
- Name
managed_by- Type
- string
- Description
The tool that manages this resource, such as
terraform. Can benull.
- Name
created_at- Type
- timestamp
- Description
When the client was created.
- Name
updated_at- Type
- timestamp
- Description
When the client last changed.
List api clients
Needs the api-clients:read scope.
Query parameters
- Name
page_size- Type
- integer
- Description
Results per page, 1 to 200.
0or absent means 50; more than 200 means 200 (AIP-158).
- Name
page_token- Type
- string
- Description
next_page_tokenfrom the previous page.
- Name
updated_since- Type
- timestamp
- Description
Only resources changed at or after this time.
- Name
name- Type
- string
- Description
Only the client with this exact name.
Request
curl https://acme.ext.passway.com/v1/api-clients \
-H "Authorization: Bearer $PASSWAY_TOKEN"
Response
{
"data": [
{
"id": "apc_01jd8k3m2v9x4q7r5t6w8y0z1a",
"etag": "3f9a",
"name": "terraform-ci",
"description": "…",
"scopes": [
"…"
],
"workload_audiences": [
"…"
],
"federated_credentials": [
{}
],
"labels": {
"passway.example/cost-center": "4410",
"team": "facilities"
},
"managed_by": "terraform",
"created_at": "2026-11-30T14:02:11Z",
"updated_at": "2026-11-30T14:02:11Z"
}
],
"next_page_token": null
}
Create an api client
Returns the client secret, which is never shown again. A caller can give only scopes it has itself.
Needs the api-clients:write scope.
Headers
- Name
Idempotency-Key- Type
- string
- Description
A unique key, such as a UUID. Repeating a successful request with the same key within 24 hours returns the original response; reusing it for a different request returns
422; repeating it while the first is still running returns409withRetry-After.
Required attributes
- Name
name- Type
- string
- Description
Display name, unique within the organization.
- Name
scopes- Type
- array of strings
- Description
The scopes the client's access tokens may carry, from the
oauth2security scheme. A caller can give only scopes it has itself.
Optional attributes
- Name
description- Type
- string
- Description
Free text.
- Name
workload_audiences- Type
- array of strings
- Description
The audiences this may ask for workload tokens for (see
POST /oauth/tokenwithaudience): at most 10 exact strings.
- Name
federated_credentials- Type
- array of objects
- Description
Outside identities this trusts instead of a secret: tokens another platform issues to a workload, such as a GitHub Actions job.
- Name
federated_credentials[].name- Type
- string
- Description
A name for it, unique on the API client or agent, such as
github-main.
- Name
federated_credentials[].issuer- Type
- string
- Description
The platform's issuer, exactly as its tokens'
iss: anhttpsURL that serves/.well-known/openid-configuration.
- Name
federated_credentials[].subject- Type
- string
- Description
The
suba token must have, exactly. Set this orsubject_pattern. Can benull.
- Name
federated_credentials[].subject_pattern- Type
- string
- Description
A pattern the
submust match instead, where*stands for any run of characters. It must start with a literal part, sorepo:acme/infra:*is allowed and*:ref:refs/heads/mainis not. Can benull.
- Name
federated_credentials[].audience- Type
- string
- Description
The
auda token must carry: what the workload asks its platform for, such as the organization's issuer URL.
- Name
federated_credentials[].claims- Type
- object
- Description
Other claims a token must carry with exactly these values, such as GitHub's
repository_ownerorenvironment.
- Name
labels- Type
- object
- Description
Labels.
- Name
managed_by- Type
- string
- Description
The tool that manages this resource. Terraform sets
terraform.
Request
curl -X POST https://acme.ext.passway.com/v1/api-clients \
-H "Authorization: Bearer $PASSWAY_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "terraform-ci",
"scopes": [
"…"
],
"labels": {
"passway.example/cost-center": "4410",
"team": "facilities"
},
"managed_by": "terraform"
}'
Response
{
"api_client": {
"id": "apc_01jd8k3m2v9x4q7r5t6w8y0z1a",
"etag": "3f9a",
"name": "terraform-ci",
"description": "…",
"scopes": [
"…"
],
"workload_audiences": [
"…"
],
"federated_credentials": [
{
"name": "github-main",
"issuer": "https://token.actions.githubusercontent.com",
"subject": "repo:acme/infra:ref:refs/heads/main",
"subject_pattern": "repo:acme/infra:environment:*",
"audience": "https://acme.ext.passway.com",
"claims": {}
}
],
"labels": {
"passway.example/cost-center": "4410",
"team": "facilities"
},
"managed_by": "terraform",
"created_at": "2026-11-30T14:02:11Z",
"updated_at": "2026-11-30T14:02:11Z"
},
"client_secret": "pwcs_7Hq2kX9vN4mP8sL3wQ5rT1yU6iO0pA2s"
}
Get an api client
Needs the api-clients:read scope.
Path parameters
- Name
api_client_id- Type
- string
- Description
API client ID:
apc_followed by 1 to 64 lowercase letters and digits.
Request
curl https://acme.ext.passway.com/v1/api-clients/apc_01jd8k3m2v9x4q7r5t6w8y0z1a \
-H "Authorization: Bearer $PASSWAY_TOKEN"
Response
{
"id": "apc_01jd8k3m2v9x4q7r5t6w8y0z1a",
"etag": "3f9a",
"name": "terraform-ci",
"description": "…",
"scopes": [
"…"
],
"workload_audiences": [
"…"
],
"federated_credentials": [
{
"name": "github-main",
"issuer": "https://token.actions.githubusercontent.com",
"subject": "repo:acme/infra:ref:refs/heads/main",
"subject_pattern": "repo:acme/infra:environment:*",
"audience": "https://acme.ext.passway.com",
"claims": {}
}
],
"labels": {
"passway.example/cost-center": "4410",
"team": "facilities"
},
"managed_by": "terraform",
"created_at": "2026-11-30T14:02:11Z",
"updated_at": "2026-11-30T14:02:11Z"
}
Update an api client
A JSON merge patch (RFC 7396): fields in the body replace the current ones, null removes a field where the schema allows null, and objects such as labels are merged. Requires If-Match with the current etag.
Needs the api-clients:write scope.
Path parameters
- Name
api_client_id- Type
- string
- Description
API client ID:
apc_followed by 1 to 64 lowercase letters and digits.
Headers
- Name
If-Match- Type
- string
- Description
The resource's current
etag, in double quotes. Required.
Optional attributes
- Name
name- Type
- string
- Description
New name.
- Name
description- Type
- string
- Description
New description.
- Name
scopes- Type
- array of strings
- Description
New scopes, replacing the current ones.
- Name
workload_audiences- Type
- array of strings
- Description
New workload audiences, replacing the current ones.
- Name
federated_credentials- Type
- array of objects
- Description
New federated credentials, replacing the current ones.
- Name
federated_credentials[].name- Type
- string
- Description
A name for it, unique on the API client or agent, such as
github-main.
- Name
federated_credentials[].issuer- Type
- string
- Description
The platform's issuer, exactly as its tokens'
iss: anhttpsURL that serves/.well-known/openid-configuration.
- Name
federated_credentials[].subject- Type
- string
- Description
The
suba token must have, exactly. Set this orsubject_pattern. Can benull.
- Name
federated_credentials[].subject_pattern- Type
- string
- Description
A pattern the
submust match instead, where*stands for any run of characters. It must start with a literal part, sorepo:acme/infra:*is allowed and*:ref:refs/heads/mainis not. Can benull.
- Name
federated_credentials[].audience- Type
- string
- Description
The
auda token must carry: what the workload asks its platform for, such as the organization's issuer URL.
- Name
federated_credentials[].claims- Type
- object
- Description
Other claims a token must carry with exactly these values, such as GitHub's
repository_ownerorenvironment.
- Name
labels- Type
- object
- Description
Labels to set or remove, or
nullto remove every label. Can benull.
- Name
managed_by- Type
- string
- Description
New managing tool, or
nullto clear it. Can benull.
Request
curl -X PATCH https://acme.ext.passway.com/v1/api-clients/apc_01jd8k3m2v9x4q7r5t6w8y0z1a \
-H "Authorization: Bearer $PASSWAY_TOKEN" \
-H 'If-Match: "3f9a"' \
-H "Content-Type: application/merge-patch+json" \
-d '{
"labels": {
"old-label": null,
"team": "security"
}
}'
Response
{
"id": "apc_01jd8k3m2v9x4q7r5t6w8y0z1a",
"etag": "3f9a",
"name": "terraform-ci",
"description": "…",
"scopes": [
"…"
],
"workload_audiences": [
"…"
],
"federated_credentials": [
{
"name": "github-main",
"issuer": "https://token.actions.githubusercontent.com",
"subject": "repo:acme/infra:ref:refs/heads/main",
"subject_pattern": "repo:acme/infra:environment:*",
"audience": "https://acme.ext.passway.com",
"claims": {}
}
],
"labels": {
"passway.example/cost-center": "4410",
"team": "facilities"
},
"managed_by": "terraform",
"created_at": "2026-11-30T14:02:11Z",
"updated_at": "2026-11-30T14:02:11Z"
}
Delete an api client
Revokes the client's access tokens. A caller can delete only clients whose scopes it has.
Needs the api-clients:write scope.
Path parameters
- Name
api_client_id- Type
- string
- Description
API client ID:
apc_followed by 1 to 64 lowercase letters and digits.
Headers
- Name
If-Match- Type
- string
- Description
The resource's current
etag, in double quotes. Required.
Request
curl -X DELETE https://acme.ext.passway.com/v1/api-clients/apc_01jd8k3m2v9x4q7r5t6w8y0z1a \
-H "Authorization: Bearer $PASSWAY_TOKEN" \
-H 'If-Match: "3f9a"'
Response
204 Deleted
Rotate an API client's secret
Returns a new secret, which replaces the old one at once and revokes the client's access tokens. A caller can rotate only clients whose scopes it has.
Needs the api-clients:write scope.
Path parameters
- Name
api_client_id- Type
- string
- Description
API client ID:
apc_followed by 1 to 64 lowercase letters and digits.
Headers
- Name
If-Match- Type
- string
- Description
If set, the action only runs if the resource's
etagstill matches.
- Name
Idempotency-Key- Type
- string
- Description
A unique key, such as a UUID. Repeating a successful request with the same key within 24 hours returns the original response; reusing it for a different request returns
422; repeating it while the first is still running returns409withRetry-After.
Request
curl -X POST https://acme.ext.passway.com/v1/api-clients/apc_01jd8k3m2v9x4q7r5t6w8y0z1a:rotate-secret \
-H "Authorization: Bearer $PASSWAY_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"
Response
{
"api_client": {
"id": "apc_01jd8k3m2v9x4q7r5t6w8y0z1a",
"etag": "3f9a",
"name": "terraform-ci",
"description": "…",
"scopes": [
"…"
],
"workload_audiences": [
"…"
],
"federated_credentials": [
{
"name": "github-main",
"issuer": "https://token.actions.githubusercontent.com",
"subject": "repo:acme/infra:ref:refs/heads/main",
"subject_pattern": "repo:acme/infra:environment:*",
"audience": "https://acme.ext.passway.com",
"claims": {}
}
],
"labels": {
"passway.example/cost-center": "4410",
"team": "facilities"
},
"managed_by": "terraform",
"created_at": "2026-11-30T14:02:11Z",
"updated_at": "2026-11-30T14:02:11Z"
},
"client_secret": "pwcs_7Hq2kX9vN4mP8sL3wQ5rT1yU6iO0pA2s"
}