Accounts

An account is one provider connection inside a profile. Its accountId is the identifier every other endpoint takes.

GET/api/v1/accountsList accounts

Returns every connected account in your key's profile, sorted by platform and then by id. Uses the aggregate response contract.

Query parameters

platform"instagram" | "tiktok" | "facebook" | "youtube" | "x"
Narrow to one provider.
accountIduuid
Narrow to one connection. An id that is not in your profile returns 404 account_not_found.
profileIduuid
Defaults to your key's profile. Any other value returns 404 profile_not_found.
curl --fail-with-body "$ADELI_URL/api/v1/accounts?platform=instagram" \
-H "Authorization: Bearer $ADELI_API_KEY"
json
{
  "status": "complete",
  "accounts": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "accountId": "00000000-0000-0000-0000-000000000000",
      "profileId": "00000000-0000-4000-8000-000000000001",
      "platform": "instagram",
      "providerId": "17841400000000000",
      "displayName": "@adeli",
      "displayIdentifier": "adeli",
      "authMethod": "instagram_login",
      "connectionStatus": "connected"
    }
  ],
  "errors": []
}

Account fields

accountIduuid
Use this everywhere. id is the same value, kept for clients that expect it.
providerIdstring
Instagram's user id, or TikTok's app-scoped open_id. Informational — do not send it back as an accountId. A TikTok account's open_id changed once, when it reconnected through TikTok API for Business. For YouTube, the channel id (UC…). For X, the user id, which survives a change of username.
displayNamestring
For Instagram, "@" plus the username. For TikTok, the profile display name. For YouTube, the channel title. For X, the account name.
displayIdentifierstring
The Instagram username, or the TikTok username (its open_id for a connection that has not reconnected since the move to TikTok API for Business), or the YouTube channel handle, such as @adeli (its channel id when it has none), or the X username.
authMethod"instagram_login" | "facebook_login"
Instagram only: the login the account was connected with. Reconnecting uses the same one; see Instagram login methods.
connectionStatusstring
connected; expired when an Instagram connection has lapsed or, for Facebook Login, its Page can no longer be reached; reconnect_required when TikTok, Facebook, YouTube, or X needs fresh consent; pending_page_selection when a Facebook connection exists but no Page has been chosen.

Errors — 401 unauthorized, 400 invalid_request, 404 profile_not_found, 404 account_not_found, 502 provider_error.

GET/api/v1/profiles/{profileId}/accountsList a profile's accounts

The same accounts aggregate, scoped by path instead of query. Takes no filters. Useful when your code already has the profile id in hand.

Errors — 401 unauthorized, 400 invalid_request, 404 profile_not_found, 502 database_error.

GET/api/v1/profiles/{profileId}/accounts/{accountId}Get one account

Returns a bare account object — no status, no errors wrapper.

json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "profileId": "00000000-0000-4000-8000-000000000001",
  "platform": "tiktok",
  "providerId": "app-scoped-open-id",
  "displayName": "Creator",
  "displayIdentifier": "creator",
  "connectionStatus": "connected"
}

Errors — 401 unauthorized, 400 invalid_request, 404 profile_not_found, 404 account_not_found, 502 database_error.

An X account adds xCapabilities, its paid background reads; see below.

PATCH/api/v1/profiles/{profileId}/accounts/{accountId}Update an X account's capabilities

Every X read is billed to you (Usage), so the reads that would run in the background on an X account are off until you turn them on: analytics (post metrics and follower counts) and inbox (direct messages). Neither syncs anything yet; the switches are stored so that both features respect them when they arrive. Publishing and deleting always work.

Body

xCapabilitiesobjectRequired
{ analytics?: boolean, inbox?: boolean }, at least one. Fields you leave out keep their value.
json
{ "xCapabilities": { "analytics": true } }

Returns the account with its updated xCapabilities. Turning inbox on needs the dm.read and dm.write permissions, which a connection made today has not granted: that returns 409 reconnect_required with the missing scopes in details.missingScopes.

Errors — 401 unauthorized, 400 invalid_request, 400 unsupported_platform (not an X account), 404 profile_not_found, 404 account_not_found, 409 reconnect_required, 502 database_error.

POST/api/v1/profiles/{profileId}/accounts/refreshRefresh connection tokens

Attempts an OAuth token refresh for every Instagram, TikTok, Facebook, and YouTube connection in the profile. For YouTube it also re-reads the channel's title, avatar, and counts. Takes no body. Each account appears in the response only after its new token and expiry have been written, so a success here means the credential is durable, not merely fetched.

This response is not a list of accounts

It uses the aggregate envelope with the accounts key, but the elements are a different shape — refresh results, not account records. Code that reuses an account parser here will not find displayName or connectionStatus.

json
{
  "status": "partial",
  "accounts": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "accountId": "00000000-0000-0000-0000-000000000000",
      "profileId": "00000000-0000-4000-8000-000000000001",
      "platform": "instagram",
      "refreshed": true,
      "expiresAt": "2026-11-07T12:00:00.000Z"
    }
  ],
  "errors": [
    {
      "platform": "tiktok",
      "accountId": "00000000-0000-0000-0000-000000000001",
      "code": "connection_expired",
      "message": "TikTok requires reconnection"
    }
  ]
}

Per-account error codes: provider_not_configured, connection_expired, account_not_found, provider_error.

Errors — 401 unauthorized, 400 invalid_request, 404 profile_not_found, 502 database_error.

DELETE/api/v1/profiles/{profileId}/accounts/{accountId}Disconnect an account

Deletes Adeli's stored credentials and cached history for that connection. It never deletes the account, its posts, or its messages on the provider.

For TikTok, YouTube, and X, Adeli first tries to revoke the authorization with the provider and then guarantees local deletion either way. X usage already recorded stays on your bill. revocationFailed: true means the local credential is gone but the provider may still list the authorization, and the customer can remove it from their TikTok settings or their Google account permissions.

json
{ "id": "00000000-0000-0000-0000-000000000000", "disconnected": true }
json
{ "id": "00000000-0000-0000-0000-000000000001", "disconnected": true, "revocationFailed": false }

Errors — 401 unauthorized, 400 invalid_request, 404 profile_not_found, 404 account_not_found, 502 database_error.