Use the API to start an AXL automation from another application, such as your website, CRM, payment service or a script. The request tells AXL which automation to run and for which contact. AXL finds or creates the contact, saves the contact details you send, and runs the automation's steps for that contact: for example, it sends a welcome email and grants access to a course.
The endpoint runs a standalone automation created under Settings → Automations. Automations that belong to a course, product, pipeline, chatbot or webinar cannot be started this way. Use POST whenever your integration supports it; GET is available for tools that can only open a URL.
Create an Automation
Go to Settings → Automations and click Create Automation. Enter a title and a description, then click Create.

The automation opens on the Automation tab. It already contains the Automation Started trigger: this is the step the API request fires. Do not add a second copy of it.

Click the info icon next to How to Run via API. The window shows the request format and this automation's ID in scenarioId. Copy the ID: every request needs it.

Set Up the Automation Steps
Add the actions that should happen for the contact, configure each one, and connect them to Automation Started by drawing a line from the trigger to the first action. In the example below, AXL sends a welcome email and grants access to the Leadership Certificate course.
When the steps are ready, turn on Active. A request for an inactive automation is rejected with the scenarioDisabled error. For the list of actions and their settings, see "Types of Actions in Automations and Their Settings".

Create an API Key
Go to Settings → API Keys and click Create API Key.

- In New API Key, enter a title that names the integration, for example Northstar Enrollment Integration, and click Create.
- Open the key by its title. Turn on the Run Automations permission and click Save. Without this permission every request returns
accessDenied. - Copy the key with the copy icon beside it and store it in your integration's secret settings.
Important: the key works like a password for your account. Keep it on your server or in the integration's secret storage. Do not put it in website code that runs in the visitor's browser, in shared documents or in screenshots.
Request Reference
| Item | Value |
|---|---|
| URL | https://app.axl.tech/api/v1/scenario/run |
| Method | POST (recommended) or GET |
| Authorization header | Authorization: Bearer YOUR_API_KEY: the word Bearer, one space, then the key |
| Body format (POST) | JSON, with the header Content-Type: application/json |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scenarioId | string | Yes | The automation ID from How to Run via API. |
contactId | string | One of the two | The ID of an existing contact. If the contact does not exist, the request fails with studentNotFound. |
contactData.email | string | One of the two | The contact's email. If there is no contactId, AXL looks for a contact with this email and creates a new one if none exists. |
contactData | object | No | Contact details to save on the contact: see the next table. Fields you leave out stay unchanged. |
data | object | No | Values for this run only, such as an order number or amount. They are not saved on the contact. Conditions in the automation can read them (see Pass values to the run). |
Contact fields in contactData
| Field | Format and behavior |
|---|---|
email | A valid email address; an invalid one returns invalidParameter. |
firstName, lastName, middleName | Text. |
phone | Text; use the international format, for example +12025550184. |
country, city | Text. |
timezoneId | Time zone ID, for example America/New_York. An unknown ID returns unknownTimezone. |
birthday | Date in YYYY-MM-DD format, for example 1990-04-15. |
gender | male, female or other. |
comment | Replaces the contact's comment. |
commentAppend | Adds text to the contact's existing comment. |
tags | Array of tag names, for example ["webinar-lead"]. Tags are added; the contact's existing tags stay. |
groups | Array of group names. The contact is added to these groups. |
utmSource, utmMedium, utmCampaign, utmTerm, utmContent | UTM tags of the visit that led to the request. |
| Custom field key | Any other key is treated as a custom contact field, for example "enrollment_source": "Fall webinar". The field must already exist in AXL; an unknown key returns leadAttributeNotFound with the key in target. |
To find a custom field's key, open any contact card in CRM → Contacts, click Manage Custom Attributes and open the field. To create a field, click Create Field and fill in Title, Type and Key. The key may contain Latin letters, numbers and the symbols -, _ and ., without spaces.

