Create a trust rule
⚠️
Preview — this feature is being built; the design below is the spec.
POST https://app.syntic.ai/v1/organizations/service_accounts/{service_account_id}/trust_rulesAllow tokens from an external identity provider to act as this service account through token exchange. Rules are checked on every exchange; the first enabled rule whose issuer, audience and every condition match wins.
For how this fits into a full workflow, see Workload identity.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <admin key>: an Admin API key (sk_admin_...). Inference keys are refused with 403 admin_key_required. See Admin API keys. |
syntic-beta | Yes, while in preview | admin-2026-11-01. Without it the call fails with 400 beta_required. See Versioning. |
Content-Type | Yes | application/json |
Idempotency-Key | No | Up to 255 characters. Retrying with the same key within 24 hours returns the first result instead of acting twice. See Idempotency. |
Path parameters
| Parameter | Type | Description |
|---|---|---|
service_account_id | string | The service account id, starting with svcacct_. |
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
issuer | string | Yes | Issuer URL, exactly as it appears in the token’s iss claim. |
audience | string | Yes | Usually https://app.syntic.ai. |
conditions | object | Yes | Up to 10 claim conditions. |
max_token_lifetime_seconds | integer | No | Default 3,600. |
status | string | No | enabled (default) or disabled. |
Response
201 Created, Content-Type: application/json
{
"id": "frule_01JCK9M1P3R5T7V9X1Z3",
"type": "trust_rule",
"service_account_id": "svcacct_01JCH7K9M1P3R5T7V9X1",
"issuer": "https://token.actions.githubusercontent.com",
"audience": "https://app.syntic.ai",
"conditions": {
"repository": "acme/billing",
"ref": "refs/heads/main"
},
"max_token_lifetime_seconds": 900,
"status": "enabled",
"last_matched_at": null,
"created_at": "2026-10-20T09:05:00Z"
}| Field | Type | Description |
|---|---|---|
issuer | string | Must be a preset issuer or one registered under federation issuers. |
audience | string | The aud the incoming token must carry. |
conditions | object | Claim name to required value. A trailing * matches any suffix. At least one condition is required. |
max_token_lifetime_seconds | integer | 60 to 3,600. Syntic tokens issued under this rule never outlive it. |
status | string | enabled or disabled. |
last_matched_at | string or null | Last successful exchange under this rule. |
Examples
curl -sS "https://app.syntic.ai/v1/organizations/service_accounts/svcacct_01JCH7K9M1P3R5T7V9X1/trust_rules" \
-H "Authorization: Bearer $SYNTIC_ADMIN_KEY" \
-H "syntic-beta: admin-2026-11-01" \
-H "Idempotency-Key: 8d6f0c1e-4b2a-4a57-9f0e-2f1d3c4b5a69" \
-H "Content-Type: application/json" \
-d '{
"issuer": "https://token.actions.githubusercontent.com",
"audience": "https://app.syntic.ai",
"conditions": {
"repository": "acme/billing",
"ref": "refs/heads/main"
},
"max_token_lifetime_seconds": 900
}'Errors
Errors use the error envelope and carry a request_id. Codes specific to this operation:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 400 | invalid_request_error | conditions_required | No condition besides issuer and audience; such a rule would trust every identity on the provider. |
| 400 | invalid_request_error | unknown_issuer | The issuer is neither a preset nor registered. |
| 409 | conflict_error | trust_rule_limit_reached | The account already has 20 rules. |
| 404 | not_found_error | service_account_not_found | No service account with this id in the organization. |
| 401 | authentication_error | invalid_api_key | The admin key is missing, unknown, revoked or expired. |
| 403 | permission_error | admin_key_required | An inference key was used. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Was this page helpful?