Sessions

Triggers

Triggers start a new session with the flow engine. They describe why the session is being started and provide parameters which can be accessed in expressions.

call

Is used to trigger a session for a new incoming or missed call

{
    "type": "call",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "call_received",
        "created_on": "2006-01-02T15:04:05Z",
        "call": {
            "uuid": "0198ce92-ff2f-7b07-b158-b21ab168ebba",
            "channel": {
                "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
                "name": "Twilio"
            },
            "urn": "tel:+12065551212"
        }
    },
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    },
    "triggered_on": "2000-01-01T00:00:00Z"
}

campaign

Is used when a session was triggered by a campaign.

{
    "type": "campaign",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "campaign_fired",
        "created_on": "2006-01-02T15:04:05Z",
        "campaign": {
            "uuid": "58e9b092-fe42-4173-876c-ff45a14a24fe",
            "name": "Reminders"
        },
        "point_uuid": "34d16dbd-476d-4b77-bac3-9f3d597848cc"
    },
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    },
    "triggered_on": "2000-01-01T00:00:00Z"
}

channel

Is used when a session was triggered by a channel event

{
    "type": "channel",
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    },
    "triggered_on": "2000-01-01T00:00:00Z",
    "event": {
        "type": "new_conversation",
        "channel": {
            "uuid": "58e9b092-fe42-4173-876c-ff45a14a24fe",
            "name": "Facebook"
        }
    }
}

chat

Is used when a session was triggered by a chat started event

{
    "type": "chat",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "chat_started",
        "created_on": "2006-01-02T15:04:05Z",
        "channel": null
    },
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    },
    "triggered_on": "2000-01-01T00:00:00Z"
}

flow_action

Is used when another session triggered this run using a trigger_flow action.

{
    "type": "flow_action",
    "flow": {
        "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
        "name": "Collect Age"
    },
    "history": {
        "parent_uuid": "a5b25fb0-75fd-4898-a34f-5ff14fc19078",
        "ancestors": 3,
        "ancestors_since_input": 1
    },
    "triggered_on": "2000-01-01T00:00:00Z",
    "run_summary": {
        "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
        "flow": {
            "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
            "name": "Registration"
        },
        "contact": {
            "uuid": "c59b0033-e748-4240-9d4c-e85eb6800151",
            "name": "Bob",
            "status": "active",
            "fields": {
                "gender": {
                    "text": "Male"
                }
            },
            "created_on": "2018-01-01T12:00:00.000000000-00:00"
        },
        "status": "active",
        "results": {
            "age": {
                "result_name": "Age",
                "value": "33",
                "node": "cd2be8c4-59bc-453c-8777-dec9a80043b8",
                "created_on": "2018-01-01T12:00:00.000000000-00:00"
            }
        }
    }
}

manual

Is used when a session was triggered manually by a user

{
    "type": "manual",
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    },
    "triggered_on": "2000-01-01T00:00:00Z",
    "user": {
        "uuid": "0c78ef47-7d56-44d8-8f57-96e0f30e8f44",
        "name": "Bob"
    },
    "origin": "ui"
}

msg

Is used when a session was triggered by a message being received by the caller

{
    "type": "msg",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "msg_received",
        "created_on": "2006-01-02T15:04:05Z",
        "msg": {
            "urn": "tel:+12065551212",
            "channel": {
                "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
                "name": "Twilio"
            },
            "text": "hi there",
            "attachments": [
                "https://s3.amazon.com/mybucket/attachment.jpg"
            ]
        }
    },
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    },
    "triggered_on": "2000-01-01T00:00:00Z",
    "keyword_match": {
        "type": "first_word",
        "keyword": "start"
    }
}

ticket

Is used when a session was triggered by a ticket event (for now only closed events).

{
    "type": "ticket",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "ticket_closed",
        "created_on": "2006-01-02T15:04:05Z",
        "ticket_uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2"
    },
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    },
    "triggered_on": "2000-01-01T00:00:00Z",
    "ticket": {
        "uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2",
        "status": "open",
        "topic": {
            "uuid": "472a7a73-96cb-4736-b567-056d987cc5b4",
            "name": "Weather"
        }
    }
}

Resumes

Resumes resume an existing session with the flow engine and describe why the session is being resumed.

dial

Is used when a session is resumed after a number was dialed.

{
    "type": "dial",
    "resumed_on": "2021-01-20T12:18:30Z",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "dial_ended",
        "created_on": "2019-01-02T15:04:05Z",
        "dial": {
            "status": "answered",
            "duration": 10
        }
    }
}

msg

Is used when a session is resumed with a new message from the contact

