Cloud Events API Reference

Overview

The Origo Cloud Events extension provides API endpoints for managing and processing cloud event messages following the CloudEvents specification. This document describes all available API endpoints and supported message types.

Namespace: Origo.PTE.CloudEvents API Publisher: origo API Group: cloudEvent API Version: v1.0


API Endpoints

1. Cloud Event Data API — Response Data

Purpose: Returns the response data content for a given message.

Endpoint Details:

Fields:

Field NameTypeDescription
idGuidUnique identifier of the message
dataBlobResponse data content

Supported Operations:

Example Request:

GET /api/origo/cloudEvent/v1.0/responses('{message-id}')

1b. Cloud Event Request Data API — Request Payload

Purpose: Returns the original request data payload for a given message. Useful for inspecting or re-replaying what was sent.

Endpoint Details:

Fields:

Field NameTypeDescription
idGuidUnique identifier of the message
dataBlobOriginal request payload (JSON, XML, or plain text)

Supported Operations:

Preferred — fetch the raw payload directly (no prior lookup needed):

GET /api/origo/cloudEvent/v1.0/requests('{message-id}')/data
Authorization: Bearer {token}

Or fetch the OData record (returns the id and data fields as JSON):

GET /api/origo/cloudEvent/v1.0/requests('{message-id}')
Authorization: Bearer {token}

Security: Results are automatically filtered to records created by the calling application (SystemCreatedBy = UserSecurityId()).


2. Cloud Event Queue API

Purpose: Create message requests and get status for queued (asynchronous) messages.

Endpoint Details:

Fields:

Field NameTypeDescriptionRequired
specversionTextCloudEvents specification versionYes
typeEnumMessage type identifierYes
sourceTextDescription of the application using the cloud event (e.g., "MyApp v1.2.3", "DataSync Service")Yes
idGuidUnique identifier (auto-generated)No
timeDateTimeEvent timestampNo
subjectTextSubject of the eventNo
continueFromRecordIdGuidSystemId of the record to resume from in continuation-enabled message types (e.g., CSV.Records.Get). Omit for the first request; set to the value returned in a previous response to continue.No
lcidIntegerWindows Language ID for language-specific captions (e.g., 1033 for English, 1031 for German). If not specified, uses the Default Language Code from Cloud Events SetupNo
datacontenttypeTextContent type of the data (application/json, application/xml, text/plain)No
dataBigTextRequest parameters (JSON, XML, or plain text depending on implementation; all built-in message types require JSON)No

Supported Operations:

POST - Create Queue Message

Creates a new message request that will be processed asynchronously.

Request Body:

{
  "specversion": "1.0",
  "type": "Help.Tables.Get",
  "source": "MyIntegrationApp v1.0",
  "lcid": 1033
}

Response: Returns the created message with assigned ID and timestamp. Once processing is complete, the data field will contain the download URL to retrieve the response data.

GET - Retrieve Queue Messages

Retrieves queued messages (messages with an assigned Task ID).

Example Request:

GET /api/origo/cloudEvent/v1.0/queues

PATCH - Update Queue Message

Not typically used for this API.


Queue API Actions

RetryTask

Retries the processing of a cloud event message.

Endpoint:

POST /api/origo/cloudEvent/v1.0/queues('{message-id}')/Microsoft.NAV.RetryTask

Description: Attempts to reprocess a failed or completed message. If the task is already running it will not be restarted.

Status Values:

Semantic StatusHTTP Status CodeDescription
Created201 CreatedTask is already running and cannot be retried
Updated200 OKTask was successfully restarted
None204 No ContentFailed to create a new background task

CancelTask

Cancels the scheduled task for a cloud event message.

Endpoint:

POST /api/origo/cloudEvent/v1.0/queues('{message-id}')/Microsoft.NAV.CancelTask

Description: Cancels a running or scheduled background task. If no task is scheduled, the action returns immediately.

Status Values:

Semantic StatusHTTP Status CodeDescription
Deleted204 No ContentNo task was scheduled
Updated200 OKTask was successfully cancelled
None204 No ContentTask cancellation failed

GetStatus

Gets the status of a cloud event message.

Endpoint:

