Quickstart
Pick what you are building, then either hand the prompt to your coding agent or follow the steps yourself. Everything here runs against a real account. There is no sandbox mode, so use accounts you do not mind posting to or advertising from.
1. Pick what you are building
Each use case has a prompt for your coding agent. It tells the agent which pages to read, the calls to make in order, and where to stop and ask you. Steps 2 and 3 below are the same for every use case; the rest are written out for the one you pick.
Using a coding agent? Give it this prompt.
Using a coding agent? Give it this prompt.
Using a coding agent? Give it this prompt.
Using a coding agent? Give it this prompt.
2. Create an API key
Sign in at /sign-in with Google. Any Google account works, and your
first sign-in creates your account, an organization you own, and a default
profile in it.
Open Settings → API keys in the dashboard sidebar, or go straight to
/settings/api-keys. Give the key a label such as
Local testing and select Create key.
The secret is shown once
Copy it immediately — Adeli stores only a hash and cannot show it to you again. A key belongs to your organization and can act on every profile in it, and deleting a key revokes it instantly.
Save it alongside the base URL:
export ADELI_URL=https://app.tryadeli.com
export ADELI_API_KEY='rk_live_...'Still in the dashboard, open Settings → OAuth and register the exact client
callback your app will send customers back to, such as
https://client.example/callback. For local development, http://localhost and
http://127.0.0.1 are also accepted. See OAuth setup for
production, staging, and browser-return guidance.
3. Install the SDK
On Node.js 22 or later, install the server-side TypeScript SDK. It reads
ADELI_API_KEY from the environment. From any other language, call the REST
API directly: every step below has curl and Python too.
npm install @adeli/sdkOther ways in
To call Adeli from Claude, Cursor, or Codex without writing code, connect the MCP server with the same key. To click through the API first, fork the Postman collection.
Publish posts from your app
Your users connect their Instagram, Facebook, TikTok, YouTube, X, LinkedIn, or Bluesky accounts, and your app publishes to them.
Before you start
- An API key, from step 2.
- An Instagram professional (Business or Creator) account you can post to. TikTok, YouTube, and the rest follow the same shape; the differences are in the Posts reference.
- Nothing else. Connecting accounts past the free plan's allowance returns
402 billing_required; see Pricing.
1. List your profiles, or create one
A profile is one of your customers. Every profile-scoped request names the
profile it acts on, with a profileId or with an accountId that belongs to
it, and nothing defaults to one. This call lists your organization's profiles,
the default first, and confirms the key works. GET /api/v1/accounts is the
organization-wide exception: omit profileId to discover accounts across all
profiles.
curl "$ADELI_URL/api/v1/profiles" \
-H "Authorization: Bearer $ADELI_API_KEY"{
"profiles": [
{
"id": "00000000-0000-4000-8000-000000000001",
"name": "Client A",
"externalId": "customer-123",
"metadata": {},
"isDefault": true,
"createdAt": "2026-09-08T20:00:00.000Z",
"updatedAt": "2026-09-08T20:00:00.000Z"
}
]
}To give a new customer their own profile instead, create one. The optional
Idempotency-Key makes a retry return the same profile rather than a
409 profile_name_conflict:
curl -X POST "$ADELI_URL/api/v1/profiles" \
-H "Authorization: Bearer $ADELI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: customer-123" \
-d '{"name":"Client A","externalId":"customer-123"}'Save the profile's id. The next three calls need it.
export PROFILE_ID=00000000-0000-4000-8000-0000000000012. Start a connection
This returns an authUrl. Open it in your customer's browser — they
authorize Instagram directly with Meta, and Adeli never sees their credentials.
curl -X POST \
"$ADELI_URL/api/v1/profiles/$PROFILE_ID/connect" \
-H "Authorization: Bearer $ADELI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform":"instagram","redirectUrl":"https://client.example/callback"}'{
"id": "00000000-0000-4000-8000-000000000002",
"profileId": "00000000-0000-4000-8000-000000000001",
"platform": "instagram",
"status": "pending_authorization",
"accountId": null,
"expiresAt": "2026-09-08T20:10:00.000Z",
"completedAt": null,
"error": null,
"authUrl": "https://www.instagram.com/oauth/authorize?..."
}redirectUrl must be registered exactly
Register the complete URI under Settings → OAuth for the API key's
organization. Scheme, host, port, path, and fixed query string must match;
another path on the same origin is not accepted. Production URIs use HTTPS,
with HTTP allowed only for localhost and 127.0.0.1. An invalid or
unregistered URI returns 400 invalid_redirect_uri. You can omit
redirectUrl entirely and just poll instead. See OAuth setup.
3. Poll until the connection lands
The session expires ten minutes after it is created. Poll it until status is
one of the three terminal values: connected, failed, or expired.
curl \
"$ADELI_URL/api/v1/profiles/$PROFILE_ID/connect/$CONNECTION_SESSION_ID" \
-H "Authorization: Bearer $ADELI_API_KEY"If you supplied a redirectUrl, the browser comes back to it with
connectionSessionId, status, and — on success — accountId in the query
string. Treat those as a hint for your UI and poll the session for the
authoritative answer.
4. List the connected accounts
curl "$ADELI_URL/api/v1/accounts" \
-H "Authorization: Bearer $ADELI_API_KEY"{
"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",
"connectionStatus": "connected"
}
],
"errors": []
}Use accountId — Adeli's UUID — in every later request. It belongs to exactly
one profile, so a request that passes it needs no profileId. providerId is
informational.
5. Publish an image
Images are sent as base64 and must be JPEG, PNG, or WebP, decoding to no more than 8 MiB. Adeli normalizes them to JPEG before handing them to Instagram.
# Build the request body without putting base64 on the command line.
node -e '
const fs = require("node:fs");
fs.writeFileSync("/tmp/adeli-post.json", JSON.stringify({
platform: "instagram",
accountId: process.env.ACCOUNT_ID,
caption: "Published through Adeli",
image: { contentType: "image/png", base64: fs.readFileSync("./photo.png").toString("base64") },
}));
'
curl -X POST "$ADELI_URL/api/v1/posts" \
-H "Authorization: Bearer $ADELI_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @/tmp/adeli-post.jsonA successful publish returns 201 and the normalized post:
{
"id": "instagram_post_00000000-0000-0000-0000-000000000000_17900000000000000",
"platform": "instagram",
"accountId": "00000000-0000-0000-0000-000000000000",
"profileId": "00000000-0000-4000-8000-000000000001",
"providerId": "17900000000000000",
"caption": "Published through Adeli",
"media": [{ "type": "IMAGE", "url": "https://media.example/staging/key.jpg", "thumbnailUrl": "https://media.example/staging/key.jpg" }],
"permalink": null,
"engagement": { "likes": null, "comments": null },
"publishedAt": "2026-04-01T12:00:00.000Z"
}Pass images instead of image — an array of 2 to 10 — to publish a carousel.
What just happened
POST /api/v1/profilesgave your customer a profile: one per customer, the unit Adeli bills by.POST /api/v1/profiles/{profileId}/connectsent them to Instagram to authorize. Adeli never saw their password, and now holds and refreshes the token.POST /api/v1/postspublished through Adeli's app on each platform, so you needed no Meta app or App Review of your own.
If it fails
A connect with an unregistered redirectUrl fails before the customer leaves
your app:
{
"error": {
"code": "invalid_redirect_uri",
"message": "redirectUrl is not registered for this organization"
}
}Register the exact URI under Settings → OAuth, or leave redirectUrl out
and poll. A session that ends failed carries the reason in error.code. Every
code is in Errors.
Next steps
- Publish to several accounts: one post to every connected account, now or scheduled.
- Media uploads: video, carousels, and files too large for base64.
- OAuth setup: production redirect URIs and the browser return.
- Analytics: what each post did.
Run ads for your customers
Your users connect their Meta, TikTok, or LinkedIn ad account, and your app creates campaigns, keeps them paused until they say go, and reports results.
Before you start
- An API key, from step 2.
- An ad account you control on the network you start with: a Meta ad account and a Facebook Page it advertises as, a TikTok advertiser account, or a LinkedIn ad account and the LinkedIn Page whose posts it sponsors.
- Nothing is spent while you follow this. Adeli creates every campaign
paused (disabled on TikTok, a draft on LinkedIn), and only
Update ad status with
ACTIVEspends.
1. Connect the ad account
Ads use their own connection, separate from the accounts used for posting.
Start one with the network's ads platform and send the customer to the
authUrl, exactly as in Publish posts from your app:
| Network | platform | After authorizing |
|---|---|---|
| Meta (Facebook and Instagram) | meta_ads | The customer chooses the Page their ads run as. |
| TikTok | tiktok_ads | Reaches every advertiser account the customer grants. |
linkedin_ads | Reaches every ad account the customer has a role on. |
curl -X POST "$ADELI_URL/api/v1/profiles/$PROFILE_ID/connect" \
-H "Authorization: Bearer $ADELI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform":"tiktok_ads","redirectUrl":"https://client.example/callback"}'Poll the session until it is connected, and save its accountId as
ADS_ACCOUNT_ID.
2. Pick an ad account
curl "$ADELI_URL/api/v1/ads/accounts?accountId=$ADS_ACCOUNT_ID" \
-H "Authorization: Bearer $ADELI_API_KEY"Meta ad account ids look like act_1234567890; TikTok advertiser ids and
LinkedIn ad account ids are digits. Save the one to advertise from as
AD_ACCOUNT_ID.
3. Create a paused campaign
Create campaign takes a different body per network:
- Meta builds a campaign from an objective, a budget, dates, targeting, and
a new image, video, or carousel ad, or boosts an existing post. With
validateOnly: true, Meta checks the request and nothing is created, so you can repeat it until it passes. - TikTok builds a campaign, ad group, and video ad from a goal, a daily budget, targeting, a video, and an ad identity, all disabled.
- LinkedIn sponsors an existing post by the ad account's own Page, as a draft campaign group, campaign, and creative. LinkedIn reviews the ad only once it is activated.
4. Read the results
curl "$ADELI_URL/api/v1/ads/insights?accountId=$ADS_ACCOUNT_ID&adAccountId=$AD_ACCOUNT_ID" \
-H "Authorization: Bearer $ADELI_API_KEY"Insights cover the last 28 days by default. Pass breakdown to split them by
audience, and level (campaign, ad_group, or ad) on TikTok and LinkedIn.
TikTok reports with a delay of a few hours, and LinkedIn up to a day.
What just happened
- The ads connection authorized Adeli's app on the customer's ad account, so you needed no Meta, TikTok, or LinkedIn developer app or review of your own.
- The paused create, and on Meta the dry run, mean nothing spends until someone
calls Update ad status with
ACTIVE. Put that call behind a confirmation your customer sees.
If it fails
Passing a posting account's accountId instead of the ads connection's returns
404 account_not_found. A profile with more than one ads connection needs
accountId or platform, or returns 400 ambiguous_account. Endpoints that
exist on one network only return 400 unsupported_for_platform on the others.
Every code is in Errors.
Next steps
- Ads overview: Meta, TikTok, and LinkedIn Ads, and what each supports.
- Targeting options: locations, interests, and LinkedIn's professional targeting.
- Lead forms and leads: route new Meta leads into your product.
Answer DMs and comments
A bot in your app answers your users' Instagram, Facebook, and WhatsApp DMs and their Instagram and TikTok comments, including comment-to-DM.
Before you start
- An API key, from step 2.
- An Instagram professional account connected to a profile, with Instagram Login. An Instagram account connected through a Facebook Page sends no comment events.
- A place to deploy an
httpsroute. For local testing, expose your machine through an HTTPS tunnel.
1. Install the adapter
npm install chat @adeli/chat-sdk-adapter @chat-adapter/state-memory2. Add the bot and its webhook route
The Chat SDK quick start has the full bot: a
lib/bot.ts that answers every new DM and comment, and a Next.js route that
hands each delivery to it. The adapter checks every delivery's signature and
answers 200 at once.
3. Register the webhook
Deploy the route, then register it for the three events. Save the secret in
the response as ADELI_WEBHOOK_SECRET; it is shown only once.
curl -X POST "$ADELI_URL/api/v1/webhooks" \
-H "Authorization: Bearer $ADELI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"profileId": "'"$PROFILE_ID"'",
"url": "https://bot.example.com/api/webhooks/adeli",
"events": ["message.created", "message.postback", "comment.created"]
}'4. Turn a comment into a DM
A comment.created event carries the commentId. Reply privately to its
author with a button, and the tap comes back as message.postback:
curl -X POST "$ADELI_URL/api/v1/messages/instagram" \
-H "Authorization: Bearer $ADELI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountId": "'"$ACCOUNT_ID"'",
"recipient": { "commentId": "17966240925214757" },
"text": "Thanks for the comment! Tap below and I will send you the guide.",
"buttons": [{ "type": "postback", "title": "Send it", "payload": "guide-request-42" }]
}'What just happened
- The webhook gave you every new DM and comment on the profile's accounts as a signed event, retried for about nine hours if your route is down.
- The bot replied through Adeli, so you needed no Meta app, App Review, or TikTok developer access of your own.
If it fails
Instagram, Facebook, and WhatsApp accept free text only within 24 hours of the
person's last message. Outside it, a send returns 409 window_closed. A second
private reply to the same comment returns 409 private_reply_already_sent. An
Instagram account connected through a Facebook Page returns
400 unsupported_for_platform for private replies: reconnect it with Instagram.
Next steps
- Chat SDK adapter: threads, buttons, and limits.
- Webhooks: events, signatures, and retries.
- Messages and Comments: read history and moderate.
Migrate from another provider
Move an existing integration with another social media API, such as Ayrshare or Zernio, to Adeli behind one interface, customer by customer.
Before you start
- An API key, from step 2.
- Your codebase's current integration. Nothing in it is deleted until you say so.
- Your customers reconnect their accounts once through Adeli's connect flow. OAuth tokens belong to the app that issued them, so they cannot move between providers.
1. Map the concepts
Most social media APIs share the same shape: a record per end customer, a hosted page where that customer links their accounts, and one call that posts to several of them. Here is where each piece lands in Adeli.
| Your current provider | Adeli |
|---|---|
API key, usually Authorization: Bearer | API key in Authorization: Bearer, from ADELI_API_KEY |
| A profile, user, or workspace per end customer, often addressed with its own key or header | A profile, addressed with profileId, or an accountId that belongs to it |
| A hosted linking page or connect URL | Start connection: an authUrl per platform, back to your registered redirectUrl |
| One post call with a list of platforms or accounts | POST /api/v1/publications with one entry per connected accountId |
| A schedule date | scheduledFor, ISO 8601 with a UTC offset |
| Media URLs | POST /api/v1/media/uploads, or { url } for a public HTTPS video |
| A post id | The publication id, followed at its statusUrl |
| Webhooks for comments and messages | Webhooks for comments, DMs, and button taps |
2. Put one interface in front of the current provider
List the calls your app makes, wrap them in one interface, and make the existing code implement it unchanged. That interface is the only thing the rest of your app talks to.
3. Implement it on Adeli and switch customer by customer
Store each customer's Adeli profile id next to their current provider's id, and pick the provider per customer with a flag. Moving a customer means asking them to connect their accounts once through Adeli, then flipping their flag. Keep the old provider until the last customer has moved.
What just happened
- Nothing changed for customers still on the old provider. Each one moves when they reconnect.
- Adeli bills per profile, one per customer, so your costs follow your customer count. See Pricing.
If it fails
A publication returns 202 as soon as it is accepted, then publishes to every
account in the background. One account can fail while others succeed: read each
account's status and error at the publication's statusUrl, and use
Retry a publication for the ones that
failed.
Next steps
- Publish to several accounts: the endpoint most post calls map to.
- Core concepts: profiles, accounts, and partial responses.
- Compare Adeli with Ayrshare or Zernio: features and pricing side by side.