Cancel a connection session
curl --request DELETE \
--url https://api.swapnice.com/v1/connection-sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'DELETE',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.swapnice.com/v1/connection-sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/connection-sessions/{session_id}"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"id": "<string>",
"app_id": "<string>",
"customer_id": "<string>",
"status": "created",
"requested_purposes": [
"account_linking"
],
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"consent_receipt_id": "<string>",
"swapnice_user_id": "<string>"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Connection sessions
Cancel a connection session
Revoke an unused linking session.
DELETE
/
v1
/
connection-sessions
/
{session_id}
Cancel a connection session
curl --request DELETE \
--url https://api.swapnice.com/v1/connection-sessions/{session_id} \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'DELETE',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.swapnice.com/v1/connection-sessions/{session_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/connection-sessions/{session_id}"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"id": "<string>",
"app_id": "<string>",
"customer_id": "<string>",
"status": "created",
"requested_purposes": [
"account_linking"
],
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"consent_receipt_id": "<string>",
"swapnice_user_id": "<string>"
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Revoke an unused linking session.
Requires
connections:write. Create a new session if the user needs to try again.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 - 255Path Parameters
Response
Session canceled or already terminal.
Available options:
created, authorized, completed, expired, revoked Available options:
account_linking, personalization, analytics, support, event_enrichment, profile_resolution, measurement ⌘I