Create a consent receipt
curl --request POST \
--url https://api.swapnice.com/v1/consent-receipts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"customer_id": "<string>",
"purposes": [],
"terms_version": "<string>",
"privacy_policy_version": "<string>",
"connection_session_id": "<string>",
"evidence": {
"ip_address": "<string>",
"user_agent": "<string>",
"locale": "<string>",
"collected_at": "2023-11-07T05:31:56Z"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: '<string>',
purposes: [],
terms_version: '<string>',
privacy_policy_version: '<string>',
connection_session_id: '<string>',
evidence: {
ip_address: '<string>',
user_agent: '<string>',
locale: '<string>',
collected_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.swapnice.com/v1/consent-receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/consent-receipts"
payload = {
"customer_id": "<string>",
"purposes": [],
"terms_version": "<string>",
"privacy_policy_version": "<string>",
"connection_session_id": "<string>",
"evidence": {
"ip_address": "<string>",
"user_agent": "<string>",
"locale": "<string>",
"collected_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"app_id": "<string>",
"customer_id": "<string>",
"purposes": [
{
"purpose": "account_linking",
"status": "granted",
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
],
"terms_version": "<string>",
"privacy_policy_version": "<string>",
"status": "active",
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Consent
Create a consent receipt
Record purpose grants after the user accepts.
POST
/
v1
/
consent-receipts
Create a consent receipt
curl --request POST \
--url https://api.swapnice.com/v1/consent-receipts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"customer_id": "<string>",
"purposes": [],
"terms_version": "<string>",
"privacy_policy_version": "<string>",
"connection_session_id": "<string>",
"evidence": {
"ip_address": "<string>",
"user_agent": "<string>",
"locale": "<string>",
"collected_at": "2023-11-07T05:31:56Z"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: '<string>',
purposes: [],
terms_version: '<string>',
privacy_policy_version: '<string>',
connection_session_id: '<string>',
evidence: {
ip_address: '<string>',
user_agent: '<string>',
locale: '<string>',
collected_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.swapnice.com/v1/consent-receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/consent-receipts"
payload = {
"customer_id": "<string>",
"purposes": [],
"terms_version": "<string>",
"privacy_policy_version": "<string>",
"connection_session_id": "<string>",
"evidence": {
"ip_address": "<string>",
"user_agent": "<string>",
"locale": "<string>",
"collected_at": "2023-11-07T05:31:56Z"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"app_id": "<string>",
"customer_id": "<string>",
"purposes": [
{
"purpose": "account_linking",
"status": "granted",
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}
],
"terms_version": "<string>",
"privacy_policy_version": "<string>",
"status": "active",
"granted_at": "2023-11-07T05:31:56Z",
"revoked_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Record purpose grants after the user accepts.
Events for a purpose are rejected until this exists. Include
terms_version and privacy_policy_version.Authorizations
OAuth 2.1 authorization code with PKCE. Implicit and password flows are unsupported.
Headers
Required for mutating requests. Replays with the same key and payload hash return
the original logical result; replays with a different payload hash return 409.
Required string length:
16 - 255Body
application/json
Minimum array length:
1Available options:
account_linking, personalization, analytics, support, event_enrichment, profile_resolution, measurement Show child attributes
Show child attributes
Response
Consent receipt created.
Show child attributes
Show child attributes
Available options:
active, partially_revoked, revoked ⌘I