Pass values to the run
Use data for values that matter to this run but should not be stored on the contact, such as an order number or a payment amount. Nested objects are allowed. A Condition step can check them with the dynamic data filter, using a dotted path to the value: "data": {"order": {"amount": 149}} is read as order.amount. Send data in a POST request.
Response
The endpoint returns its application result as a JSON body, including application errors with HTTP status 200. Check both the HTTP status and success; an authentication, request or server failure can occur before this application response.
{
"success": true,
"errors": [],
"body": "_3PKP8LF6kGA_mPUvH9LtA"
}
body is the ID of the contact the automation runs for: the existing contact or the one just created. Save it if your system needs to address the same contact later. A successful response means the run has been queued; the automation's steps then run in the background, usually within seconds.
An error response has success: false and the reason in errors[].type (shortened example):
{
"success": false,
"errors": [
{ "type": "scenarioDisabled", "target": null }
]
}
Errors
type | Cause and fix |
|---|---|
accessDenied | The API key does not have the Run Automations permission. Turn it on in Settings → API Keys. |
isRequired | A required parameter is missing: target is ScenarioId, or ContactId when neither contactId nor contactData.email was sent. |
invalidParameter | The email is not a valid address (target: Email) or a custom field entry is malformed (target: Attributes). |
unknownTimezone | timezoneId is not a known time zone ID. |
scenarioNotFound | No standalone automation with this scenarioId exists in the account. Copy the ID again from How to Run via API. |
scenarioDisabled | The automation is inactive. Turn on Active. |
studentNotFound | No contact with this contactId exists in the account. |
leadAttributeNotFound | A custom field key in contactData does not exist; the unknown keys are listed in target. |
Run an Automation with POST
Each example runs the automation for Olivia Bennett, saves her name, phone, a tag and a custom field, and passes an order amount to the run. Replace YOUR_API_KEY and YOUR_AUTOMATION_ID with your values. The email and phone are fictional; use your own test contact.
Important: every successful request starts the automation for real. Its steps may send emails or messages and grant access, so test with your own contact first.
curl
curl -X POST "https://app.axl.tech/api/v1/scenario/run" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scenarioId": "YOUR_AUTOMATION_ID",
"contactData": {
"email": "olivia.bennett@example.com",
"firstName": "Olivia",
"lastName": "Bennett",
"phone": "+12025550184",
"tags": ["webinar-lead"],
"enrollment_source": "Fall webinar"
},
"data": {
"order": { "amount": 149 }
}
}'
JavaScript (Node.js 18+)
const response = await fetch('https://app.axl.tech/api/v1/scenario/run', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.AXL_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
scenarioId: 'YOUR_AUTOMATION_ID',
contactData: {
email: 'olivia.bennett@example.com',
firstName: 'Olivia',
lastName: 'Bennett',
phone: '+12025550184',
tags: ['webinar-lead'],
enrollment_source: 'Fall webinar',
},
data: { order: { amount: 149 } },
}),
});
if (!response.ok) {
throw new Error(`AXL HTTP error: ${response.status}`);
}
const result = await response.json();
if (!result.success) {
throw new Error(`AXL error: ${result.errors.map(e => e.type).join(', ')}`);
}
console.log('Contact ID:', result.body);
Python
import os
import requests
response = requests.post(
"https://app.axl.tech/api/v1/scenario/run",
headers={"Authorization": f"Bearer {os.environ['AXL_API_KEY']}"},
json={
"scenarioId": "YOUR_AUTOMATION_ID",
"contactData": {
"email": "olivia.bennett@example.com",
"firstName": "Olivia",
"lastName": "Bennett",
"phone": "+12025550184",
"tags": ["webinar-lead"],
"enrollment_source": "Fall webinar",
},
"data": {"order": {"amount": 149}},
},
timeout=30,
)
response.raise_for_status()
result = response.json()
if not result["success"]:
raise RuntimeError(f"AXL error: {result['errors']}")
print("Contact ID:", result["body"])
The JavaScript and Python examples read the key from the AXL_API_KEY environment variable, so the key never appears in the code. For an existing contact whose ID you know, send "contactId": "CONTACT_ID" instead of contactData.email; the other contact fields are optional.
Run an Automation with GET
Use GET only when your tool can open a URL but cannot send a POST request with a body. All parameters go into the query string: contact fields get the contactData. prefix, including custom field keys.
| Query parameter | Description |
|---|---|
scenarioId | The automation ID. Required. |
contactId | An existing contact ID, or use contactData.email instead. |
contactData.email, contactData.firstName, contactData.phone, … | Contact fields from the table above, one parameter per field. |
contactData.<key> | A custom field, for example contactData.enrollment_source=Fall%20webinar. |
admin_access_token | The API key without Bearer. Use it only if the tool cannot send the Authorization header. |
With the Authorization header:
curl -G "https://app.axl.tech/api/v1/scenario/run" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "scenarioId=YOUR_AUTOMATION_ID" \
--data-urlencode "contactData.email=olivia.bennett@example.com" \
--data-urlencode "contactData.firstName=Olivia" \
--data-urlencode "contactData.phone=+12025550184"
When the tool can only open a URL:
https://app.axl.tech/api/v1/scenario/run?admin_access_token=YOUR_API_KEY&scenarioId=YOUR_AUTOMATION_ID&contactData.email=olivia.bennett%40example.com&contactData.firstName=Olivia&contactData.phone=%2B12025550184
Encode the values in the URL: %40 stands for @, %2B for + and %20 for a space. Without encoding, the + in a phone number turns into a space.
Important: a URL with admin_access_token contains your key and starts the automation every time it is opened. Servers, proxies and browsers can record URLs in their logs, so never publish such a URL on a website or in a shared document. Prefer the Authorization header whenever the tool supports it.
Check the Result in AXL
- Check
successin the response. On success,bodycontains the contact ID. - Open CRM → Contacts and find the contact by the email you sent.
- Open the contact's Automations tab and find the run of your automation.
- Open History to see which steps ran, and check their results separately: the email in the contact's email history, the course in Access & Products.