curl --request DELETE \
--url https://api.pay.aptahq.com/v1/beneficiaries \
--header 'X-AptaPay-Signature: <api-key>' \
--header 'X-Confirm-Purge: <x-confirm-purge>'const options = {
method: 'DELETE',
headers: {'X-Confirm-Purge': '<x-confirm-purge>', 'X-AptaPay-Signature': '<api-key>'}
};
fetch('https://api.pay.aptahq.com/v1/beneficiaries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pay.aptahq.com/v1/beneficiaries"
headers = {
"X-Confirm-Purge": "<x-confirm-purge>",
"X-AptaPay-Signature": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"code": 200,
"message": "OK",
"data": {
"purged": 3
}
}{
"code": 200,
"message": "OK",
"data": "<unknown>",
"error": {
"code": "payout_rejected_by_provider",
"message": "<string>",
"terminal": true,
"retriable": true,
"ambiguous": true,
"details": {}
}
}{
"code": 200,
"message": "OK",
"data": "<unknown>",
"error": {
"code": "payout_rejected_by_provider",
"message": "<string>",
"terminal": true,
"retriable": true,
"ambiguous": true,
"details": {}
}
}Purge ALL saved beneficiaries for this tenant
Irreversible. Deletes every saved beneficiary for the calling tenant in one call. Requires X-Confirm-Purge to equal the caller’s own app_id exactly — a missing or mismatched header refuses the request with no deletion. Writes one audit_log row carrying the deleted count.
curl --request DELETE \
--url https://api.pay.aptahq.com/v1/beneficiaries \
--header 'X-AptaPay-Signature: <api-key>' \
--header 'X-Confirm-Purge: <x-confirm-purge>'const options = {
method: 'DELETE',
headers: {'X-Confirm-Purge': '<x-confirm-purge>', 'X-AptaPay-Signature': '<api-key>'}
};
fetch('https://api.pay.aptahq.com/v1/beneficiaries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pay.aptahq.com/v1/beneficiaries"
headers = {
"X-Confirm-Purge": "<x-confirm-purge>",
"X-AptaPay-Signature": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text){
"code": 200,
"message": "OK",
"data": {
"purged": 3
}
}{
"code": 200,
"message": "OK",
"data": "<unknown>",
"error": {
"code": "payout_rejected_by_provider",
"message": "<string>",
"terminal": true,
"retriable": true,
"ambiguous": true,
"details": {}
}
}{
"code": 200,
"message": "OK",
"data": "<unknown>",
"error": {
"code": "payout_rejected_by_provider",
"message": "<string>",
"terminal": true,
"retriable": true,
"ambiguous": true,
"details": {}
}
}Authorizations
v1={hex HMAC-SHA256} over the ten-field canonical string. Sent alongside X-AptaPay-Key, X-AptaPay-Timestamp and X-AptaPay-Nonce — all four are required. OpenAPI can only model one header per scheme, so the other three are described in the Authentication section above.
Headers
Must equal the caller's own app_id. In Postman this resolves from the environment variable the signing script already uses, so the request is sendable as-is — the header is a deliberate-intent check, not a secret.
Response
Purge completed.
The single response envelope, used by EVERY endpoint so a consuming app parses one shape everywhere.
200
"OK"
Present on success. Shape varies per endpoint.
Machine-readable error classification. EXACTLY ONE of terminal/retriable/ ambiguous is true. laces_api inferred this from the HTTP status and got it wrong, stranding real money twice (2026-08-15, 2026-08-16). Branch on these booleans, never on the status code:
terminal -> the provider refused. Reverse the debit and tell the user. retriable -> safe to retry with the SAME Idempotency-Key. ambiguous -> the outcome is UNKNOWN. Do NOT reverse. Poll instead.
Show child attributes
Show child attributes