Skip to main content

Migrate to our new event types

Learn how you can migrate your existing webhooks to use our new event types

We have recently released our new webhook event types. To ensure a smooth transition to these types, we recommend using an "expand/contract" strategy. It allows your system to handle both the old rule types and the new event types during the migration, minimizing potential disruptions.

In this guide:
  • View recommended steps to migrate your existing webhooks to the new event types.
  • Understand how the existing rule types and their schemas map to the new event types.
  • See how you can manage notifications for rule types that will not be replaced.

Migrate to new event types

To switch to new event types using the recommended "expand/contract" strategy, follow these steps:

  1. Update your application logic

    Modify your application logic to handle the existing and the new event types at the same time:

    • Create a new POST endpoint specifically designed to consume the new webhook event type.
    • Create a feature toggle to control the activation of the new endpoint. Enabling the toggle should activate the endpoint to start processing events.
    • Create another feature toggle to control your existing webhook consumer. Disabling the toggle should stop the endpoint from processing the old rule types.
  2. Configure the new webhook consumer in the Portal

    In the Codat Portal, configure a new webhook consumer that points to your newly created endpoint. See Build webhook consumers to subscribe to events for a step-by-step walkthrough.

  3. Validate the new webhook consumer

    Test the new webhook consumer to ensure it is correctly receiving and processing the new event type. You can send test events and check the logs in the Codat Portal. Navigate to Monitor > Events and select the relevant endpoint to do this. See Test a webhook consumer for a step-by-step walkthrough.

  4. Enable the new webhook consumer

    When you’ve confirmed that the new webhook consumer is functioning correctly, activate the endpoint by enabling the feature toggle you created to control it. This will direct your application to process events via the new webhook consumer without losing events.

    At this stage both webhook consumers will be active and may receive and process the same events as a result. Include logic in your application that prevents the same event from being processed by both endpoints to avoid duplication.

  5. Disable the old webhook consumer

    Once you are happy with the new webhook consumer, deactivate your old endpoint by disabling the feature toggle you created to control it, delete the old consumer from the Portal, and remove the application logic consuming the old rule types.

Understand new event types

Below is the summary of old rule types and new event types that replace them. Click on the required event type to check the fields and schema of the replacement event type and how it maps to legacy rule types.

You can also view the dedicated page for our new webhook event types.

Existing rule typeReplacement event type
ClientRateLimitReachedclient.rateLimit.reached
ClientRateLimitResetclient.rateLimit.reset
DataConnectionStatusChangedconnection.created
connection.connected
connection.disconnected
connection.reconnected
connection.deleted
DataSyncCompletedread.completed
DataSyncStatusChangedToErrorread.completed
DatasetDataChangedread.completed
NewCompanySynchronizedread.completed.initial
PushOperationStatusChanged{dataType}.write.successful
{dataType}.write.unsuccessful
PushOperationTimedOut{dataType}.write.unsuccessful
SyncCompletedexpenses.sync.successful
SyncFailedexpenses.sync.unsuccessful
SyncConnectionDeletedconnection.deleted

ClientRateLimitReached

Called when the client's requests to Codat's API exceed the current quota. This event now follows our updated schema standards.

