Events

Create an event

POST

Request

This endpoint expects an object.
context
objectRequired
The context of the event
domain
enumRequired
The domain of the event
payload
map from strings to anyRequired
topic
enumRequired
The topic of the event
attributes
objectOptional
The attributes of the event
callbackUrl
stringOptional
The callback url to acknowledge the event
dataUrl
stringOptional
The url to retrieve the data associated with the event
deletedAt
datetimeOptional
Date the event was deleted
namespaces
list of stringsOptional
origin
objectOptional
The origin resource of the event
target
stringOptional

Response

This endpoint returns an object
data
union
An event that tracks an activity within an environment

Errors

POST
$curl -X POST https://api.x.flatfile.com/v1/events \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "context": {
> "accountId": "us_acc_YOUR_ID",
> "environmentId": "us_env_YOUR_ID",
> "spaceId": "us_sp_YOUR_ID",
> "workbookId": "us_wb_YOUR_ID",
> "actorId": "us_key_SOME_KEY"
> },
> "domain": "workbook",
> "payload": {
> "recordsAdded": 100
> },
> "topic": "workbook:updated"
>}'
Response
1{
2 "data": {
3 "topic": "workbook:updated",
4 "context": {
5 "accountId": "us_acc_YOUR_ID",
6 "environmentId": "us_env_YOUR_ID",
7 "spaceId": "us_sp_YOUR_ID",
8 "workbookId": "us_wb_YOUR_ID",
9 "actorId": "us_key_SOME_KEY"
10 },
11 "createdAt": "2023-11-07T20:46:04.300Z",
12 "domain": "workbook",
13 "id": "us_evt_YOUR_ID",
14 "payload": {
15 "recordsAdded": 100
16 },
17 "callbackUrl": "",
18 "dataUrl": "",
19 "namespaces": [
20 "workbook"
21 ],
22 "origin": {
23 "id": "us_wb_YOUR_ID"
24 }
25 }
26}