{
    "type": "msg",
    "resumed_on": "2000-01-01T00:00:00Z",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "msg_received",
        "created_on": "2006-01-02T15:04:05Z",
        "msg": {
            "urn": "tel:+12065551212",
            "channel": {
                "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
                "name": "Twilio"
            },
            "text": "hi there",
            "attachments": [
                "https://s3.amazon.com/mybucket/attachment.jpg"
            ]
        }
    }
}

wait_expiration

Is used when a session is resumed because the waiting run has expired

{
    "type": "wait_expiration",
    "resumed_on": "2000-01-01T00:00:00Z",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "wait_expired",
        "created_on": "2006-01-02T15:04:05Z"
    }
}

wait_timeout

Is used when a session is resumed because a wait has timed out

{
    "type": "wait_timeout",
    "resumed_on": "2000-01-01T00:00:00Z",
    "event": {
        "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
        "type": "wait_timed_out",
        "created_on": "2006-01-02T15:04:05Z"
    }
}

Events

Events are the output of a flow run and represent instructions to the engine container on what actions should be taken due to the flow execution. All templates in events have been evaluated and can be used to create concrete messages, contact updates, emails etc by the container.

airtime_created

Events are created when a transfer_airtime action successfully initiates an airtime transfer. The final outcome of the transfer is determined out of band by the host. external_id carries the provider’s transaction id when it’s known at initiation time, otherwise it’s empty.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "airtime_created",
    "created_on": "2006-01-02T15:04:05Z",
    "external_id": "2237512891",
    "sender": "tel:4748",
    "recipient": "tel:+1242563637",
    "currency": "RWF",
    "amount": 100,
    "http_logs": [
        {
            "url": "https://dvs-api.dtone.com/v1/lookup/mobile-number",
            "request": "POST /v1/lookup/mobile-number HTTP/1.1\r\n\r\n{}",
            "response": "HTTP/1.1 200 OK\r\n\r\n{}",
            "elapsed_ms": 123,
            "retries": 0,
            "sizes": {
                "request": 47,
                "response": 23
            },
            "status": "success",
            "created_on": "2006-01-02T15:04:05Z"
        }
    ]
}

broadcast_created

Events are created when a message is being broadcast to contacts besides the session contact.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "broadcast_created",
    "created_on": "2006-01-02T15:04:05Z",
    "translations": {
        "eng": {
            "text": "hi, what's up",
            "quick_replies": [
                {
                    "type": "text",
                    "text": "All good"
                },
                {
                    "type": "text",
                    "text": "Got 99 problems"
                }
            ]
        },
        "spa": {
            "text": "Que pasa",
            "quick_replies": [
                {
                    "type": "text",
                    "text": "Todo bien"
                },
                {
                    "type": "text",
                    "text": "Tengo 99 problemas"
                }
            ]
        }
    },
    "base_language": "eng",
    "contacts": [
        {
            "uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a",
            "name": "Bob"
        }
    ],
    "urns": [
        "tel:+12065551212"
    ],
    "template": {
        "uuid": "3ce100b7-a734-4b4e-891b-350b1279ade2",
        "name": "revive_issue"
    },
    "template_variables": [
        "Ryan Lewis",
        "boy"
    ]
}

call_created

Events are created when an outgoing call is created.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "call_created",
    "created_on": "2019-01-02T15:04:05Z",
    "call": {
        "uuid": "0198ce92-ff2f-7b07-b158-b21ab168ebba",
        "channel": {
            "uuid": "2e2b43c7-88e9-43d6-b291-ebf9a24c2f86",
            "name": "Twilio"
        },
        "urn": "tel:+1234567890"
    }
}

call_missed

Events are created when an incoming call is missed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "call_missed",
    "created_on": "2019-01-02T15:04:05Z",
    "channel": {
        "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
        "name": "Android"
    }
}

call_received

Events are created when an incoming call is received.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "call_received",
    "created_on": "2019-01-02T15:04:05Z",
    "call": {
        "uuid": "0198ce92-ff2f-7b07-b158-b21ab168ebba",
        "channel": {
            "uuid": "2e2b43c7-88e9-43d6-b291-ebf9a24c2f86",
            "name": "Twilio"
        },
        "urn": "tel:+1234567890"
    }
}

campaign_fired

Events are created when a campaign point has fired for the contact.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "campaign_fired",
    "created_on": "2006-01-02T15:04:05Z",
    "campaign": {
        "uuid": "58e9b092-fe42-4173-876c-ff45a14a24fe",
        "name": "Reminders"
    },
    "point_uuid": "77410ef5-1b3d-4571-b8c3-a692b07d2d09"
}