POST /api/origo/cloudEvent/v1.0/queues('{message-id}')/Microsoft.NAV.GetStatus

Status Values:

HTTP Status Codes:

The GetStatus action returns standard HTTP status codes based on the message state:

Semantic StatusHTTP Status CodeDescription
Created201 CreatedMessage is still being processed
Updated200 OKProcessing completed successfully
Deleted204 No ContentNo task scheduled for this message
None204 No ContentMessage status is not known

Response: Returns the current processing status via the WebServiceActionContext.


3. Cloud Event Task API

Purpose: Create and process cloud event messages synchronously (immediate processing).

Endpoint Details:

Fields:

Field NameTypeDescriptionRequired
specversionTextCloudEvents specification versionYes
typeEnumMessage type identifierYes
sourceTextDescription of the application using the cloud event (e.g., "MyApp v1.2.3", "DataSync Service")Yes
idGuidUnique identifier (auto-generated)No
timeDateTimeEvent timestampNo
subjectTextSubject of the eventNo
continueFromRecordIdGuidSystemId of the record to resume from in continuation-enabled message types (e.g., CSV.Records.Get). Omit for the first request; set to the value returned in a previous response to continue.No
datacontenttypeTextContent type of the data (application/json, application/xml, text/plain)No
dataBigTextRequest parameters (JSON, XML, or plain text depending on implementation; all built-in message types require JSON)No

Supported Operations:

POST - Create and Process Task

Creates a new message and processes it immediately. The response will contain the download URL to the response data in the data field.

Request Body:

{
  "specversion": "1.0",
  "type": "Help.Fields.Get",
  "source": "MyIntegrationApp v1.0",
  "subject": "Customer",
  "datacontenttype": "application/json",
  "data": "{\"tableName\":\"Customer\"}"
}

Response: Returns the message with the download URL to the response data in the data field.

GET - Retrieve Task Messages

Retrieves task messages (messages without an assigned Task ID).

Example Request:

GET /api/origo/cloudEvent/v1.0/tasks

Message Types

The Cloud Events extension supports the following message types for data operations and business workflows:

Extensibility: This extension can be extended with custom implementations for additional message types by implementing the Cloud Event Msg Interface. All built-in message types require JSON format in the data field for request parameters.

Message Type Categories

For detailed documentation, see the specialized reference documents:

All Available Message Types

