DELETE Disconnect Source
Disconnect a vault, either keeping the identities that came from it or deleting them with it
https://api.anakin.io/v1/wire/identity-sources/{id}Disconnects a source and deletes its stored credential. What happens to the identities that were sourced from it is your choice, and it is the only decision on this page that can't be undone.
Requires an X-API-Key; the source must belong to the authenticated user. Check identities_using first to see what's at stake.
Two behaviours
Keep the identities (default). The identities survive with their source_id cleared. They keep running on their cached session cookies until those expire, then can't refresh — the dashboard shows them as source disconnected. Reconnect and re-bind to restore them.
DELETE /identity-sources/{id}Delete the identities too. The sourced identities are removed along with the source, in one atomic statement. This cannot be undone.
DELETE /identity-sources/{id}/identities
DELETE /identity-sources/{id}?delete_identities=truehttps://api.anakin.io/v1/wire/identity-sources/{id}/identitiesBoth destructive forms do the same thing. Prefer the /identities path: the destructive intent is in the URL, so it can't be reached by a stale link or a copy-pasted query string that lost its flag. The ?delete_identities=true variant is kept for existing callers.
Any value other than exactly
truefordelete_identitiesis treated as false — the safe reading.?delete_identities=1and?delete_identities=TRUEboth keep your identities.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id required | string (UUID) | Identity source ID |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
delete_identities | string | true deletes the sourced identities along with the source. Anything else keeps them. Ignored on the /identities path, which always deletes |
Response
200 OK{ "status": "ok" }Identical for both behaviours. It does not report how many identities were affected — read identities_using before deleting if you need that.
Error Responses
| Code | HTTP | When |
|---|---|---|
NOT_FOUND | 404 | No source with that ID |
FORBIDDEN | 403 | The source belongs to another user |
INTERNAL_ERROR | 500 | The disconnect failed; nothing was deleted |
Code Examples
# keep the identities — they run on cached cookies until those expire
curl https://api.anakin.io/v1/wire/identity-sources/f1e2d3c4-0000-0000-0000-000000000000 \
-X DELETE \
-H "X-API-Key: your_api_key"
# delete the identities too — irreversible
curl https://api.anakin.io/v1/wire/identity-sources/f1e2d3c4-0000-0000-0000-000000000000/identities \
-X DELETE \
-H "X-API-Key: your_api_key"import requests
base = 'https://api.anakin.io/v1/wire/identity-sources'
source_id = 'f1e2d3c4-0000-0000-0000-000000000000'
headers = {'X-API-Key': 'your_api_key'}
# Know the blast radius before deciding.
detail = requests.get(f'{base}/{source_id}', headers=headers).json()
print(f"{detail.get('identities_using', '?')} identities depend on this source")
# Keep them:
requests.delete(f'{base}/{source_id}', headers=headers)
# Or remove them with the source (irreversible):
# requests.delete(f'{base}/{source_id}/identities', headers=headers)const base = `https://api.anakin.io/v1/wire/identity-sources`;
const sourceId = 'f1e2d3c4-0000-0000-0000-000000000000';
const headers = { 'X-API-Key': 'your_api_key' };
// Know the blast radius before deciding.
const detail = await (await fetch(`${base}/${sourceId}`, { headers })).json();
console.log(`${detail.identities_using ?? '?'} identities depend on this source`);
// Keep them:
await fetch(`${base}/${sourceId}`, { method: 'DELETE', headers });
// Or remove them with the source (irreversible):
// await fetch(`${base}/${sourceId}/identities`, { method: 'DELETE', headers });Rate limit
20 requests per minute per user, for both forms.
Related
- GET /v1/wire/identity-sources/{id} —
identities_usingbefore you disconnect - GET /v1/wire/identity-sources/{id}/identities — exactly which identities those are
- PATCH /v1/wire/identity-sources/{id} — rotate instead of disconnecting; bindings survive