Integrate OpenSequence into your product
The integration checklist: run the server, connect each module, then upsert contacts, enroll them and handle webhooks, one API call per step.
This is the checklist for adding OpenSequence to an existing app. Each line is one call, and each module links to its own page.
OpenSequence ships no UI. Your app keeps its screens and calls the API from your server.
1. Set up once
- Run the server and create a project: Quickstart.
- Install the SDK:
npm install @opensequence/sdk. See the SDK reference. - Register your webhook endpoint and store its secret: Webhooks to your app.
- Connect Allo if you send texts or call tasks: Allo.
- Connect Attio if conditions read your CRM: Attio.
- Connect MCP if an AI agent should build sequences: the MCP server README.
2. For each rep
- Create the sender with your user id, signature and attributes such as a calendar URL: Sender.
await oseq.senders.upsert(user.id, { name, email, timezone, signature_html, attrs: { calendar_url } }); // PUT /v1/senders/{id}- Connect their mailbox: Email (Gmail, Outlook, other SMTP).
await oseq.senders.setSmtp(user.id, { provider: 'smtp', smtp, imap }); // PUT /v1/senders/{id}/channels/email- Connect their Allo number (SMS and calls only).
await oseq.senders.setSms(user.id, { allo_user_id, number }); // PUT /v1/senders/{id}/channels/sms3. Every time your app saves a person
- Upsert the contact by your own id: Contact.
await oseq.contacts.upsert(person.id, { first_name, email, phone, country, timezone, attrs: { plan } }); // PUT /v1/contacts/{id}country is ISO-2. When you have none, take it from the phone number with libphonenumber-js. Texts and agent calls need recorded consent: oseq.contacts.setOutreachConsent() with an admin key.
4. Build and publish a sequence
- Create it, then publish it: Sequence and The definition.
const { sequence, version } = await oseq.sequences.create({ name, definition }); // POST /v1/sequences
await oseq.sequences.versions.publish(sequence.id, version.id); // POST /v1/sequences/{id}/versions/{vid}/publish5. Enroll
- Enroll contacts as a sender and store each
enr_…id.
const { enrollments } = await oseq.sequences.enroll(sequence.id, { contacts: [person.id], sender: user.id }); // POST /v1/sequences/{id}/enrollmentsA contact is in one active sequence at a time. One conflict fails the whole batch with 409 ALREADY_IN_SEQUENCE, and error.details.conflicts names each contact, its sequence and its enrollment. POST /v1/sequences/{id}/enrollments:preview runs the same checks without writing.
6. Handle the events
- Write each webhook into your app, deduped by
event.id.
| Event | Write |
|---|---|
run.done | An outbound activity on the person. |
signal.received with reply or meeting_booked | An inbound activity and a notification to the rep. |
signal.received with bounce or opt_out | A flag on the address or number. |
enrollment.exited, enrollment.completed | The outcome. Clear the "in sequence" badge. |
task.created, task.expired | Add or remove an item in the rep's task list. |
sender.channel_status | A "reconnect your mailbox" banner. |
Report what the service cannot see
- Report meetings, opt-outs and do-not-contact flags that happen outside OpenSequence.
await oseq.contacts.reportEvent(person.id, { id: booking.id, type: 'meeting_booked' }); // POST /v1/contacts/{id}/eventstype is meeting_booked, opt_out, suppressed or reply. The same id twice is recorded once.
7. Exit when the work is done
await oseq.enrollments.exit(enrollmentId, { label: 'deal closed' }); // POST /v1/enrollments/{id}/exit, admin keyScreens to build
- Sequences:
GET /v1/sequencesandGET /v1/analytics/sequences. - Where a contact is:
GET /v1/enrollments/{id}. See Show where a contact is in a sequence. - Senders and mailboxes:
GET /v1/senders/{id}for channels, status and readiness. - Task list:
GET /v1/tasks?sender=…&status=open, thenPOST /v1/tasks/{id}/complete. Each task has akind(call,linkedin_connect, …); alinkedin_connecttask completes itself when you callPOST /v1/tasks/{id}/openas the sender opens its profile (LinkedIn).
Quickstart
How to run the OpenSequence server, create a project, connect a mailbox and enroll a first contact with the TypeScript SDK, then run it on your own Postgres.
Project
What a project is in OpenSequence: one tenant with its own API keys, provider credentials, settings and data, so one install can serve many customers.