Enrol a contact
Enrol a contact into an automation, by contactId or by email within the automation's contact book.
https://app.usenotix.dev/api/v1/automations/{id}/enrollFull access and sending access keys can call this. Key permissions lists the extra rules some calls have.
Enrol a contact into an automation, by contactId or by email within the automation's contact book. The contact's run starts at step 0. When the automation is limited to a segment, a contact who does not match answers 409 NOT_IN_SEGMENT; enrolling by email with a FULL key still adds the address to the contact book. A SENDING key enrols existing contacts only: an email that is not already a contact in the automation's book answers 404 and nothing is created. A contact from another contact book answers 400.
Idempotency
Pass an Idempotency-Key header to make a retry safe for 24 hours. The same key and body answers the original result without sending again, with the response header Idempotent-Replayed: true. The same key with a different body answers 409 NOT_UNIQUE; the same key while the first request is still running answers 409 too, so retry shortly. Keys are scoped to the API key.
Dry run
Send the header Notix-Dry-Run: true to see what the request would do without doing it. The answer is 200 with dryRun: true: who it would reach, what they would see, what it would cost, a verdict (allowed and every reasons it would be refused for) and the limits it would count against. Nothing is sent, charged, reserved or written, and the call is recorded in the audit log as a dry run. A write route that cannot preview answers 400.
Path parameters
Body parameters
An existing contact's id. Provide this or email, not both.
An email address within the journey's contact book. With a FULL key it is created there when it does not already exist; a SENDING key enrols existing contacts only and gets 404 for an unknown address. Provide this or contactId, not both.
Headers
Bearer followed by your API key.
Makes the request safe to retry for 24 hours. Same key and same body answers the original result without running again, with the response header Idempotent-Replayed: true. Same key and a different body answers 409 NOT_UNIQUE; same key while the first request is still running answers 409 too, so retry shortly. Keys are scoped to the API key.
Set to true to preview the request instead of running it. The answer is 200 with dryRun: true: who it would reach, what they would see, what it would cost, whether policy allows it and the limits it counts against. Nothing is sent, charged, reserved or written. A write route that cannot preview answers 400.
Errors
Neither or both of contactId/email were provided, the journey has no contact book for an email enrolment, the journey's contact book no longer exists, the contact book uses double opt-in and the contact has not confirmed, or the journey is DRAFT or ARCHIVED
DOMAIN_PINNED: the key is pinned to one domain and the journey has an email step on another; or FORBIDDEN: the key's approval policy does not allow enrolments (DRAFT_ONLY)
No journey with this id for the calling team, or (SENDING key, email enrolment) no contact with this email in the journey's contact book: a SENDING key enrols existing contacts only and never creates one
The contact already has a run on this journey (NOT_UNIQUE), or the journey is limited to a segment the contact does not match (NOT_IN_SEGMENT)
The key's daily journey enrolment limit or email cap is reached
Every error has the same shape. See all error codes.
curl -X POST "https://app.usenotix.dev/api/v1/automations/<id>/enroll" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contactId": "cly1contact0000abcd",
"email": "user@example.com"
}'
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.automations.enroll("jrn_123", { email: "ada@example.com" });
from notix import Notix
notix = Notix() # reads NOTIX_API_KEY
run, _ = notix.journeys.enroll("jrn_123", {"email": "ada@example.com"})
use Notix\Notix;
$notix = new Notix(getenv('NOTIX_API_KEY'));
$run = $notix->journeys->enroll('jrn_123', ['email' => 'ada@example.com']);
{
"dryRun": true,
"kind": "string",
"verdict": {
"allowed": true,
"reasons": [
"string"
]
},
"checks": [
"string"
]
}