Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.auth.exchangeToken({
grantType: "urn:ietf:params:oauth:grant-type:token-exchange",
subjectToken: "<your platform OIDC token>",
subjectTokenType: "urn:ietf:params:oauth:token-type:jwt",
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.auth.exchange_token(
subject_token="<your platform OIDC token>",
subject_token_type="urn:ietf:params:oauth:token-type:jwt",
)curl --request POST \
--url https://api.useautumn.com/v1/auth.exchange_token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'x-api-version: <x-api-version>' \
--data grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
--data 'subject_token=<your platform OIDC token>' \
--data subject_token_type=urn:ietf:params:oauth:token-type:jwt{
"access_token": "am_wit_...",
"issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "balances:write customers:read"
}
Additional Resources
Exchange Token
Exchanges a workload’s platform OIDC token (GitHub Actions, GCP, AWS, Azure, GitLab, Vercel, Kubernetes or your own issuer) for a short-lived am_wit_ access token, following RFC 8693. The token must match a trust rule in your organization; the access token carries that rule’s scopes. Send it as a form body or JSON; no secret key is needed.
POST
/
v1
/
auth.exchange_token
Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.auth.exchangeToken({
grantType: "urn:ietf:params:oauth:grant-type:token-exchange",
subjectToken: "<your platform OIDC token>",
subjectTokenType: "urn:ietf:params:oauth:token-type:jwt",
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.auth.exchange_token(
subject_token="<your platform OIDC token>",
subject_token_type="urn:ietf:params:oauth:token-type:jwt",
)curl --request POST \
--url https://api.useautumn.com/v1/auth.exchange_token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'x-api-version: <x-api-version>' \
--data grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
--data 'subject_token=<your platform OIDC token>' \
--data subject_token_type=urn:ietf:params:oauth:token-type:jwt{
"access_token": "am_wit_...",
"issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "balances:write customers:read"
}
Body Parameters
Response
{
"access_token": "am_wit_...",
"issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "balances:write customers:read"
}
Body
application/x-www-form-urlencodedapplication/json
Your Autumn workload audience, as shown in Settings → Workload Identity (https://api.useautumn.com/workload/ORG_ID/ENV, where ENV is sandbox or live). Required when the subject token's aud is your own application, as with Azure managed identities.
Required string length:
1 - 500