Groupilot Docs

Partner kit

Everything a webinar or CRM platform needs to ship a "Connect my Groupilot" button, push its sequences and get the data back, with copy-ready examples.

For platforms that share customers with Groupilot and want the integration done in an afternoon. The three calls in section 4 are 90 % of it.

1. What you receive from Groupilot

ItemWhat it is for
client_id (gpc_…) and client_secret of your OAuth appThe "Connect my Groupilot" button. The secret is handed over once
Partner key gp_partner_…GET /v1/partner/connections: the accounts connected to your app
Signup link https://app.groupilot.com/signup?partner=<your-slug>Every account created through it is attributed to you, with recurring affiliation, once it authorizes your app. Terms on groupilot.firstpromoter.com
A test accountA Groupilot account with a connected number, to develop and demo without touching a customer

2. What we need from you first

  • The OAuth callback URL (HTTPS) where users come back after consent.
  • The name and the URL shown on the consent page.
  • A technical contact (email) for incidents and contract changes.

Send them to contact@groupilot.com.

3. The "Connect my Groupilot" flow

PKCE pair

import crypto from "node:crypto";

const verifier = crypto.randomBytes(48).toString("base64url");
const challenge = crypto.createHash("sha256").update(verifier).digest("base64url");
const state = crypto.randomBytes(16).toString("base64url");

Store verifier and state in the user's session.

const url = new URL("https://app.groupilot.com/oauth/authorize");
url.search = new URLSearchParams({
  response_type: "code",
  client_id: "gpc_…",
  redirect_uri: "https://yourplatform.com/oauth/groupilot/callback",
  scope: "read write send",
  state,
  code_challenge: challenge,
  code_challenge_method: "S256",
}).toString();

Ask for send only if your platform sends messages for the user, and say so before the button. The user logs in or signs up, picks the WhatsApp account, approves. You get code and state on your callback, or error and error_description.

Exchange the code

const res = await fetch("https://app.groupilot.com/oauth/token", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams({
    grant_type: "authorization_code",
    code,
    code_verifier: verifier,
    redirect_uri: "https://yourplatform.com/oauth/groupilot/callback",
    client_id: "gpc_…",
    client_secret: "…",
  }),
});
const { access_token, refresh_token, expires_in } = await res.json();

Store both tokens against the user. The access token lasts 1 hour, the refresh token 90 days.

Refresh and revoke

POST /oauth/token
grant_type=refresh_token&refresh_token=gp_rt_…&client_id=gpc_…&client_secret=…

The refresh token rotates: store the new pair every time. To disconnect from your side, POST /oauth/revoke with either token: the whole connection is revoked. The user can also remove your app from Settings, Integrations, Connected apps; your calls then return 401.

The same flow in Make or n8n

  1. Authorize: a link in your UI built with the parameters above (generate the PKCE pair with a Crypto node, keep the verifier in a data store keyed by state).
  2. Callback: a Webhook node receives code and state, reads the verifier back.
  3. Token: an HTTP module, POST https://app.groupilot.com/oauth/token, body type form-urlencoded with the five fields of step 3, parse the response, store access_token and refresh_token.
  4. Calls: every HTTP module to https://app.groupilot.com/api/v1/… with the header Authorization = Bearer <access_token>. On a 401, run the refresh module and retry once.

4. The three calls that make 90 % of the integration

Create the event from a webinar

POST /v1/events
Authorization: Bearer gp_at_…
Content-Type: application/json

{
  "name": "Launch webinar",
  "slug": "launch-webinar-2026-11-20",
  "type": "punctual",
  "community": { "days_before": 5 }
}

Then add the date:

POST /v1/events/{event_id}/occurrences
{ "scheduled_at_local": "2026-11-20T20:00" }

For a weekly webinar, create it with "type": "recurring" and "recurrence": { "days": ["sun"], "time": "20:00" } instead: occurrences are generated 16 weeks ahead. Store event_id against your webinar. The slug cannot change later, so build it from a stable id of yours.