Message TypeDescriptionDirectionDocumentation
Data Operations
Data.Records.GetRetrieve full record data as JSON following data shipping standard. Supports field filtering, table view filtering, and date/time range filtering.OutboundData_Message_Types.md
Data.Records.SetInsert or update full record data as JSON. Automatically determines insert vs update based on SystemId or primary key.InboundData_Message_Types.md
Data.RecordIds.GetRetrieve record IDs and modification timestamps for sync scenarios.OutboundData_Message_Types.md
CSV.Records.GetExport all matching records from a specified table as a UTF-8 CSV file in Open Mirroring format. Supports continuation via continueFromRecordId for large exports approaching the 2 GB limit.OutboundData_Message_Types.md
Data.Totals.GetAggregate Decimal SumIndexFields across all matching records using CalcSums. Returns field totals as a single JSON object.OutboundData_Message_Types.md
Deleted.Records.GetRetrieve full field-level snapshots of deleted records from the Cloud Events Delete Log. Requires "Store Record" enabled per table.OutboundData_Message_Types.md
Deleted.RecordIds.GetRetrieve SystemId and deletion timestamp for deleted records. Lightweight — no "Store Record" requirement.OutboundData_Message_Types.md
CSV.DeletedRecords.GetExport deleted record audit log entries as CSV. Fixed audit columns: systemId, tableId, tableName, deletedAt, userId.OutboundData_Message_Types.md
Metadata Operations
Help.Tables.GetReturns list of all available tables with ID and name.OutboundMetadata_Message_Types.md
Help.Fields.GetRetrieve field metadata including field number, name, type, length, primary key status, and table relation indicators.OutboundMetadata_Message_Types.md
Help.MessageTypes.GetReturns list of all available message types with metadata for API discovery.OutboundMetadata_Message_Types.md
Help.Implementation.GetReturns help documentation for a specified message type (self-documenting API).OutboundMetadata_Message_Types.md
Help.Permissions.GetRetrieve current user's read/write permissions for a specified table.OutboundMetadata_Message_Types.md
Help.NextLineNo.GetReturns the next available line number for a table whose last PK field is an Integer.OutboundMetadata_Message_Types.md
Help.PageUrl.GetReturns the Business Central web URL for the card page of a specific record. Response content type: text/json.OutboundMetadata_Message_Types.md
Help.TableRelations.GetReturns all foreign-key relationships for a table including conditional relation branches.OutboundMetadata_Message_Types.md
Field.Translation.GetRetrieve BC system translations for a specific record field.OutboundMetadata_Message_Types.md
Field.Translation.SetWrite or delete BC system translations for a record field.InboundMetadata_Message_Types.md
Field.Translations.GetRetrieve BC system translations for all fields (or a specific field) on a record.OutboundMetadata_Message_Types.md
Sales, Customer & Item Operations
Customer.CreditLimit.GetRetrieve customer credit limit information with balance, outstanding amounts, and credit status.OutboundSales_Message_Types.md
Customer.SalesHistory.GetRetrieve sales history by item for a specific customer within a date range, based on Item Ledger Entries.OutboundSales_Message_Types.md
Customer.Statement.PdfRetrieve customer statement as a PDF document with optional date range using configured report selection.OutboundSales_Message_Types.md
Item.Availability.GetRetrieve item availability (Physical Inventory or Calculated Quantity with supply/demand).OutboundSales_Message_Types.md
Item.Price.GetRetrieve item price information from price lists based on customer, date, quantity, and variant.OutboundSales_Message_Types.md
Sales.Document.PostPost a released sales order (shipment, invoice, or both).InboundSales_Message_Types.md
Sales.Document.ReleaseRelease an open sales order to make it ready for processing and posting.InboundSales_Message_Types.md
Sales.Document.ReopenReopen a released or pending approval sales document to allow modifications.InboundSales_Message_Types.md
Sales.Document.StatisticsRetrieve sales document statistics including amounts, VAT totals, quantities, weight and volume.OutboundSales_Message_Types.md
Sales.Document.PreviewPostSimulate posting a sales document and return every captured ledger entry (G/L, VAT, Item, Value, Cust. / Detailed Cust. Ledger, and any other ledger table populated by the BC posting routine, including extension tables) without committing.InboundSales_Message_Types.md
Sales.SalesInvoice.PdfRetrieve posted sales invoice as a PDF document using configured report selection.OutboundSales_Message_Types.md
Sales.SalesShipment.PdfRetrieve posted sales shipment as a PDF document using configured report selection.OutboundSales_Message_Types.md
Sales.SalesCreditMemo.PdfRetrieve posted sales credit memo as a PDF document using configured report selection.OutboundSales_Message_Types.md
Sales.ReturnReceipt.PdfRetrieve posted return receipt as a PDF document using configured report selection.OutboundSales_Message_Types.md
Purchase Operations
Purchase.Document.ReleaseRelease an open purchase document.InboundPurchase_Message_Types.md
Purchase.Document.ReopenReopen a released or pending approval purchase document to allow modifications.InboundPurchase_Message_Types.md
Purchase.Document.StatisticsRetrieve purchase document statistics including amounts, VAT totals, quantities, weight and volume.OutboundPurchase_Message_Types.md
Purchase.Document.PostPost a purchase document and return the resulting posted invoice number.InboundPurchase_Message_Types.md
Purchase.Document.PreviewPostSimulate posting a purchase document and return every captured ledger entry (G/L, VAT, Item, Value, Vendor / Detailed Vendor Ledger, and any other ledger table populated by the BC posting routine, including extension tables) without committing.InboundPurchase_Message_Types.md
Finance Operations
Finance.GeneralJournal.CheckValidates a general journal batch and returns comprehensive readiness status with detailed validation results. Uses BC Error Message Management framework to collect all errors in a single pass.OutboundFinance_Message_Types.md
Finance.GeneralJournal.PostPosts a general journal batch and returns posting statistics including entry counts by type (GL, Customer, Vendor).InboundFinance_Message_Types.md
Finance.FAJournal.SetupNewLineCreate and initialize a new fixed asset journal line with defaults inherited from template and batch.InboundFinance_Message_Types.md
Finance.FAJournal.CheckValidates a fixed asset journal batch without posting. Zero-amount lines produce warnings (non-blocking).OutboundFinance_Message_Types.md
Finance.FAJournal.PostPosts a fixed asset journal batch and returns posting statistics including FA register and entry range.InboundFinance_Message_Types.md
Finance.FAJournal.PreviewPostSimulate posting a fixed asset journal batch and return every captured ledger entry (Maintenance Ledger, FA Ledger, G/L, VAT) without committing.InboundFinance_Message_Types.md
Inventory Operations
Inventory.ItemJournal.SetupNewLineCreate and initialize a new item journal line with defaults inherited from template and batch.InboundInventory_Message_Types.md
Inventory.ItemJournal.CheckValidates an item journal batch without posting. Returns line count, total quantity, total amount, and errors/warnings.OutboundInventory_Message_Types.md
Inventory.ItemJournal.PostPosts an item journal batch and returns posting statistics including item register and entry range.InboundInventory_Message_Types.md
Inventory.ItemJournal.PreviewPostSimulate posting an item journal batch and return every captured ledger entry (Item Ledger, Value Entry, and G/L when applicable) without committing.InboundInventory_Message_Types.md
Warehouse Operations
Warehouse.Shipment.CreateCreates one Warehouse Shipment per supplied source document (Sales Order, Outbound Transfer Order) via BC codeunit 5752 Get Source Doc. Outbound. Each source produces its own header.InboundInventory_Message_Types.md
Warehouse.Shipment.PostPosts a Warehouse Shipment via BC codeunit 5763 Whse.-Post Shipment. Optional invoice=true also invoices the source documents. Gated by CE Warehouse Posting (always) and CE G/L Posting (when invoice=true).InboundInventory_Message_Types.md
Warehouse.Shipment.PreviewPostSimulate posting a Warehouse Shipment (Ship + Invoice — invoice flag is forced by BC's preview subscriber) and return every captured ledger entry without committing. WMS locations require a registered pick first.InboundInventory_Message_Types.md
Projects Operations
Projects.ProjectJournal.SetupNewLineCreate and initialize a new project (job) journal line with defaults inherited from template and batch.InboundProjects_Message_Types.md
Projects.ProjectJournal.CheckValidates a project journal batch without posting. Returns line count, total quantity, total line amount, and errors/warnings.OutboundProjects_Message_Types.md
Projects.ProjectJournal.PostPosts a project journal batch and returns posting statistics including job register and entry range.InboundProjects_Message_Types.md
Projects.ProjectJournal.PreviewPostSimulate posting a project (job) journal batch and return every captured ledger entry (Job Ledger Entry with tableCaption "Project Ledger Entry", Res. Ledger Entry, and G/L when applicable) without committing. DimensionSetID is returned as an array of {DimensionCode, DimensionValueCode}.InboundProjects_Message_Types.md
Resources Operations
Resources.ResourceJournal.SetupNewLineCreate and initialize a new resource journal line with defaults inherited from template and batch.InboundResources_Message_Types.md
Resources.ResourceJournal.CheckValidates a resource journal batch without posting. Returns line count, total quantity, total cost, and errors/warnings.OutboundResources_Message_Types.md
Resources.ResourceJournal.PostPosts a resource journal batch and returns posting statistics. Resource register fields are conditional (present only when a register is created).InboundResources_Message_Types.md
Incoming Document Operations
Incoming.Document.CreateCreate a new Incoming Document with a main file attachment.InboundIncomingDocument_Message_Types.md
Incoming.Document.AttachAdd a supplemental attachment to an existing Incoming Document.InboundIncomingDocument_Message_Types.md
Incoming.Document.ProcessProcess an Incoming Document to create a purchase invoice or journal line.InboundIncomingDocument_Message_Types.md
Incoming.Document.GetRetrieve an Incoming Document with header fields and all attachments as Base64.OutboundIncomingDocument_Message_Types.md
Approval Operations
Document.Approval.GetRetrieve approval log entries with linked active and posted approval entries, with per-record permission filtering.OutboundApproval_Message_Types.md
Document.Approval.SendCreate approval entries for a document with approver assignments based on configured approval workflows.InboundApproval_Message_Types.md
Document.Approval.ApproveApprove one or more open Approval Entry records using BC standard Approvals Mgmt. authorization.InboundApproval_Message_Types.md
Document.Approval.RejectReject one or more open Approval Entry records with optional comment.InboundApproval_Message_Types.md
Document.Approval.MeRetrieve approval entries assigned to the calling user with source document linking.OutboundApproval_Message_Types.md
Document.Approval.DelegateDelegate one or more open Approval Entry records to another user.InboundApproval_Message_Types.md
Memory Operations
Memory.Company.GetRetrieve company-scoped memory records with pagination and tableView filtering.OutboundMemory_Message_Types.md
Memory.Company.SetInsert or update company-scoped memory records via a data array.InboundMemory_Message_Types.md
Memory.User.GetRetrieve user-scoped memory records (private to the creator).OutboundMemory_Message_Types.md
Memory.User.SetInsert or update user-scoped memory records (private to the creator).InboundMemory_Message_Types.md

Events and Webhooks

The Cloud Events extension provides External Business Events that enable external systems to receive webhook notifications when messages complete or fail processing. This eliminates the need for continuous polling and enables true event-driven architectures.

Webhook Notifications

Event Pattern: Minimal Notification + API Fetch

  1. Message Submitted: External system submits message to Queue API or Task API
  2. Processing: Business Central processes the message asynchronously (Queue API) or synchronously (Task API)
  3. Event Raised: When processing completes or fails, BC raises an External Business Event
  4. Webhook Notification: Subscribed endpoints receive minimal notification (MessageId, MessageType, Timestamp)
  5. Data Retrieval: External system calls Data API using MessageId to fetch full response

Available Events

Event NameWhen RaisedWebhook PayloadUse Case
CloudEventMessageCompletedMessage processing succeeds{ MessageId, MessageType, ResponseContentLink, Timestamp }Notify external systems of successful completion
CloudEventMessageFailedMessage processing fails{ MessageId, MessageType, ResponseContentLink, Timestamp }Alert on processing failures

Configuration

Configure webhook subscriptions via Business Central's Event Subscriptions page:

  1. Navigate to Event Subscriptions
  2. Create new subscription
  3. Select event: CloudEventMessageCompleted or CloudEventMessageFailed
  4. Set Event Category: "Origo Cloud Event"
  5. Configure endpoint URL and authentication
  6. Enable subscription

Complete Documentation

For comprehensive webhook setup, security considerations, code examples, and troubleshooting:

→ See Events and Webhooks Reference

Includes:


Authentication

All API endpoints require proper authentication using OAuth 2.0 or Basic Authentication as configured in Business Central.

Required Permissions:

Data Isolation — Entra Application Boundary

All Cloud Events endpoints (/tasks, /queues, /responses, /requests) enforce strict data isolation at the Entra Application level.

Every response is automatically filtered server-side to records where SystemCreatedBy = UserSecurityId(). UserSecurityId() in Business Central resolves to the Object ID of the Entra Application (Client ID) that authenticated the request.

Consequences:

ScenarioResult
App A lists /queuesReturns only messages submitted by App A
App A requests /responses({id}) for a message created by App BReturns empty — no data leaked
App A requests /requests({id}) for a message created by App BReturns empty — no data leaked
Two apps share the same company + environmentEach sees only its own message history

This isolation is unconditional — it cannot be overridden by OData filters, admin credentials, or any other mechanism. It applies to GET (listing and single-record reads) on all four endpoints.


Usage Examples

Example 1: Get List of Tables (Synchronous)

Request:

POST /api/origo/cloudEvent/v1.0/tasks
Content-Type: application/json

{
  "specversion": "1.0",
  "type": "Help.Tables.Get",
  "source": "MyIntegrationApp v1.0",
  "datacontenttype": "application/json",
  "data": "{}"
}

Response:

{
  "@odata.context": "...",
  "specversion": "1.0",
  "type": "Help.Tables.Get",
  "source": "MyIntegrationApp v1.0",
  "id": "12345678-1234-1234-1234-123456789abc",
  "time": "2026-02-19T10:30:00Z",
  "subject": "",
  "datacontenttype": "text/json",
  "data": "/api/origo/cloudEvent/v1.0/responses(12345678-1234-1234-1234-123456789abc)"
}

Example 2: Get Table Fields (Asynchronous)

Step 1: Queue the Request

POST /api/origo/cloudEvent/v1.0/queues
Content-Type: application/json

{
  "specversion": "1.0",
  "type": "Help.Fields.Get",
  "subject": "Customer",
  "source": "MyIntegrationApp v1.0",
  "datacontenttype": "application/json",
  "data": "{\"tableName\":\"Customer\"}"
}

Step 2a: Option 1 - Poll for Status

POST /api/origo/cloudEvent/v1.0/queues('{message-id}')/Microsoft.NAV.GetStatus

Step 2b: Option 2 - Webhook Notification (Recommended)

Subscribe to the CloudEventMessageCompleted event and receive automatic notification when processing completes:

{
  "MessageId": "{message-id}",
  "MessageType": "Help.Fields.Get",
  "ResponseContentLink": "/api/origo/cloudEvent/v1.0/responses({message-id})/data",
  "Timestamp": "2026-03-08T14:30:22Z"
}

Step 3: Retrieve Results

GET /api/origo/cloudEvent/v1.0/responses('{message-id}')

Note: For webhook setup, see Events and Webhooks Reference.


Example 3: Get Modified Records

Request:

POST /api/origo/cloudEvent/v1.0/tasks
Content-Type: application/json

{
  "specversion": "1.0",
  "type": "Data.RecordIds.Get",
  "source": "DataSync Service v2.1",
  "datacontenttype": "application/json",
  "data": "{\"tableName\":\"Customer\",\"startDateTime\":\"2026-02-01T00:00:00Z\",\"endDateTime\":\"2026-02-19T23:59:59Z\"}"
}

Example 4: Get Available Message Types

Request:

POST /api/origo/cloudEvent/v1.0/tasks
Content-Type: application/json

{
  "specversion": "1.0",
  "type": "Help.MessageTypes.Get",
  "source": "MyIntegrationApp v1.0",
  "datacontenttype": "application/json",
  "data": "{}"
}

Response:

{
  "@odata.context": "...",
  "specversion": "1.0",
  "type": "Help.MessageTypes.Get",
  "source": "my-application",
  "id": "12345678-1234-1234-1234-123456789abc",
  "time": "2026-02-25T10:30:00Z",
  "subject": "",
  "datacontenttype": "text/json",
  "data": "/api/origo/cloudEvent/v1.0/responses(12345678-1234-1234-1234-123456789abc)"
}

Note: The data field contains a download URL. Retrieve the actual response data by calling the URL.


Example 5: Get Help Documentation for a Message Type

Request:

POST /api/origo/cloudEvent/v1.0/tasks
Content-Type: application/json

{
  "specversion": "1.0",
  "type": "Help.Implementation.Get",
  "subject": "Help.Fields.Get",
  "source": "my-application",
  "datacontenttype": "application/json"
}

Response:

{
  "@odata.context": "...",
  "specversion": "1.0",
  "type": "Help.Implementation.Get",
  "source": "my-application",
  "id": "12345678-1234-1234-1234-123456789abc",
  "time": "2026-02-25T10:35:00Z",
  "subject": "Help.Fields.Get",
  "datacontenttype": "text/markdown",
  "data": "/api/origo/cloudEvent/v1.0/responses(12345678-1234-1234-1234-123456789abc)"
}

Note: The data field contains a download URL. Retrieve the actual markdown help documentation by calling the URL.


Error Handling

Common Error Scenarios

  1. Table Not Found
  1. Invalid Message Type
  1. Missing Required Fields

Best Practices

  1. Choosing Between Queue and Task APIs:
  1. Message Types:
  1. Content Types:
  1. Status Checking:
  1. Date/Time Filtering:

Version History

Version 1.0.0.0 - Initial release


© Origo – Cloud Events Base Extension