chat_started

Events are created when a contact initiates a chat session. Some channel types have a concept of referrals and that information will be passed via params.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "chat_started",
    "created_on": "2019-01-02T15:04:05Z",
    "channel": {
        "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
        "name": "Facebook"
    },
    "params": {
        "referrer_id": "acme"
    }
}

contact_field_changed

Events are created when a field value of the contact has been changed. A null value indicates that the field value has been cleared.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_field_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "field": {
        "key": "gender",
        "name": "Gender"
    },
    "value": {
        "text": "Male"
    }
}

contact_flow_changed

Events are created when the current flow of the contact has been changed - i.e. the flow in which the contact is currently waiting. The flow will be null if the contact is no longer in a flow.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_flow_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "flow": {
        "uuid": "50c3706e-fedb-42c0-8eab-dda3335714b7",
        "name": "Registration"
    }
}

contact_groups_changed

Events are created when a contact is added or removed to/from one or more groups.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_groups_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "groups_added": [
        {
            "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
            "name": "Reporters"
        }
    ],
    "groups_removed": [
        {
            "uuid": "1e1ce1e1-9288-4504-869e-022d1003c72a",
            "name": "Customers"
        }
    ]
}

contact_language_changed

Events are created when the language of the contact has been changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_language_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "language": "eng"
}

contact_last_seen_changed

Events are created when the last seen date of the contact has been changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_last_seen_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "last_seen_on": "2026-02-03T15:04:05Z"
}

contact_name_changed

Events are created when the name of the contact has been changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_name_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "name": "Bob Smith"
}

contact_status_changed

Events are created when the status of the contact has been changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_status_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "status": "blocked"
}

contact_timezone_changed

Events are created when the timezone of the contact has been changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_timezone_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "timezone": "Africa/Kigali"
}

contact_urns_changed

Events are created when a contact’s URNs have changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "contact_urns_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "urns": [
        "tel:+12345678900",
        "twitter:bob"
    ]
}

dial_ended

Events are created when a session is resumed after waiting for a dial.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "dial_ended",
    "created_on": "2019-01-02T15:04:05Z",
    "dial": {
        "status": "answered",
        "duration": 10
    }
}

dial_wait

Events are created when a flow pauses waiting for an IVR dial to complete.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "dial_wait",
    "created_on": "2019-01-02T15:04:05Z",
    "urn": "tel:+593979123456",
    "dial_limit_seconds": 60,
    "call_limit_seconds": 120,
    "expires_on": "2022-02-02T13:27:30Z"
}

email_sent

Events are created when an action has sent an email.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "email_sent",
    "created_on": "2006-01-02T15:04:05Z",
    "to": [
        "foo@bar.com"
    ],
    "subject": "Your activation token",
    "body": "Your activation token is AAFFKKEE"
}

error

Events are created when an error occurs during flow execution. Some errors have a code which identifies the type of error, and extra values with more details.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "error",
    "created_on": "2006-01-02T15:04:05Z",
    "text": "invalid date format: '12th of October'"
}

failure

Events are created when an error occurs during flow execution which prevents continuation of the session.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "failure",
    "created_on": "2006-01-02T15:04:05Z",
    "text": "unable to read flow"
}

input_labels_added

Events are created when an action wants to add labels to the current input.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "input_labels_added",
    "created_on": "2006-01-02T15:04:05Z",
    "input_uuid": "4aef4050-1895-4c80-999a-70368317a4f5",
    "labels": [
        {
            "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
            "name": "Spam"
        }
    ]
}

ivr_created

Events are created when an action wants to send an IVR response to the current contact.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "ivr_created",
    "created_on": "2006-01-02T15:04:05Z",
    "msg": {
        "urn": "tel:+12065551212",
        "channel": {
            "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
            "name": "Twilio"
        },
        "text": "hi there",
        "attachments": [
            "audio:https://s3.amazon.com/mybucket/attachment.m4a"
        ],
        "locale": "eng-US"
    }
}

llm_called

Events are created when an LLM is called.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "llm_called",
    "created_on": "2006-01-02T15:04:05Z",
    "llm": {
        "uuid": "14115c03-b4c5-49e2-b9ac-390c43e9d7ce",
        "name": "GPT-4"
    },
    "instructions": "Categorize the following text as Positive or Negative",
    "input": "Please stop messaging me",
    "output": "Positive",
    "tokens": {
        "input": 234,
        "output": 333
    },
    "elapsed_ms": 123
}

msg_created