Message language

An event has a language field, always returned: fr, en, es, pt-BR, de, it, pl, tr or ro. It sets the language of the date variables in the messages ({J:jour}, {J:date}, {J:mois} and their offsets) and of {date} in the community names. Optional on create, where it defaults to the account's display language. On PATCH /v1/events/{event_id}, changing it renames the active communities of the event.

Change the recurrence

PUT /v1/events/{event_id}/recurrence moves the existing dates like the app does: they keep their community, their members and their smart link, and their pending sends follow. A send whose new time is already past is canceled, never sent late. The response adds moved (dates moved) and pinned (dates moved by hand in the app, left where they are) to added, cancelled and kept. On an account where moving dates is not enabled yet, the dates that change are canceled and recreated, and moved and pinned are absent.

Push the sequence at every save

PUT /v1/sequences/sync
Idempotency-Key: <uuid>

{
  "external_id": "<your webinar id>",
  "name": "Launch webinar",
  "messages": [
    { "external_id": "<your message id 1>", "timing": "J-1 10:00", "type": "text", "text": "Tomorrow {J:jour} at 8 pm, live." },
    { "external_id": "<your message id 2>", "timing": "H-1", "type": "image", "media_url": "https://files.example.com/…", "text": "One hour to go" },
    { "external_id": "<your message id 3>", "timing": "J0 19:55", "type": "text", "text": "We are live: https://…", "ghost_mention": true }
  ],
  "apply_to_pending_jobs": true
}

Call it with the full list every time the user saves in your editor (debounce a few seconds; 10 calls per minute per WhatsApp account). Messages are matched on external_id, so resending never duplicates. Link the sequence once with PUT /v1/events/{event_id}/sequence and { "sequence_id": "<id from the response>" }; later saves update the planned sends by themselves, except the ones already sent or edited by hand. A media is given through media_url: a direct public https link to the file (Groupilot downloads it once and keeps its copy), or the media_url of a file already in your media library, for example after POST /v1/media/import. Full semantics: Sync your sequences.

GET /v1/events/{event_id}

Put smart_link behind your "Join the WhatsApp community" button. It always redirects to the open community of the next occurrence, so you fetch it once. smart_link_destination.reason tells you whether it currently points to a group, to the fallback URL, or nowhere yet (the community is created days_before days ahead).

5. The data loop

  • Webhooks (details): create an endpoint with POST /v1/webhooks for member.joined (mark the lead "WhatsApp OK" with data.member.phone), job.sent and job.failed (show the send status in your UI). Verify X-Groupilot-Signature, answer 2xx within 5 seconds, deduplicate on id.
  • Read statistics (details): GET /v1/jobs/{id}/deliveries returns a reach block per community a few hours after each send: members_at_send, delivered_count, read_count, read_rate.
  • Your connected accounts: GET /v1/partner/connections with Authorization: Bearer gp_partner_… lists every account that authorized your app, with email, WhatsApp account, scopes, signup_via_partner, connected_at, last_used_at and revoked_at.

6. What the API never does

Create a WhatsApp account, show the QR code, add members to a community, send private messages, read members' numbers beyond what member.joined gives. Those stay with the user, in the Groupilot app, with the phone in hand.

The sentence to put in your UI, next to the button:

WhatsApp works by community: your registrants join through a link, there is no one-to-one sending and no phone number is collected by us.

Checklist before going live

  • Callback URL, name, logo and technical contact sent to Groupilot
  • Button tested on the test account, with a refused consent too
  • Refresh handled on 401, revocation handled from both sides
  • sync called with the full message list, external_id stable
  • Media imported through /v1/media/import
  • smart_link displayed on the confirmation page
  • Webhook endpoint created, signature verified, deduplication on id
  • The sentence above in your UI

Nesta página