curl --request POST 'https://api.subtotal.com/link-tokens' \
--header "X-Api-Key: $SUBTOTAL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"customer_id":"customer-example-001","email":"consumer@example.com","expires_in_days":30}'
{
"customer_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"link_token": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Link Token
Create a durable customer-scoped Subtotal Link token
curl --request POST 'https://api.subtotal.com/link-tokens' \
--header "X-Api-Key: $SUBTOTAL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"customer_id":"customer-example-001","email":"consumer@example.com","expires_in_days":30}'
{
"customer_id": "<string>",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z",
"link_token": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}X-Api-Key or an OAuth access token with connections:write. Your client must be active.
X-Subtotal-Idempotency-Key is optional. Include it to return the same token when retrying an identical request. Without it, each successful request creates a new token.
Returns link_token, not a URL or a separate token ID. See Customer Link tokens for URL construction, reuse, and retry behavior.
curl --request POST 'https://api.subtotal.com/link-tokens' \
--header "X-Api-Key: $SUBTOTAL_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"customer_id":"customer-example-001","email":"consumer@example.com","expires_in_days":30}'
Authorizations
Partner OAuth: send Authorization: Bearer <access_token>, an OAuth access token from Subtotal's authorization server with the scope this endpoint needs.
Headers
Body
A unique identifier used to map connections to customer records in external systems.
1 - 64The customer's email address
254The customer's mobile phone number
16Client-defined attribution tags recorded when the connection is created, for grouping connection metrics — e.g. {"campaign": "summer_sweeps", "program": "loyalty"}. Names and values are opaque to Subtotal and are never interpreted. At most 10 tags; names up to 64 characters, values up to 256. Intended for campaign and source metadata — do not put consumer PII in tags.
Show child attributes
Show child attributes
Number of whole days before the link token expires.
1 <= x <= 365