Rule typeMaps to event type
Rate Limit Reachedclient.rateLimit.reached
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "Rate Limit Reached",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"Message": "The current daily rate limit quota of 1000 requests for bae71d36-ff47-420a-b4a6-f8c9ddf41140 has been reached.",
"Data": {
"DailyQuota": 1000,
"ExpiresUtc": "2023-05-03T00:00:00Z"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.DailyQuotapayload.dailyQuota
Data.ExpiresUtcpayload.expiryDate

ClientRateLimitReset

Called when the client's rate limit quota is reset, allowing more requests to Codat's API. This event now follows our updated schema standards.

Rule typeMaps to event type
Rate Limit Resetclient.rateLimit.reset
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "Rate Limit Reset",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"Message": "The current daily rate limit quota for client 30e0f9d2-52c0-4c9f-a806-bcd98a3bcd7e has been reset to 1000 requests.",
"Data": {
"DailyQuota": 1000,
"ExpiresUtc": "2023-05-03T00:00:00Z",
"ResetReason": "The quota was reset because it is a new day.",
"QuotaRemaining": 1000
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.DailyQuotapayload.dailyQuota
Data.ExpiresUtcpayload.expiryDate
Data.ResetReasonNot replaced. This property is not relevant for use in a webhook.
Data.QuotaRemainingpayload.quotaRemaining

DataConnectionStatusChanged

Called whenever a data connection's status changes, this event has been replaced by more precise webhooks that offer more detailed context on the state transition.

The new webhooks now include the full connection schema, ensuring consistency across our APIs and webhooks.

Rule typeOld statusNew statusMaps to event type
DataConnectionStatusChanged-PendingAuthconnection.created
DataConnectionStatusChangedPendingAuthLinkedconnection.connected
DataConnectionStatusChangedLinkedUnlinked
Deauthorized
connection.disconnected
DataConnectionStatusChangedUnlinked
Deauthorized
Linkedconnection.reconnected
DataConnectionStatusChanged--connection.deleted
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "DataConnectionStatusChanged",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"DataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"Message": "Data connection for SandBox status changed from PendingAuth to Linked",
"Data": {
"dataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"newStatus": "Linked",
"oldStatus": "PendingAuth",
"platformKey": "gbol"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
DataConnectionIdpayload.connection.id
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.dataConnectionIdpayload.connection.id
Data.newStatuspayload.connection.status
Data.oldStatusNot replaced. The new event types specify the status transition, so the previous status is not needed.
Data.platformKeypayload.connection.integrationKey

DataSyncCompleted

Called when a data synchronization completes, the legacy event generates a notification for each dataType as it finishes syncing regardless of the outcome.

The read.completed replacement event uses the same trigger, but now provides detailed information about the read operation's outcome, including the status of the sync and whether any records were modified. See Retrieve company data.

Adopting the new schema

When adopting the new schema, ensure that you handle all elements in the dataTypes array to maintain future compatibility.

Rule typeMaps to event type
Data sync completedread.completed
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "Data sync completed",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"DataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"Message": "Data sync of type creditNotes completed for company 7626befb-0c7d-49a4-9366-bc4c81b4e4b7",
"Data": {
"dataType": "creditNotes",
"datasetId": "1541a5ee-0d84-4b6e-a7f7-c07c1f216333"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
DataConnectionIdpayload.dataTypes[].connectionId
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.dataTypepayload.dataTypes[].dataType
Data.datasetIdNot replaced. If you encounter an issue, provide the company ID to support to assist with troubleshooting.

DataSyncStatusChangedToError

Called when the synchronization of a dataset fails, the replacement read.completed webhook now includes information on whether the data was successfully read into Codat's cache.

This provides insight into both the completion of the read operation and its outcome. See Retrieve company data.

Adopting the new schema

When adopting the new schema, ensure that you handle all elements in the dataTypes array to maintain future compatibility.

Property mapping

Old schema propertyNew schema property
Data Sync Status Changed To Errorread.completed
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "Data Sync Status Changed To Error",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"DataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"Message": "ERROR: syncing payments triggered a ProcessingError notification at 2020-04-21T12:12:57.4250446Z.",
"Data": {
"dataType": "invoices",
"datasetStatus": "ProcessingError",
"datasetId": "6586f21b-ad4d-4d06-a309-712af47184a2"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
DataConnectionIdpayload.dataTypes[].connectionId
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.dataTypepayload.dataTypes[].dataType
Data.datasetStatuspayload.dataTypes[].status
Data.datasetIdNot replaced. If you encounter an issue, provide the company ID to support to assist with troubleshooting.

DatasetDataChanged

Called when a dataset synchronization completes and results in updates within Codat's data cache, such as the creation of new records or changes to existing ones.

The replacement read.completed webhook now provides information on when the data in Codat's cache was last modified and whether any records within a data type have been updated since the previous read operation.

To replicate the behavior of the legacy DatasetDataChanged webhook, check if the recordsModified Boolean value for the data type is true.

See Retrieve company data.

Adopting the new schema

When adopting the new schema, ensure that you handle all elements in the dataTypes array to maintain future compatibility.

Rule typeMaps to event type
Dataset data changedread.completed
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "Dataset data changed",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"DataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"Message": "Data has changed for dataset type invoices, company 8a210b68-6988-11ed-a1eb-0242ac120002",
"Data": {
"dataType": "invoices",
"datasetId": "6586f21b-ad4d-4d06-a309-712af47184a2"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
DataConnectionIdpayload.dataTypes[].connectionId
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.dataTypepayload.dataTypes[].dataType
Data.datasetIdNot replaced. If you encounter an issue, provide the company ID to support to assist with troubleshooting.

NewCompanySynchronized

Called when initial syncs are complete for all data types queued for a newly connected company, and at least one of those syncs is successful.

The replacement read.completed.initial webhook is called the first time the data type is stored in Codat's cache and uses the same payload as the read.completed webhook.

Adopting the new schema

When adopting the new schema, ensure that you handle all elements in the dataTypes array to maintain future compatibility.

Rule typeMaps to event type
New company synchronizedread.completed.initial
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "New company synchronised",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"DataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"Message": "Company 8a210b68-6988-11ed-a1eb-0242ac120002 synced for the first time",
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
DataConnectionIdpayload.dataTypes[].connectionId
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.dataTypepayload.dataTypes[].dataType
Data.datasetIdNot replaced. If you encounter an issue, provide the company ID to support to assist with troubleshooting.

PushOperationStatusChanged

Called when the status of a write operation changes, this event has been replaced by two more precise webhooks: {dataType}.write.successful and {dataType}.write.unsuccessful.

These event types provide detailed information, including whether the push operation was successful, the record ID, and the attachment ID when creating, updating, or deleting records.

Rule typeData statusMaps to event type
Push Operation Status Changed()Successful{dataType}.write.successful
Push Operation Status Changed()TimedOut or Failed{dataType}.write.unsuccessful
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "Push Operation Status Changed()",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"DataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"Message": "invoices triggered notification for PushOperationStatusChanged at 2019-05-22T18:19:42.742Z",
"Data": {
"dataType": "invoices",
"status": "Success",
"pushOperationKey": "c2f8847d-3047-4619-a157-6d947d8e4a73"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
DataConnectionIdpayload.connectionId
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.dataTypeeventType
Data.statuspayload.status
Data.pushOperationKeypayload.id

PushOperationTimedOut

Called when a write operation times out. This webhook has been replaced by the {dataType}.write.unsuccessful event type.

Rule typeData statusMaps to event type
Push Operation Timed OutTimedOut{dataType}.write.unsuccessful
Compare webhook schemas
{
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"DataConnectionId": "2e9d2c44-f675-40ba-8049-353bfcb5e171",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"RuleType": "Push Operation Timed Out",
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"Message": "ERROR: pushing invoices never finished in time, timing out at 2020-09-07T08:42:13",
"Data": {
"dataType": "invoices",
"pushOperationKey": "c2f8847d-3047-4619-a157-6d947d8e4a73",
"pushOperationGuid": "c2f8847d-3047-4619-a157-6d947d8e4a73"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
DataConnectionIdpayload.connectionId
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.dataTypeeventType
Data.pushOperationKeypayload.id
Data.pushOperationGuidpayload.id

SyncCompleted

The original rule type is Called when a Sync for Expenses expense sync is completed. The replacement event type is Called only when the sync completes successfully.

Rule typeMaps to event type
Sync Completedexpenses.sync.successful
Compare webhook schemas
{
"AlertId": "33a4f8e9-09ae-4334-9b00-7bbe83024672",
"RuleType": "Sync Completed",
"RuleId": "5c27631d-3b63-4b50-8228-ee502fd113eb",
"ClientId": "30e0f9d2-52c0-4c9f-a806-bcd98a3bcd7e",
"ClientName": "Expense Sync",
"CompanyId": "1f9559e7-8368-48c9-bdf4-f158e16b8b85",
"Message": "Sync 321363b4-efa9-4fbc-b71c-0b58d62f3248 for company 1f9559e7-8368-48c9-bdf4-f158e16b8b85 of type Expense completed successfully.",
"Data": {
"syncId": "321363b4-efa9-4fbc-b71c-0b58d62f3248",
"syncType": "Expense"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.syncIdpayload.syncId
Data.syncTypeeventType

SyncFailed

Called anytime a Sync for Expenses expenses sync fails, this event now follows our updated schema standards.

Rule typeMaps to event type
Sync Failedexpenses.sync.unsuccessful
Compare webhook schemas
{
"AlertId": "72c1103b-7f17-4a3a-8db5-67c2d360a516",
"RuleType": "Sync Failed",
"RuleId": "289c80dc-2aee-4b71-afff-9acd8d051080",
"ClientId": "30e0f9d2-52c0-4c9f-a806-bcd98a3bcd7e",
"ClientName": "Expense Sync",
"CompanyId": "1f9559e7-8368-48c9-bdf4-f158e16b8b85",
"Message": "Sync 3bead2a1-1b3d-4d90-8077-cddc5ca68b01 for company 1f9559e7-8368-48c9-bdf4-f158e16b8b85 of type Expense has failed at step Pushing.",
"Data": {
"syncId": "3bead2a1-1b3d-4d90-8077-cddc5ca68b01",
"syncType": "Expense",
"FailureStage": "Pushing"
}
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.
Data.syncIdpayload.syncId
Data.syncTypeeventType
Data.FailureStageNot replaced. This property is no longer supported.

SyncConnectionDeleted

This legacy event is specific to Sync for Commerce and indicates that a data connection has been deleted. This has now been replaced by the platform-wide connection.deleted event type.

Rule typeMaps to event type
Sync Connection Deletedconnection.deleted
Compare webhook schemas
{
"AlertId": "a9367074-b5c3-42c4-9be4-be129f43577e",
"RuleType": "Sync Connection Deleted",
"RuleId": "70af3071-65d9-4ec3-b3cb-5283e8d55dac",
"ClientId": "bae71d36-ff47-420a-b4a6-f8c9ddf41140",
"ClientName": "Bank of Dave",
"CompanyId": "8a210b68-6988-11ed-a1eb-0242ac120002",
"Message": "Sync connection for company 8a210b68-6988-11ed-a1eb-0242ac120002 deleted",
}

Property mapping

Old schema propertyNew schema property
AlertIdid
RuleTypeeventType
RuleIdStatic Badge
ClientIdNot replaced. If you need the Codat client ID, include it as a custom header in the API request. See Custom headers.
ClientNameNot replaced. If you need the Codat client name, include it as a custom header in the API request. See Custom headers.
CompanyIdpayload.referenceCompany.id
MessageNot replaced. Our email and webhooks services are no longer combined into a single service, making this property redundant.


Was this page useful?
👏
👍
🤔
👎
😭