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_rules

Allow 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

HeaderRequiredValue
AuthorizationYesBearer <admin key>: an Admin API key (sk_admin_...). Inference keys are refused with 403 admin_key_required. See Admin API keys.
syntic-betaYes, while in previewadmin-2026-11-01. Without it the call fails with 400 beta_required. See Versioning.
Content-TypeYesapplication/json
Idempotency-KeyNoUp to 255 characters. Retrying with the same key within 24 hours returns the first result instead of acting twice. See Idempotency.

Path parameters

ParameterTypeDescription
service_account_idstringThe service account id, starting with svcacct_.

Body parameters

ParameterTypeRequiredNotes
issuerstringYesIssuer URL, exactly as it appears in the token’s iss claim.
audiencestringYesUsually https://app.syntic.ai.
conditionsobjectYesUp to 10 claim conditions.
max_token_lifetime_secondsintegerNoDefault 3,600.
statusstringNoenabled (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"
}
FieldTypeDescription
issuerstringMust be a preset issuer or one registered under federation issuers.
audiencestringThe aud the incoming token must carry.
conditionsobjectClaim name to required value. A trailing * matches any suffix. At least one condition is required.
max_token_lifetime_secondsinteger60 to 3,600. Syntic tokens issued under this rule never outlive it.
statusstringenabled or disabled.
last_matched_atstring or nullLast 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:

StatustypecodeWhen
400invalid_request_errorbeta_requiredThe syntic-beta header is missing.
400invalid_request_errorconditions_requiredNo condition besides issuer and audience; such a rule would trust every identity on the provider.
400invalid_request_errorunknown_issuerThe issuer is neither a preset nor registered.
409conflict_errortrust_rule_limit_reachedThe account already has 20 rules.
404not_found_errorservice_account_not_foundNo service account with this id in the organization.
401authentication_errorinvalid_api_keyThe admin key is missing, unknown, revoked or expired.
403permission_erroradmin_key_requiredAn inference key was used.
429rate_limit_errorrate_limitedToo many requests; wait for Retry-After. See Rate-limit headers.
Was this page helpful?