Prerequisites
Before you can trigger a journey execution via HTTP, you need to:- Create a journey in Hellomateo with an HTTP Trigger node
- Define a context schema in the HTTP trigger node (can be empty if no context is needed)
- Publish the journey
Context Schema
The HTTP trigger node allows you to define a context schema that specifies what data must be provided when triggering the journey. This is useful when you want to pass additional information about the event that triggered the journey, such as order details, product information, or any other data that you want to use in the journey. For example, if you want to trigger a journey when a customer makes a purchase, you might define a context schema like this:{}.
Triggering a Journey
To trigger a journey execution, make a POST request to the/journey_execution endpoint:
context field must match the schema defined in the HTTP trigger node (use {} for empty schemas). The contact field uses the same import mechanism as the Contact Import - it will update existing contacts or create new ones based on unique identifiers like email, whatsapp, sms, or external_id.
Successful Response
If the journey execution was triggered successfully, you will receive a202 Accepted response with the following payload:
journey_execution_id to track the execution status via the Hellomateo Web App. The contact_id can be used to query or update the contact via the Contact API.
Error Handling
The endpoint performs validation before starting the journey execution. If validation fails, you will receive an appropriate error response:400 Bad Request - Context Validation Failed
If the provided context does not match the schema defined in the HTTP trigger node:400 Bad Request - Missing Context Schema
If the HTTP trigger node has no context schema defined:404 Not Found - Journey Not Found
If the journey does not exist or is not published:404 Not Found - No HTTP Trigger
If the journey does not have an HTTP trigger node:409 Conflict - Journey Already Active
If the journey does not allow concurrent executions and there is already an active execution for the contact:Discovering HTTP Trigger Journeys via API
You can use the Hellomateo API to discover available journeys and their HTTP trigger nodes programmatically. This is useful for building dynamic integrations or listing available journeys in your application.Finding HTTP Trigger Journeys in a Single Request
Using PostgREST query syntax, you can retrieve all published journey versions with their HTTP trigger nodes and required context schemas in a single API call:- Queries
journey_versiontable and filters forpublished=true - Orders by
versiondescending to get latest versions first - Joins with
journey(inner join to get journey details) - Joins with
journey_nodeand filters forevent_type=http - Returns journey version details with journey info and HTTP trigger node’s
extra_context_schema
Example Response
Querying Individual Tables
You can also query the tables separately for more flexibility:List All Journeys
Get Published Journey Versions
Find HTTP Trigger Nodes
Available Fields
The following fields are available for each table: journey:id- Journey IDname- Journey namekey- Journey key (optional)status- Journey status (draft, active, archived)organisation_id- Organisation ID
id- Version IDjourney_id- Journey IDpublished- Whether this version is publishedversion- Version numberorganisation_id- Organisation ID
id- Node IDjourney_version_id- Journey version IDtype- Node type (trigger, action, etc.)event_type- Event type for trigger nodes (http, manual, etc.)extra_context_schema- Schema for context data required by HTTP triggersname- Node name (optional)organisation_id- Organisation ID
Using Context Data in Your Journey
Once a journey execution is triggered with context data, you can access the context fields in any node within the journey using the expression editor. This allows you to personalize messages, create conditional branches, or use the context data in any other way within your journey.Examples
Updating an Existing Contact
Creating a New Contact
Best Practices
- Use External IDs: Use
external_idto link contacts between your system and Hellomateo for easier synchronization - Keep Schemas Simple: Only include context fields you actually need in the journey
- Handle Errors: Implement proper error handling for all possible response codes
- Async Processing: The 202 response means the execution is queued, not completed
- Publish Before Triggering: Only published journeys can be triggered via the API