> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Inbound API trigger events

> JSON Schemas for the five events Lobyco publishes when an Inbound API block is created, changed, published, stopped or deleted.

Lobyco publishes an Inbound API trigger event when an [Inbound API block](https://help.lobyco.com/integration/external-integrations/inboundapi-integration.md) is created, changed, published, stopped or deleted in Lobyco Nexus. Each event carries the block's name and the URL your system calls to start its flow. Your system can use them to keep its list of Inbound API endpoints up to date by itself.

> [!WARNING]
>
> **Events can arrive out of order.** Keep, for each `triggerId`, the event with the latest time of change. That is `updatedAt`, `publishedAt`, `stoppedAt` or `deletedAt`, whichever the event carries, and `createdAt` on a created event.
>
> **An event can be lost.** If Lobyco cannot publish an event, it does not try again, and the change in Nexus still stands. The block's next change publishes its whole state again.

## Field reference

Your endpoint receives these events through a subscription in **Data streams** in Nexus, under the event types below. Unless the subscription transforms the payload, the request body is the payload the schemas describe, with no envelope around it.

| Event | Data streams type | Raised when |
| - | - | - |
| Trigger Created | `inbound_api.created` | A block is first saved, or a saved block is copied and pasted |
| Trigger Updated | `inbound_api.updated` | A save changes the block's name, description, start or end date |
| Trigger Published | `inbound_api.published` | A block is created published, or a save publishes an unpublished block |
| Trigger Stopped | `inbound_api.stopped` | A save unpublishes a published block |
| Trigger Deleted | `inbound_api.deleted` | A block is deleted |

In the payload, the Inbound API block is called a trigger. `triggerId` is the block's id, and the last segment of its `url`.

* **Every event carries the block's whole state** after the change. You never combine events to know what a block looks like.
* **A save that changes nothing publishes nothing.** Dates are compared to the second.
* **One save can publish two events.** A save that changes the details and publishes or stops the block publishes Trigger Updated first. Creating a published block publishes Trigger Created, then Trigger Published. Both events share the time of the change, and their `eventId` values differ in the event name.
* **A pasted copy is unpublished**, so copying a block publishes Trigger Created alone.
* **Who made the change, and when, is named after the change.** Trigger Updated carries `updatedBy` and `updatedAt`, Trigger Published carries `publishedBy` and `publishedAt`, and so on. `createdBy` and `createdAt` are on every event.
* **Whether the block is active is not sent.** The block accepts calls while `isPublished` is `true` and the current time is between `startDate` and `endDate`. Work it out on your side.
* **Deleting a campaign publishes no events.** Nexus lets an admin user delete a campaign only once its blocks are gone, and each block deletion publishes Trigger Deleted.
* **A block last saved before Lobyco released these events publishes nothing until its next save.**

The payloads follow the same conventions as the [campaign events](https://help.lobyco.com/integration/external-integrations/events/campaign-events.md):

* Property names are camelCase, such as `triggerId` and `eventId`.
* A property with no value is left out of the payload, not sent as `null`. Only `description`, `url`, `startDate` and `endDate` can be absent.
* Dates are UTC with second precision, in the form `yyyy-MM-ddTHH:mm:ssZ`. The time inside `eventId` is the exception. It is written to the tick, as `yyyy-MM-ddTHH:mm:ss.fffffff`, so two saves within one second still get different ids.

## Schemas

> [tab] Trigger Created
>
> ```json theme={"system"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "description": "Payload emitted when an Inbound API trigger is created in TurboFlow, published or not.",
>   "type": "object",
>   "required": [
>     "eventId",
>     "campaignId",
>     "triggerId",
>     "name",
>     "isPublished",
>     "createdBy",
>     "createdAt",
>     "timestamp",
>     "activityId",
>     "unifiedCampaignId"
>   ],
>   "properties": {
>     "eventId": {
>       "type": "string",
>       "description": "Computed event identifier, also used as the Service Bus message id: InboundApiTriggerCreated-{triggerId}-{createdAt}, with createdAt in UTC to the tick (yyyy-MM-ddTHH:mm:ss.fffffff)."
>     },
>     "campaignId": {
>       "type": "string",
>       "description": "Identifier of the campaign the trigger starts."
>     },
>     "triggerId": {
>       "type": "string",
>       "description": "Identifier of the trigger, the last segment of url."
>     },
>     "name": {
>       "type": "string",
>       "description": "Name of the block on the canvas. Empty for a trigger created without one, or not saved since names were stored."
>     },
>     "description": {
>       "type": "string",
>       "description": "Description of the trigger."
>     },
>     "url": {
>       "type": "string",
>       "format": "uri",
>       "description": "The endpoint an external system calls to fire the trigger: the URL the block dialog shows."
>     },
>     "isPublished": {
>       "type": "boolean",
>       "description": "Whether the trigger is published. It accepts calls only while published and between startDate and endDate."
>     },
>     "startDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Start of the trigger's schedule, when one is set."
>     },
>     "endDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "End of the trigger's schedule, when one is set."
>     },
>     "createdBy": {
>       "type": "string",
>       "description": "Full name of the user who created the trigger."
>     },
>     "createdAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was created."
>     },
>     "timestamp": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Timestamp when the event occurred."
>     },
>     "activityId": {
>       "type": "string",
>       "description": "The activity the event belongs to: the trigger, the same as triggerId. It is the Service Bus session id."
>     },
>     "unifiedCampaignId": {
>       "type": "string",
>       "description": "The campaign the trigger belongs to, the same as campaignId."
>     }
>   }
> }
> ```

> [tab] Trigger Updated
>
> ```json theme={"system"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "description": "Payload emitted when the name, description or schedule of an Inbound API trigger changes.",
>   "type": "object",
>   "required": [
>     "eventId",
>     "campaignId",
>     "triggerId",
>     "name",
>     "isPublished",
>     "createdBy",
>     "createdAt",
>     "updatedBy",
>     "updatedAt",
>     "timestamp",
>     "activityId",
>     "unifiedCampaignId"
>   ],
>   "properties": {
>     "eventId": {
>       "type": "string",
>       "description": "Computed event identifier, also used as the Service Bus message id: InboundApiTriggerUpdated-{triggerId}-{updatedAt}, with updatedAt in UTC to the tick (yyyy-MM-ddTHH:mm:ss.fffffff)."
>     },
>     "campaignId": {
>       "type": "string",
>       "description": "Identifier of the campaign the trigger starts."
>     },
>     "triggerId": {
>       "type": "string",
>       "description": "Identifier of the trigger, the last segment of url."
>     },
>     "name": {
>       "type": "string",
>       "description": "Name of the block on the canvas. Empty for a trigger created without one, or not saved since names were stored."
>     },
>     "description": {
>       "type": "string",
>       "description": "Description of the trigger."
>     },
>     "url": {
>       "type": "string",
>       "format": "uri",
>       "description": "The endpoint an external system calls to fire the trigger: the URL the block dialog shows."
>     },
>     "isPublished": {
>       "type": "boolean",
>       "description": "Whether the trigger is published. It accepts calls only while published and between startDate and endDate."
>     },
>     "startDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Start of the trigger's schedule, when one is set."
>     },
>     "endDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "End of the trigger's schedule, when one is set."
>     },
>     "createdBy": {
>       "type": "string",
>       "description": "Full name of the user who created the trigger."
>     },
>     "createdAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was created."
>     },
>     "updatedBy": {
>       "type": "string",
>       "description": "Full name of the user whose change raised the event."
>     },
>     "updatedAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the change that raised the event was made."
>     },
>     "timestamp": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Timestamp when the event occurred."
>     },
>     "activityId": {
>       "type": "string",
>       "description": "The activity the event belongs to: the trigger, the same as triggerId. It is the Service Bus session id."
>     },
>     "unifiedCampaignId": {
>       "type": "string",
>       "description": "The campaign the trigger belongs to, the same as campaignId."
>     }
>   }
> }
> ```

> [tab] Trigger Published
>
> ```json theme={"system"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "description": "Payload emitted when an Inbound API trigger is published.",
>   "type": "object",
>   "required": [
>     "eventId",
>     "campaignId",
>     "triggerId",
>     "name",
>     "isPublished",
>     "createdBy",
>     "createdAt",
>     "publishedBy",
>     "publishedAt",
>     "timestamp",
>     "activityId",
>     "unifiedCampaignId"
>   ],
>   "properties": {
>     "eventId": {
>       "type": "string",
>       "description": "Computed event identifier, also used as the Service Bus message id: InboundApiTriggerPublished-{triggerId}-{publishedAt}, with publishedAt in UTC to the tick (yyyy-MM-ddTHH:mm:ss.fffffff)."
>     },
>     "campaignId": {
>       "type": "string",
>       "description": "Identifier of the campaign the trigger starts."
>     },
>     "triggerId": {
>       "type": "string",
>       "description": "Identifier of the trigger, the last segment of url."
>     },
>     "name": {
>       "type": "string",
>       "description": "Name of the block on the canvas. Empty for a trigger created without one, or not saved since names were stored."
>     },
>     "description": {
>       "type": "string",
>       "description": "Description of the trigger."
>     },
>     "url": {
>       "type": "string",
>       "format": "uri",
>       "description": "The endpoint an external system calls to fire the trigger: the URL the block dialog shows."
>     },
>     "isPublished": {
>       "type": "boolean",
>       "description": "Whether the trigger is published. It accepts calls only while published and between startDate and endDate."
>     },
>     "startDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Start of the trigger's schedule, when one is set."
>     },
>     "endDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "End of the trigger's schedule, when one is set."
>     },
>     "createdBy": {
>       "type": "string",
>       "description": "Full name of the user who created the trigger."
>     },
>     "createdAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was created."
>     },
>     "publishedBy": {
>       "type": "string",
>       "description": "Full name of the user who published the trigger."
>     },
>     "publishedAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was published."
>     },
>     "timestamp": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Timestamp when the event occurred."
>     },
>     "activityId": {
>       "type": "string",
>       "description": "The activity the event belongs to: the trigger, the same as triggerId. It is the Service Bus session id."
>     },
>     "unifiedCampaignId": {
>       "type": "string",
>       "description": "The campaign the trigger belongs to, the same as campaignId."
>     }
>   }
> }
> ```

> [tab] Trigger Stopped
>
> ```json theme={"system"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "description": "Payload emitted when a published Inbound API trigger is stopped.",
>   "type": "object",
>   "required": [
>     "eventId",
>     "campaignId",
>     "triggerId",
>     "name",
>     "isPublished",
>     "createdBy",
>     "createdAt",
>     "stoppedBy",
>     "stoppedAt",
>     "timestamp",
>     "activityId",
>     "unifiedCampaignId"
>   ],
>   "properties": {
>     "eventId": {
>       "type": "string",
>       "description": "Computed event identifier, also used as the Service Bus message id: InboundApiTriggerStopped-{triggerId}-{stoppedAt}, with stoppedAt in UTC to the tick (yyyy-MM-ddTHH:mm:ss.fffffff)."
>     },
>     "campaignId": {
>       "type": "string",
>       "description": "Identifier of the campaign the trigger starts."
>     },
>     "triggerId": {
>       "type": "string",
>       "description": "Identifier of the trigger, the last segment of url."
>     },
>     "name": {
>       "type": "string",
>       "description": "Name of the block on the canvas. Empty for a trigger created without one, or not saved since names were stored."
>     },
>     "description": {
>       "type": "string",
>       "description": "Description of the trigger."
>     },
>     "url": {
>       "type": "string",
>       "format": "uri",
>       "description": "The endpoint an external system calls to fire the trigger: the URL the block dialog shows."
>     },
>     "isPublished": {
>       "type": "boolean",
>       "description": "Whether the trigger is published. It accepts calls only while published and between startDate and endDate."
>     },
>     "startDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Start of the trigger's schedule, when one is set."
>     },
>     "endDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "End of the trigger's schedule, when one is set."
>     },
>     "createdBy": {
>       "type": "string",
>       "description": "Full name of the user who created the trigger."
>     },
>     "createdAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was created."
>     },
>     "stoppedBy": {
>       "type": "string",
>       "description": "Full name of the user who stopped the trigger."
>     },
>     "stoppedAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was stopped."
>     },
>     "timestamp": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Timestamp when the event occurred."
>     },
>     "activityId": {
>       "type": "string",
>       "description": "The activity the event belongs to: the trigger, the same as triggerId. It is the Service Bus session id."
>     },
>     "unifiedCampaignId": {
>       "type": "string",
>       "description": "The campaign the trigger belongs to, the same as campaignId."
>     }
>   }
> }
> ```

> [tab] Trigger Deleted
>
> ```json theme={"system"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "description": "Payload emitted when an Inbound API trigger is deleted. It carries the trigger's last state, with the deletion as its latest change.",
>   "type": "object",
>   "required": [
>     "eventId",
>     "campaignId",
>     "triggerId",
>     "name",
>     "isPublished",
>     "createdBy",
>     "createdAt",
>     "deletedBy",
>     "deletedAt",
>     "timestamp",
>     "activityId",
>     "unifiedCampaignId"
>   ],
>   "properties": {
>     "eventId": {
>       "type": "string",
>       "description": "Computed event identifier, also used as the Service Bus message id: InboundApiTriggerDeleted-{triggerId}-{deletedAt}, with deletedAt in UTC to the tick (yyyy-MM-ddTHH:mm:ss.fffffff)."
>     },
>     "campaignId": {
>       "type": "string",
>       "description": "Identifier of the campaign the trigger starts."
>     },
>     "triggerId": {
>       "type": "string",
>       "description": "Identifier of the trigger, the last segment of url."
>     },
>     "name": {
>       "type": "string",
>       "description": "Name of the block on the canvas. Empty for a trigger created without one, or not saved since names were stored."
>     },
>     "description": {
>       "type": "string",
>       "description": "Description of the trigger."
>     },
>     "url": {
>       "type": "string",
>       "format": "uri",
>       "description": "The endpoint an external system calls to fire the trigger: the URL the block dialog shows."
>     },
>     "isPublished": {
>       "type": "boolean",
>       "description": "Whether the trigger is published. It accepts calls only while published and between startDate and endDate."
>     },
>     "startDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Start of the trigger's schedule, when one is set."
>     },
>     "endDate": {
>       "type": "string",
>       "format": "date-time",
>       "description": "End of the trigger's schedule, when one is set."
>     },
>     "createdBy": {
>       "type": "string",
>       "description": "Full name of the user who created the trigger."
>     },
>     "createdAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was created."
>     },
>     "deletedBy": {
>       "type": "string",
>       "description": "Full name of the user who deleted the trigger."
>     },
>     "deletedAt": {
>       "type": "string",
>       "format": "date-time",
>       "description": "When the trigger was deleted."
>     },
>     "timestamp": {
>       "type": "string",
>       "format": "date-time",
>       "description": "Timestamp when the event occurred."
>     },
>     "activityId": {
>       "type": "string",
>       "description": "The activity the event belongs to: the trigger, the same as triggerId. It is the Service Bus session id."
>     },
>     "unifiedCampaignId": {
>       "type": "string",
>       "description": "The campaign the trigger belongs to, the same as campaignId."
>     }
>   }
> }
> ```

## Related

* [InboundAPI integration](https://help.lobyco.com/integration/external-integrations/inboundapi-integration.md) — how your system calls the URL these events carry.
* [Campaign events](https://help.lobyco.com/integration/external-integrations/events/campaign-events.md) — the campaigns the Inbound API blocks belong to.
* [Block reference](https://help.lobyco.com/business-documentation/campaigns/orchestration-canvas/block-reference.md#inbound-api) — what an admin user configures on the Inbound API block.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.