Skip to main content

Events

Unit uses Events to record important changes happening under your org. Once an event is created, it will be delivered to your application via a webhook call.

Our event types follow a specific structure: resource.event.

Each event includes an id field, which uniquely identifies the event instance, and a type field that identifies the type of the event instance.

Each event type includes a different set of attributes and relationships, relevant to that specific event.

Event attributes may contain a set of custom tags inherited from a related resource request.

account.closed#

Occurs when a Deposit Account is closed.

Example account.closed payload:
{  "data": [    {      "id": "269",      "type": "account.closed",      "attributes": {        "createdAt": "2021-04-13T07:40:43.813Z",        "closeReason": "ByCustomer",        "tags": {          "tag": "value"        }      },      "relationships": {        "account": {          "data": {            "id": "10004",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

application.denied#

Occurs when an Application is denied.

Example application.denied payload:
{  "data": [    {      "id": "28",      "type": "application.denied",      "attributes": {        "createdAt": "2020-07-29T12:53:05.882Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "application": {          "data": {            "id": "52",            "type": "individualApplication"          }        }      }    }  ]}

application.pendingReview#

Occurs when an Application is in pendingReview state.

Example application.pendingReview payload:
{  "data": [    {      "id": "28",      "type": "application.pendingReview",      "attributes": {        "createdAt": "2020-07-29T12:53:05.882Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "application": {          "data": {            "id": "52",            "type": "individualApplication"          }        }      }    }  ]}

application.awaitingDocuments#

Occurs when additional Application Documents are required to approve an Application.

Example application.awaitingDocuments payload:
{  "data": [    {      "id": "3000",      "type": "application.awaitingDocuments",      "attributes": {        "createdAt": "2020-07-29T12:53:05.882Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "application": {          "data": {            "id": "87",            "type": "individualApplication"          }        }      }    }  ]}

authorization.created#

Occurs when an Authorization is created.

Example authorization.created payload:
{  "data": [    {      "id": "83",      "type": "authorization.created",      "attributes": {        "createdAt": "2021-02-21T07:31:18.692Z",        "cardLast4Digits": "0019",        "recurring": false,        "tags": {          "tag": "value"        }      },      "relationships": {        "authorization": {          "data": {            "id": "98",            "type": "authorization"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

authorizationRequest.approved#

Example authorizationRequest.approved payload:
{  "data": [    {      "id": "412",      "type": "authorizationRequest.approved",      "attributes": {        "createdAt": "2021-06-24T08:10:08.081Z",        "amount": 2000,        "status": "Approved",        "approvedAmount": 2000,        "partialApprovalAllowed": false,        "merchant": {          "name": "Merchant name",          "type": "6012"        },        "recurring": false,        "tags": {          "tag": "value"        }      },      "relationships": {        "authorizationRequest": {          "data": {            "id": "6",            "type": "purchaseAuthorizationRequest"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        },        "card": {          "data": {            "id": "7",            "type": "card"          }        }      }    }  ]}

authorizationRequest.declined#

Example authorizationRequest.declined payload:
{  "data": [    {      "id": "412",      "type": "authorizationRequest.declined",      "attributes": {        "createdAt": "2021-06-24T08:10:08.081Z",        "amount": 2000,        "status": "Declined",        "declineReason": "InsufficientFunds",        "partialApprovalAllowed": false,        "merchant": {          "name": "Merchant name",          "type": "6012"        },        "recurring": false,        "tags": {          "tag": "value"        }      },      "relationships": {        "authorizationRequest": {          "data": {            "id": "6",            "type": "purchaseAuthorizationRequest"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        },        "card": {          "data": {            "id": "7",            "type": "card"          }        }      }    }  ]}

authorizationRequest.pending#

Example authorizationRequest.pending payload:
{  "data": [    {      "id": "412",      "type": "authorizationRequest.pending",      "attributes": {        "createdAt": "2021-06-24T08:10:08.081Z",        "amount": 2000,        "status": "Pending",        "partialApprovalAllowed": false,        "merchant": {          "name": "Merchant name",          "type": "6012"        },        "recurring": false,        "tags": {          "tag": "value"        }      },      "relationships": {        "authorizationRequest": {          "data": {            "id": "6",            "type": "purchaseAuthorizationRequest"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        },        "card": {          "data": {            "id": "7",            "type": "card"          }        }      }    }  ]}

card.activated#

Occurs when a Card is activated for the first time.

Example card.activated payload:
{  "data": [    {      "id": "73",      "type": "card.activated",      "attributes": {        "createdAt": "2021-02-15T09:23:47.778Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "card": {          "data": {            "id": "6",            "type": "individualDebitCard"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

card.statusChanged#

Occurs when a Card status changes, excluding first time card activation (see card.activated).

Example card.statusChanged payload:
{  "data": [    {      "id": "74",      "type": "card.statusChanged",      "attributes": {        "createdAt": "2021-02-22T09:23:47.778Z",        "newStatus": "Lost",        "previousStatus": "Active",        "tags": {          "tag": "value"        }      },      "relationships": {        "card": {          "data": {            "id": "6",            "type": "individualDebitCard"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

checkDeposit.created#

Occurs when a Check Deposit is created.

Example checkDeposit.created payload:
{  "data": [    {      "id": "382",      "type": "checkDeposit.created",      "attributes": {        "createdAt": "2021-06-06T09:09:15.247Z",        "status": "AwaitingImages"      },      "relationships": {        "checkDeposit": {          "data": {            "id": "122",            "type": "checkDeposit"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

checkDeposit.clearing#

Occurs when a Check Deposit is in the process of being cleared.

Example checkDeposit.clearing payload:
{  "data": [    {      "id": "376",      "type": "checkDeposit.clearing",      "attributes": {        "createdAt": "2021-06-06T07:21:39.509Z",        "previousStatus": "Pending"      },      "relationships": {        "checkDeposit": {          "data": {            "id": "122",            "type": "checkDeposit"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

checkDeposit.sent#

Occurs when a Check Deposit was processed.

Example checkDeposit.sent payload:
{  "data": [    {      "id": "376",      "type": "checkDeposit.sent",      "attributes": {        "createdAt": "2021-06-06T07:21:39.509Z",        "previousStatus": "Clearing"      },      "relationships": {        "checkDeposit": {          "data": {            "id": "122",            "type": "checkDeposit"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

checkDeposit.returned#

Occurs when a Check Deposit was returned.

Example checkDeposit.returned payload:
{  "data": [    {      "id": "376",      "type": "checkDeposit.returned",      "attributes": {        "createdAt": "2021-06-06T07:21:39.509Z",        "previousStatus": "Sent"      },      "relationships": {        "checkDeposit": {          "data": {            "id": "122",            "type": "checkDeposit"          }        },        "account": {          "data": {            "id": "10001",            "type": "account"          }        },        "customer": {          "data": {            "id": "10000",            "type": "customer"          }        }      }    }  ]}

customer.created#

Occurs when a new Customer is created.

Example customer.created payload:
{  "data": [    {      "id": "28",      "type": "customer.created",      "attributes": {        "createdAt": "2020-07-29T12:53:05.882Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "customer": {          "data": {            "id": "52",            "type": "individualCustomer"          }        },        "application": {          "data": {            "id": "52",            "type": "individualApplication"          }        }      }    }  ]}

document.approved#

Occurs when an Application Document is approved.

Example document.approved payload:
{  "data": [    {      "id": "193",      "type": "document.approved",      "attributes": {        "createdAt": "2020-11-09T09:05:49.999Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "document": {          "data": {            "id": "6",            "type": "document"          }        },        "application": {          "data": {            "id": "10009",            "type": "individualApplication"          }        }      }    }  ]}

document.rejected#

Occurs when an Application Document is rejected.

Example document.rejected payload:
{  "data": [    {      "id": "190",      "type": "document.rejected",      "attributes": {        "reason": "blurry image",        "reasonCode": "PoorQuality",        "createdAt": "2020-11-08T18:34:38.533Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "document": {          "data": {            "id": "6",            "type": "document"          }        },        "application": {          "data": {            "id": "10009",            "type": "individualApplication"          }        }      }    }  ]}

payment.clearing#

Occurs when an originated Debit ACH Payment was delivered to the ACH network, but the account was not credited yet.

Example payment.clearing payload:
{  "data": [    {      "id": "290",      "type": "payment.clearing",      "attributes": {        "previousStatus": "Pending",        "createdAt": "2020-11-08T18:34:38.533Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "payment": {          "data": {            "id": "6",            "type": "payment"          }        },        "account": {          "data": {            "id": "10009",            "type": "account"          }        },        "customer": {          "data": {            "id": "10002",            "type": "customer"          }        }      }    }  ]}

payment.sent#

Occurs when an originated ACH Payment was processed by the ACH network.

Example payment.sent payload:
{  "data": [    {      "id": "291",      "type": "payment.sent",      "attributes": {        "previousStatus": "Pending",        "createdAt": "2020-11-08T18:34:38.533Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "payment": {          "data": {            "id": "8",            "type": "payment"          }        },        "account": {          "data": {            "id": "10009",            "type": "account"          }        },        "customer": {          "data": {            "id": "10002",            "type": "customer"          }        }      }    }  ]}

payment.returned#

Occurs when a sent ACH Payment was returned by the ACH network or the receiving bank.

Example payment.returned payload:
{  "data": [    {      "id": "295",      "type": "payment.returned",      "attributes": {        "previousStatus": "Sent",        "createdAt": "2021-01-02T13:38:28.223Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "payment": {          "data": {            "id": "10",            "type": "payment"          }        },        "account": {          "data": {            "id": "10009",            "type": "account"          }        },        "customer": {          "data": {            "id": "10002",            "type": "customer"          }        }      }    }  ]}

statements.created#

Occurs when all Statements were created for the previous month.

Example statements.created payload:
{  "data": [    {      "id": "241",      "type": "statements.created",      "attributes": {        "createdAt": "2021-03-01T00:16:28.911Z",        "period": "2021-02",        "tags": {          "tag": "value"        }      }    }  ]}

transaction.created#

Occurs when a Transaction is created.

Example transaction.created payload:
{  "data": [    {      "id": "34",      "type": "transaction.created",      "attributes": {        "summary": "Funding",        "direction": "Debit",        "amount": "2500",        "createdAt": "2020-07-30T09:17:21.593Z",        "tags": {          "tag": "value"        }      },      "relationships": {        "transaction": {          "data": {            "type": "receivedAch",            "id": "10001"          }        },        "account": {          "data": {            "id": "1000",            "type": "account"          }        },        "customer": {          "data": {            "id": "1",            "type": "customer"          }        },        "payment": {          "data": {            "id": "515",            "type": "payment"          }        }      }    }  ]}

Get by Id#

Get an event resource by id.

VerbGET
Urlhttps://api.s.unit.sh/events/{id}
Required Scopeevents

Response#

Response is a JSON:API document.

200 OK#

FieldTypeDescription
dataEventThe requested resource after the operation was completed.
curl -X GET 'https://api.s.unit.sh/events/10' \-H "Authorization: Bearer ${TOKEN}"

List#

List event resources. Paging can be applied.

VerbGET
Urlhttps://api.s.unit.sh/events
Required Scopeevents

Query Parameters#

NameTypeDefaultDescription
page[limit]integer100Maximum number of resources that will be returned. Maximum is 1000 resources. See Pagination.
page[offset]integer0Number of resources to skip. See Pagination.
filter[type][]string(empty)Optional. Filter Events by Event type.
curl -X GET 'https://api.s.unit.sh/events?page[limit]=20&page[offset]=10' \-H "Authorization: Bearer ${TOKEN}"

Response#

Response is a JSON:API document.

200 OK#

FieldTypeDescription
dataArray of EventArray of event resources.
Example Response:
{  "data": [    {      "id": "231",      "type": "customer.created",      "attributes": {        "createdAt": "2021-03-15T12:20:39.216Z"      },      "relationships": {        "customer": {          "data": {            "id": "10004",            "type": "businessCustomer"          }        }      }    },    {      "id": "230",      "type": "transaction.created",      "attributes": {        "createdAt": "2021-03-15T07:49:09.089Z",        "amount": 10000,        "direction": "Credit",        "summary": "Wire from Sender"      },      "relationships": {        "account": {          "data": {            "id": "10005",            "type": "account"          }        },        "transaction": {          "data": {            "id": "189",            "type": "wireTransaction"          }        },        "customer": {          "data": {            "id": "10000",            "type": "individualCustomer"          }        }      }    }  ]}

Fire Event#

Resend a previously published webhook event.

VerbPOST
Urlhttps://api.s.unit.sh/events/{eventId}
Required Scopeevents-write
Example Request:
curl -X POST 'https://api.s.unit.sh/events/78'-H 'Content-Type: application/vnd.api+json'-H 'Authorization: Bearer ${TOKEN}'--data-raw '{}'