Events are created when an action wants to send a reply to the current contact.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "msg_created",
    "created_on": "2006-01-02T15:04:05Z",
    "msg": {
        "urn": "tel:+12065551212",
        "channel": {
            "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
            "name": "Twilio"
        },
        "text": "hi there",
        "attachments": [
            "image/jpeg:https://s3.amazon.com/mybucket/attachment.jpg"
        ]
    }
}

msg_deleted

Events describe the deletion of an incoming message.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "msg_deleted",
    "created_on": "2006-01-02T15:04:05Z",
    "msg_uuid": "2d611e17-fb22-457f-b802-b8f7ec5cda5b"
}

msg_received

Events are sent by the caller to tell the engine that a message was received from the contact and that it should try to resume the session.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "msg_received",
    "created_on": "2006-01-02T15:04:05Z",
    "msg": {
        "urn": "tel:+12065551212",
        "channel": {
            "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
            "name": "Twilio"
        },
        "text": "hi there",
        "attachments": [
            "https://s3.amazon.com/mybucket/attachment.jpg"
        ]
    }
}

msg_status_changed

Events describe an outgoing message status change.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "msg_status_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "msg_uuid": "2d611e17-fb22-457f-b802-b8f7ec5cda5b",
    "status": "delivered"
}

msg_wait

Events are created when a flow pauses waiting for a response from a contact. If a timeout is set, the caller should resume the session after that many seconds if no message has been received.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "msg_wait",
    "created_on": "2022-01-03T13:27:30Z",
    "timeout_seconds": 300,
    "expires_on": "2022-02-02T13:27:30Z",
    "hint": {
        "type": "image"
    }
}

optin_started

Events are created when a contact has opted-in.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "optin_started",
    "created_on": "2006-01-02T15:04:05Z",
    "optin": {
        "uuid": "248be71d-78e9-4d71-a6c4-9981d369e5cb",
        "name": "Joke Of The Day"
    },
    "channel": {
        "uuid": "4bb288a0-7fca-4da1-abe8-59a593aff648",
        "name": "Facebook"
    }
}

optin_stopped

Events are created when a contact has opted-out.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "optin_stopped",
    "created_on": "2006-01-02T15:04:05Z",
    "optin": {
        "uuid": "248be71d-78e9-4d71-a6c4-9981d369e5cb",
        "name": "Joke Of The Day"
    },
    "channel": {
        "uuid": "4bb288a0-7fca-4da1-abe8-59a593aff648",
        "name": "Facebook"
    }
}

resthook_called

Events are created when a resthook is called. The event contains the payload that will be sent to any subscribers of that resthook. Note that this event is created regardless of whether there are any subscribers for that resthook.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "resthook_called",
    "created_on": "2006-01-02T15:04:05Z",
    "resthook": "success",
    "payload": {
        "contact:": {
            "name": "Bob"
        }
    }
}

run_ended

Events are created when a run ends.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "run_ended",
    "created_on": "2006-01-02T15:04:05Z",
    "run_uuid": "0198bf2d-a96d-7d36-8a4f-154eecc0d798",
    "flow": {
        "uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a",
        "name": "Registration"
    },
    "status": "completed"
}

run_result_changed

Events are created when a run result is changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "run_result_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "name": "Gender",
    "value": "m",
    "category": "Male"
}

run_started

Events are created when a new run is started - either the session’s initial run, or a sub-flow run started by an enter_flow action.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "run_started",
    "created_on": "2006-01-02T15:04:05Z",
    "flow": {
        "uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a",
        "name": "Registration"
    },
    "run_uuid": "0198bf2d-a96d-7d36-8a4f-154eecc0d798",
    "parent_uuid": "95eb96df-461b-4668-b168-727f8ceb13dd"
}

session_triggered

Events are created when an action wants to start other contacts in a flow. It’s the responsibility of the caller to act on the event by initiating new sessions with the flow engine.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "session_triggered",
    "created_on": "2006-01-02T15:04:05Z",
    "flow": {
        "uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a",
        "name": "Registration"
    },
    "groups": [
        {
            "uuid": "8f8e2cae-3c8d-4dce-9c4b-19514437e427",
            "name": "New contacts"
        }
    ],
    "exclusions": {},
    "run_summary": {
        "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
        "flow": {
            "uuid": "93c554a1-b90d-4892-b029-a2a87dec9b87",
            "name": "Other Flow"
        },
        "contact": {
            "uuid": "c59b0033-e748-4240-9d4c-e85eb6800151",
            "name": "Bob",
            "fields": {
                "state": {
                    "value": "Azuay",
                    "created_on": "2000-01-01T00:00:00.000000000-00:00"
                }
            }
        },
        "results": {
            "age": {
                "name": "Age",
                "value": "33",
                "node_uuid": "cd2be8c4-59bc-453c-8777-dec9a80043b8",
                "created_on": "2000-01-01T00:00:00.000000000-00:00"
            }
        }
    },
    "history": {
        "parent_uuid": "55105da5-abb5-4690-b1f6-ec2e5762a561",
        "ancestors": 3,
        "ancestors_since_input": 1
    }
}

