RelayLoading
RelayLoadingHomeDocs
Everything a JULY app calls, in the order it calls it. Nothing here is planned; it is what the hub answers today.
An app talks to the hub over HTTPS with one bearer key and JSON bodies. Base address: https://api.relay.july.ca/v1. Every answer to a call made with a key carries an x-request-id header; quote it when you write to us.
The flow is always the same: create a profile for your user, hand the user a connect link, publish to the accounts they connected, and listen for the result through webhooks. Media is referenced by public address, never uploaded to the hub.
Send the app's key as Authorization: Bearer <key>. Keys start with jc_live_, are shown once when issued, and are kept by the hub only as a hash. Every key has one scope:
full: every endpoint.read: GET endpoints only. Any other method answers 403 forbidden.test: GET endpoints, and POST /v1/posts with dryRun: true (checked, never stored or published). Anything else answers 403 forbidden, and GET /v1/export is refused.A key never expires, or expires 30, 90 or 365 days after it is issued, as the JULY Relay team chooses when it issues the key; an app has at most 10 active keys. An expired key answers 401 unauthorized with a sentence saying so and WWW-Authenticate: Bearer realm="july-relay", error="invalid_token". An unknown or revoked key, or any key of a disabled app, answers 401 unauthorized.
Each app may make 600 calls a minute unless we set another limit for it. Every call made with a valid key counts, errors and 304 answers included, in one window per clock minute. Every answer to such a call carries three headers:
X-RateLimit-Limit: 600 the app's calls per minute
X-RateLimit-Remaining: 412 calls left in this minute
X-RateLimit-Reset: 17 seconds until this minute's window endsOver the limit the hub answers 429 rate_limited with a Retry-After header (the seconds until the window ends) and a sentence that names the limit. More than 60 calls with an invalid key from one address in a minute also answer 429 with Retry-After. When a platform answers 429 during a call, the hub answers 429 rate_limited with the platform's Retry-After, or 60 seconds when it gave none.
When the calls inside one minute reach 75%, then 90%, of the limit, the app gets a tenant.usage_warning webhook (at most once per level per hour) and an email when it gave us a contact address.
Every GET that answers 200 carries a weak ETag. Send it back as If-None-Match and, when nothing changed, the hub answers 304 with no body and the same headers, which makes polling a post's status cheap. GET /v1/export and GET /v1 carry no ETag.
Only POST /v1/profiles and POST /v1/posts honour an Idempotency-Key header (255 characters at most); every other endpoint ignores it. The hub keeps the key for 24 hours with a hash of the method, the path and the raw body. The same key with the same request replays the stored answer with idempotent-replayed: true; the same key with a different request answers 409 idempotency_conflict; the same key while the first request still runs answers 409 conflict with Retry-After: 2. A 5xx or 429 answer releases the key so the request can be sent again.
GET /v1 no key: the self-describing index (scopes, limits, conventions,
webhook events and headers, every endpoint); cached 5 minutes
GET /v1/export full or read key: everything the hub holds for your app, one JSON fileThe export streams one document, july-relay-export-<app id>-<date>.json: exportedAt, appId, a note, then app, apiKeys, profiles, accounts, posts, targets, webhookDeliveries, apiUsage, activity and consoleActivity, then truncated and cutSections. Tokens, key hashes and webhook secrets are never in it, and any field whose name looks like a secret reads [withheld]. Each section stops at 20,000 rows and the whole export at 25 seconds; cutSections names what was cut. Every export is written to your app's audit log.
A profile is one of your users. Create it once with your own user id; the call is safe to repeat and answers 200 when the profile exists. A non-empty title replaces the old one.
POST /v1/profiles
{ "externalUserId": "user_123", "title": "Jordan at Northside" }
201 { "profileKey": "prof_…", "externalUserId": "user_123", "title": "…", "createdAt": "…", "created": true }Ask for a connect link and send the person to it. The link is signed, works once and expires after thirty minutes. It runs the platform's own sign-in and brings the browser back to your redirectUrl with the outcome in the query string.
POST /v1/profiles/{profileKey}/connect-url
{ "platform": "instagram", "redirectUrl": "https://app.example.com/connected", "loginHint": "optional" }
201 { "url": "https://api.relay.july.ca/connect/…", "expiresAt": "2026-10-24T18:30:00Z", "platform": "instagram" }
→ redirectUrl?status=connected|cancelled|error&platform=instagram&accountId=acc_…&message=…Platforms without a sign-in flow (Telegram, email, WhatsApp and SMS through JULY Send, Airbnb and VRBO, Craigslist and Kijiji) show a short hosted form on the same link instead. Redirect targets must be https; an app may restrict them to its own origins. A platform that has no credentials on this hub answers 503 platform_not_configured.
GET /v1/profiles/{profileKey}/accounts
200 [ { "id": "acc_…", "platform": "instagram", "accountName": "…", "handle": "…", "avatarUrl": "…",
"followers": 1200, "profileUrl": "…", "status": "connected", "expiresAt": "…", "connectedAt": "…",
"metadata": {}, "capabilities": { "text": true, "image": true, "video": true, "carousel": true,
"maxImages": 10, "maxVideoSeconds": 900, "maxChars": 2200, "aspectRatios": ["4:5","1:1","1.91:1"],
"boards": [], "locations": [], "privacyLevels": [], "notes": [] }, "lastError": null } ]
DELETE /v1/profiles/{profileKey}/accounts/{id}
200 { "ok": true, "accountId": "acc_…", "platform": "instagram", "remoteRevoked": true }followers and profileUrl are null when a platform does not expose them. Add ?live=0 to skip the live board and location lookups. Deleting an account removes its tokens at once and revokes them at the platform where an endpoint exists.
An email account also lists its JULY Send workspace's contact lists in capabilities.lists and, when JULY Send answers, its templates in capabilities.templates. A WhatsApp account lists the approved templates there, each with params (how many variables a send fills), header (none, text, image, video or document), sendable and a note; a value is null where JULY Send did not say.
POST /v1/posts
{ "profileKey": "prof_…", "accountIds": ["acc_…"], "text": "…", "mediaUrls": ["https://…/photo.jpg"],
"scheduleAt": "2026-10-25T16:00:00Z", "perAccount": { "acc_…": { "boardId": "…" } }, "link": "…", "title": "…", "dryRun": false }
201 { "postId": "post_…", "profileKey": "prof_…", "text": "…", "mediaUrls": [ … ], "link": null, "title": null,
"scheduleAt": null, "createdAt": "…",
"targets": [ { "targetId": "tgt_…", "accountId": "acc_…", "platform": "pinterest", "status": "published",
"externalPostId": "…", "url": "…", "error": null, "errorCode": null, "attempts": 1, "publishedAt": "…",
"nextAttemptAt": null } ] }
GET /v1/posts/{postId} the same shape, current state
DELETE /v1/posts/{postId} cancels queued and waiting targets, deletes published ones where the platform allows
POST /v1/posts/{postId}/targets/{targetId}/confirm assisted channels: the person pressed Publish on the siteA post takes 1 to 20 accounts, text up to 20,000 characters and up to 35 media addresses. With dryRun: true the hub runs every check, answers 200 with validated per target and stores nothing. Target statuses: queued, publishing, published, sent (email, WhatsApp and SMS through JULY Send, with delivery counts), awaiting_user (assisted channels), failed, unknown (the platform call may have gone through; never retried blindly), deleted, cancelled.
perAccount[accountId] accepts text, mediaUrls, title, link, boardId (Pinterest), locationId (Google Business Profile), privacyLevel (TikTok), visibility (YouTube), channelId and unfurl (Slack), disablePreview (Telegram), subreddit, kind, flairId, flairText, nsfw and spoiler (Reddit), pageId (Facebook), instagramAccountId (Instagram), publicProfileId (Snapchat), subject, listId, previewText and templateId (email), listId or recipients, templateId, templateParams and headerParams (WhatsApp), listId or recipients, senderNumber and messageType (SMS), listingId, fields and photosMode (Airbnb and VRBO through Hostaway), price, postalCode, category and city (Craigslist and Kijiji), altText and tags.
recipients takes 1 to 50 phone numbers in E.164 form, such as +16045550123, and senderNumber one number in the same form; messageType is marketing (the default) or transactional; templateParams takes up to 30 values and headerParams one, each a piece of text or, in a send to a contact list, {"attribute": "FIRSTNAME", "fallback": "there"} (FIRSTNAME, LASTNAME, COMPANY or EMAIL). Anything else answers 400 validation_failed. replyTo is still accepted, but email refuses it: JULY Send sends a campaign's replies to the sender's address.
Deleting works on X, LinkedIn, Pinterest, Threads, YouTube, Google Business Profile, Bluesky, Telegram, Reddit, Slack, Facebook and Snapchat Spotlights. Instagram, TikTok, Snapchat Stories, Airbnb, VRBO, Craigslist and Kijiji offer no delete through their API, and a sent email, WhatsApp message or text cannot be recalled; each target in the answer says what happened to it.
Without scheduleAt, or with one less than a minute ahead, the hub publishes inside the request for up to 25 seconds and answers with the real outcome; what is left continues on the scheduler's tick, once a minute. scheduleAt may be up to a year ahead.
A temporary failure is retried, with at most three attempts per target, the first included: the second comes 30 seconds after the first fails and the third 2 minutes after the second, or later when the platform's Retry-After asks for more. Retries wait for the next tick, so a 30-second wait can take up to a minute. When the third attempt fails, the target is failed and you get post.failed. A permanent rejection fails at once. An answer that leaves it unclear whether the post went live makes the target unknown, and the hub never retries it, so a post is never doubled.
A text to named numbers refused for quiet hours waits without spending an attempt. JULY Send refuses a marketing text outside 9 a.m. to 8 p.m. in the recipient's time zone; when that happens before any number of the post was texted, the target goes back to queued with errorCode quiet_hours and nextAttemptAt at the time JULY Send gives for the hours to open, or an hour later when it gives none.
Three channels go through the person's own JULY Send workspace. There is no sign-in: the connect link shows a form where the person pastes a JULY Send API key. A post to any of them ends sent rather than published, the app gets post.sent, and nothing sent can be recalled.
Email needs a key with the campaigns and contacts scopes and a verified sender. Each post is one campaign to one contact list: pass subject (or give the post a title) and a listId from capabilities.lists; previewText and templateId are optional, and a template is sent as designed, with nothing from the post merged into it. JULY Send runs its checks before it sends (a verified sender, consent, the suppression list, the unsubscribe link and the postal address), and a refused check fails the post with JULY Send's own sentence. Text up to 50,000 characters and up to 10 images by public address; no video. Delivery, bounce and unsubscribe counts follow in delivery as JULY Send reports them, when the key had the full scope.
WhatsApp needs a key with the whatsapp scope and the workspace's WhatsApp Business number connected in JULY Send. A post sends one approved template, named by a templateId from capabilities.templates, to a contact list (a listId from capabilities.lists, with a key that also has the campaigns and contacts scopes) or to the 1 to 50 numbers in recipients. templateParams fill the template's variables in order, headerParams fills a text header, and every value must be filled; in a send to a list a value can be each contact's own first name, last name, company or email, with the text a contact without it gets. One image (JPEG or PNG, up to 5 MB) or one MP4 video (up to 16 MB) becomes the template's header. The post's own text, title and link are never sent: the words are the template's.
SMS needs a key with the sms scope and a sender number the carriers approved; when the workspace has several, the connect form asks which one texts come from, and capabilities.senderNumbers lists them all with their status. A post texts its text, with no images or video, to a contact list (a listId from capabilities.lists, with a key that also has the campaigns and contacts scopes; up to 1,530 characters, and {{contact.FIRSTNAME}} and the other merge tags are filled for each person) or to the 1 to 50 US and Canadian numbers in recipients (up to 1,600 characters, one number at a time within 40 seconds), from senderNumber, the number chosen when connecting, or else the workspace's default number. A marketing text (the default messageType) must say how to opt out, for example "Reply STOP to opt out.", and goes out only between 9 a.m. and 8 p.m. in each recipient's time zone (from noon on Sundays); a text to a list is always marketing, and JULY Send holds each person's text until their hours open. A transactional text, to named numbers only, goes at once.
WhatsApp and SMS reach only people whose consent to that channel JULY Send has recorded. A send to a contact list is a JULY Send campaign, like email: its counts follow in delivery as JULY Send reports them, when the key had the full scope. A send to named numbers carries the first counts at once: sent, bounced (failed, or for SMS also refused for another reason or not tried) and optedOut (refused for consent, an opt-out or the suppression list). A send that may have reached a number is never repeated, and no error repeats a phone number.
GET /v1/accounts/{id}/analytics?since=2026-10-01T00:00:00Z&refresh=1
200 [ { "externalPostId": "…", "postId": "post_…", "url": "…", "publishedAt": "…", "fetchedAt": "…",
"impressions": null, "views": 1480, "reach": 902, "likes": 31, "comments": 4, "shares": 2, "clicks": null, "saves": 7 } ]Metrics are refreshed every six hours for thirty days after publishing. A value is null where the platform exposes nothing; the hub never invents a number.
GET /v1/platforms
200 [ { "id": "tiktok", "platform": "tiktok", "name": "TikTok", "displayName": "TikTok", "status": "limited",
"note": "…one sentence for the person…", "configured": true, "supportsDelete": false,
"capabilities": { … }, "text": { "maxChars": 2200 },
"image": { "maxBytes": 20971520, "maxCount": 35, "aspects": ["9:16","1:1","16:9"], "formats": ["jpg","webp"] },
"video": { "maxBytes": 4294967296, "maxSeconds": 600, "minSeconds": 3, "maxCount": 1, "aspects": [ … ], "formats": [ … ] } } ]status is live, limited or coming_soon and the note is written for the person; both change in the console without a deploy, so a Connect page can follow reality. A platform without credentials on this hub reads coming_soon.
Each app registers one https address and receives a secret once. The hub sends one POST per event, and one event per target: a post to three accounts sends three. Events: post.published, post.sent, post.awaiting_user, post.failed, account.connected, account.disconnected, account.expired, account.revoked, tenant.usage_warning and ping.
POST https://app.example.com/relay/webhook
x-july-timestamp: 1761926402
x-july-signature: sha256=HMAC_SHA256(secret, timestamp + "." + rawBody)
x-july-signature-next: sha256=… (only in the 24 hours after a secret rotation)
x-july-event: post.published
x-july-delivery: evt_…
{ "id": "evt_…", "event": "post.published", "createdAt": "2026-10-31T16:00:02.000Z",
"data": { "postId": "post_…", "targetId": "tgt_…", "profileKey": "prof_…", "accountId": "acc_…",
"platform": "instagram", "status": "published", "externalPostId": "…", "url": "https://…",
"publishedAt": "2026-10-31T16:00:01.000Z" } }Every post event carries postId, targetId, profileKey, accountId and platform, then: externalPostId, url and publishedAt for post.published; sentAt and delivery counts for post.sent (null for a campaign to a contact list until JULY Send reports, the first counts at once for WhatsApp and SMS to named numbers); the prepared ad for post.awaiting_user; error and errorCode for post.failed. Account events carry accountId, profileKey, externalUserId, platform, accountName and handle. tenant.usage_warning carries level (75 or 90), callsThisMinute, limitPerMinute and at.
Verify the signature over the raw body, refuse timestamps more than five minutes away, use id to ignore a repeat, and answer 2xx within ten seconds. Redirects are not followed. When we rotate your secret, for 24 hours the previous secret keeps signing x-july-signature and the new one signs x-july-signature-next; afterwards the new secret signs x-july-signature alone. Accept either header and you can switch secrets at any moment.
A failed delivery is tried again after 1, 5, 15 and 30 minutes, then 1, 2, 4 and 6 hours, and stops when the next attempt would fall more than 24 hours after the event. After five deliveries in a row fail their whole retry window, the hub switches the webhook off and tells us; new events are then kept in the delivery log, which we can replay once the address answers again.
{ "error": "A sentence a person can read.", "code": "snake_case_code", "details": [ … ] }
400 validation_failed · 401 unauthorized · 402 platform_tier_required (reserved, not sent today)
403 forbidden · 404 not_found · 409 idempotency_conflict | conflict
422 platform_rejected | media_invalid | account_not_connected · 429 rate_limited (+ Retry-After)
500 internal_error · 503 platform_unavailable (+ Retry-After) | platform_not_configured
503 service_unavailable (+ Retry-After)403 forbidden means the key's scope does not allow the call. 409 conflict means the first request with the same idempotency key is still running, or a confirm reached a target that is not waiting for the person. 503 service_unavailable means the hub cannot reach its database or is missing a setting; try again after Retry-After.
Media addresses must be public https (http only for localhost in development) and, where an app sets one, on its allowlist of hosts. Images up to 30 MB, videos up to 200 MB; JPEG, PNG, WebP, GIF, MP4, MOV and WebM. Every address is fetched and inspected (real format, dimensions, duration) before anything is queued, and each platform's limits are checked up front, so a bad post fails with the real reason instead of a silent crop.
For JULY app teams