Rotate a buyer-agent API-key credential
curl --request POST \
--url https://api.interchange.io/api/v2/buyer-agent-principals/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "api_key",
"currentServiceTokenId": "<string>"
}
'import requests
url = "https://api.interchange.io/api/v2/buyer-agent-principals/rotate"
payload = {
"type": "api_key",
"currentServiceTokenId": "<string>"
}
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({type: 'api_key', currentServiceTokenId: '<string>'})
};
fetch('https://api.interchange.io/api/v2/buyer-agent-principals/rotate', 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>"
}
},
"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
Rotate a buyer-agent API-key credential
Replace an active buyer-agent API key while preserving its principal only when the service-token records prove a same-customer, same-workload, directly-replacing credential lineage. The request selects credential records but cannot assert identity or lineage. The replacement becomes active and the previous binding is retired atomically; retired credentials cannot be replayed.
POST
/
buyer-agent-principals
/
rotate
Rotate a buyer-agent API-key credential
curl --request POST \
--url https://api.interchange.io/api/v2/buyer-agent-principals/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "api_key",
"currentServiceTokenId": "<string>"
}
'import requests
url = "https://api.interchange.io/api/v2/buyer-agent-principals/rotate"
payload = {
"type": "api_key",
"currentServiceTokenId": "<string>"
}
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({type: 'api_key', currentServiceTokenId: '<string>'})
};
fetch('https://api.interchange.io/api/v2/buyer-agent-principals/rotate', 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>"
}
},
"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
Rotate a registered organization-owned API key. The successor is server-issued with the same workload lineage.