Receiving job updates

Last updated 8 months ago

Webhooks can be used to receive job updates such as status changes. A subscribed webhook will receive job updates in a similar format to the other job endpoints.

post
Create a webhook

https://prod-api.spatula.io
/v2/graph/role/webhooks?access_token=API_TOKEN
This request is used to create webhooks
Request
Response
Query Parameters
access_token
optional
string
API access token
Body Parameters
target
optional
string
the URL to receive job updates e.g. https://my-server.com/my-webhook
event
required
string
must contain the value "role/jobs"
200: OK
The webhook was been registered successfully

get
List webhooks

https://prod-api.spatula.io
/v2/graph/role/webhooks?access_token=API_TOKEN
This request lists webhooks associated with your account
Request
Response
Query Parameters
access_token
required
string
API access token
200: OK
The items field lists webhooks associated with your account
{
"items": [
{
"created": 1531731919672,
"id": 5787259168,
"event": "/role/jobs",
"group": 5785800772,
"target": "https://some-server.io/example-webhook"
},
{
"created": 1531731919672,
"id": 5787259213,
"event": "role/jobs",
"group": 5785800772,
"target": "http://another-webhook-server.com"
}
]
}

delete
Delete a webhook

https://prod-api.spatula.io
/v2/graph/role/webhooks/:id?access_token=API_TOKEN
Request
Response
Path Parameters
:id
required
string
id of webhook to be deleted
Query Parameters
access_token
optional
string
API access token
200: OK
The webhook was successfully deleted