ticket_assignee_changed

Events are created when a ticket is assigned or unassigned.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "ticket_assignee_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "ticket_uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2",
    "assignee": {
        "uuid": "0c78ef47-7d56-44d8-8f57-96e0f30e8f44",
        "name": "Bob"
    }
}

ticket_closed

Events are created when a ticket is closed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "ticket_closed",
    "created_on": "2006-01-02T15:04:05Z",
    "ticket_uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2"
}

ticket_note_added

Events are created when a note is added to a ticket.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "ticket_note_added",
    "created_on": "2006-01-02T15:04:05Z",
    "ticket_uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2",
    "note": "This looks important!"
}

ticket_opened

Events are created when a new ticket is opened.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "ticket_opened",
    "created_on": "2006-01-02T15:04:05Z",
    "ticket": {
        "uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2",
        "status": "open",
        "topic": {
            "uuid": "add17edf-0b6e-4311-bcd7-a64b2a459157",
            "name": "Weather"
        },
        "assignee": {
            "uuid": "0c78ef47-7d56-44d8-8f57-96e0f30e8f44",
            "name": "Bob"
        }
    }
}

ticket_reopened

Events are created when a ticket is reopened.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "ticket_reopened",
    "created_on": "2006-01-02T15:04:05Z",
    "ticket_uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2"
}

ticket_topic_changed

Events are created when a ticket’s topic is changed.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "ticket_topic_changed",
    "created_on": "2006-01-02T15:04:05Z",
    "ticket_uuid": "019905d4-5f7b-71b8-bcb8-6a68de2d91d2",
    "topic": {
        "uuid": "add17edf-0b6e-4311-bcd7-a64b2a459157",
        "name": "Weather"
    }
}

typing_started

Events are created when the contact (direction of incoming) or a user (direction of outgoing) starts typing. The optional channel, urn and msg_external_id fields identify where the contact last wrote from - the source of incoming typing and the destination of outgoing typing.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "typing_started",
    "created_on": "2019-01-02T15:04:05Z",
    "direction": "incoming",
    "channel": {
        "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
        "name": "Facebook"
    },
    "urn": "tel:+12065551212",
    "msg_external_id": "EX12345"
}

typing_stopped

Events are created when the contact (direction of incoming) or a user (direction of outgoing) stops typing. The optional channel, urn and msg_external_id fields identify where the contact last wrote from - the source of incoming typing and the destination of outgoing typing.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "typing_stopped",
    "created_on": "2019-01-02T15:04:05Z",
    "direction": "incoming",
    "channel": {
        "uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf",
        "name": "Facebook"
    },
    "urn": "tel:+12065551212",
    "msg_external_id": "EX12345"
}

wait_expired

Events are sent by the caller to tell the engine that a wait has expired.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "wait_expired",
    "created_on": "2006-01-02T15:04:05Z"
}

wait_timed_out

Events are sent by the caller when a wait has timed out - i.e. they are sent instead of the item that the wait was waiting for.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "wait_timed_out",
    "created_on": "2006-01-02T15:04:05Z"
}

warning

Events are created for things like accessing deprecated context values. Some warnings have a code which identifies the type of warning, and extra values with more details.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "warning",
    "created_on": "2006-01-02T15:04:05Z",
    "text": "@legacy_extra is deprecated",
    "code": "context:deprecated"
}

webhook_called

Events are created for each webhook or resthook subscriber call. The event contains the URL and the status of the response, as well as the request and response - trimmed to 10000 characters each for persistence, with sizes recording their original sizes.

{
    "uuid": "0197b335-6ded-79a4-95a6-3af85b57f108",
    "type": "webhook_called",
    "created_on": "2006-01-02T15:04:05Z",
    "url": "http://localhost:49998/?cmd=success",
    "status_code": 200,
    "request": "GET /?format=json HTTP/1.1",
    "response": "HTTP/1.1 200 OK\r\n\r\n{\"ip\":\"190.154.48.130\"}",
    "elapsed_ms": 123,
    "retries": 0,
    "sizes": {
        "request": 89,
        "response": 149
    },
    "status": "success"
}