Issue an identity-only buyer-agent credential
curl --request POST \
--url https://api.interchange.io/api/v2/buyer-agent-principals/issue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayName": "<string>",
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.interchange.io/api/v2/buyer-agent-principals/issue"
payload = {
"displayName": "<string>",
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
displayName: '<string>',
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.interchange.io/api/v2/buyer-agent-principals/issue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"principal": {
"principalId": "<string>",
"principalKind": "buyer_agent",
"displayName": "<string>",
"lifecycleState": "active",
"authority": {
"advertiserAccountIds": [
"<unknown>"
],
"permissions": [
"<unknown>"
]
},
"canonicalAgentUrl": "<string>",
"access": {
"accessRevision": 4503599627370495,
"advertisers": [
{
"advertiserId": "<string>",
"name": "<string>",
"role": "READ"
}
]
}
},
"credential": {
"clientId": "<string>",
"clientSecret": "<string>",
"tokenEndpoint": "<string>",
"resource": "<string>"
}
},
"error": null
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Buyer Agent Principals
Issue an identity-only buyer-agent credential
Issue a WorkOS M2M credential that authenticates solely as a buyer-agent principal. The authenticated organization administrator supplies a retry key and optional current M2M subject; the service derives the organization, provider client identity, workload lineage, and principal. The issued credential has no advertiser, account, spend, payment, Terms, or action permissions. Replacing a subject preserves a principal only when the durable server-issued workload lineage proves the same customer workload. A same-client secret rotation is separate and does not rebind a principal.
POST
/
buyer-agent-principals
/
issue
Issue an identity-only buyer-agent credential
curl --request POST \
--url https://api.interchange.io/api/v2/buyer-agent-principals/issue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"displayName": "<string>",
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.interchange.io/api/v2/buyer-agent-principals/issue"
payload = {
"displayName": "<string>",
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
displayName: '<string>',
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.interchange.io/api/v2/buyer-agent-principals/issue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"principal": {
"principalId": "<string>",
"principalKind": "buyer_agent",
"displayName": "<string>",
"lifecycleState": "active",
"authority": {
"advertiserAccountIds": [
"<unknown>"
],
"permissions": [
"<unknown>"
]
},
"canonicalAgentUrl": "<string>",
"access": {
"accessRevision": 4503599627370495,
"advertisers": [
{
"advertiserId": "<string>",
"name": "<string>",
"role": "READ"
}
]
}
},
"credential": {
"clientId": "<string>",
"clientSecret": "<string>",
"tokenEndpoint": "<string>",
"resource": "<string>"
}
},
"error": null
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Authorizations
API key or access token
Body
application/json
Issue one identity-only WorkOS M2M credential. No caller-supplied principal, organization, or workload identity is accepted.
Required string length:
1 - 255Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Required string length:
1 - 255