Skip to content

Disconnect

Stop reading one of an app user's connected apps, and, if you ask, erase what it delivered to their memory.

POST/v2/connections/disconnectTry it in the Playground
Auth
read and write key (project)
Cost
free; never refused for your plan

Disconnects one app of the app user named in X-Alexein-User. Nothing more is read from it, and the sign-in it held is deleted. See Connect your users' apps.

Without forget, memory keeps what the app already delivered. To erase that too, send "forget": true. The answer's forgotten: true means the erasure of what that connection delivered has been asked for and is queued: it is not done when the answer comes, and it completes once erasure by connection is available. Items you added yourself are not touched. To erase the whole app user, use users/delete, which disconnects every app they connected first.

Headers

Authorizationstringrequired

Bearer ax_…, an API key. The key must read and write.

X-Alexein-Userstringrequired

The app user whose app to disconnect. See App users.

X-Request-Idstring

Your id for this request, echoed on the response.

Body

idstringrequired

The connection's id, from connections or the connection_id the person came back with.

forgetboolean

true to erase what this connection delivered from the app user's memory. Default false: memory keeps it.

Response

idstring

The connection disconnected.

statusstring

revoked.

forgottenboolean

true when you asked for forget: the erasure of what it delivered is queued, and completes once erasure by connection is available. false when memory keeps it.

Errors

400bad request

X-Alexein-User is missing or not a usable id.

401unauthorized

The bearer is not a key this service issued.

403forbidden

This API key only reads: ...; a personal key, whose own apps are under My memory › Connectors; or the organisation has been closed in the console.

404not found

no such connection: no connection of this app user has that id. A connection of another app user, project or organisation answers the same.

422invalid

No id, or an unknown field.

429too many requests

Past your organisation's rate limits. Retry after Retry-After seconds. See Limits.

503unavailable

Connecting apps cannot be reached just now. Retry after Retry-After seconds.

Request
curl https://api.alexein.ai/v2/connections/disconnect \
  -H "Authorization: Bearer $ALEXEIN_API_KEY" \
  -H "X-Alexein-User: user_42" \
  -H "Content-Type: application/json" \
  -d '{"id": "6f1c2d9e-4b7a-4e3f-9a51-0c8d2e7b4f13", "forget": true}'
200 OK
{
  "id": "6f1c2d9e-4b7a-4e3f-9a51-0c8d2e7b4f13",
  "status": "revoked",
  "forgotten": true
}