- Attributes
- GET /account/web_hooks
- GET /account/web_hooks/{id}
- POST /account/web_hooks
- PUT /account/web_hooks/{id}
- PUT /account/web_hooks/{id}/disable
- PUT /account/web_hooks/{id}/enable
- DELETE /account/web_hooks/{id}
{
"id": 123,
"target": "Activity",
"event": "create",
"hook": "https://example.org/do-stuff",
"disabled": false,
"disabled_at": null,
"created_at": "2018-10-17T09:33:46Z",
"updated_at": "2018-10-17T09:33:46Z"
}
Retrieve all web hooks:
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/account/web_hooks' \
-H 'Authorization: Token token=YOUR_API_KEY'
This returns an array with complete web hooks information (see Attributes).
Retrieve a single web hook:
curl -X GET \
'https://{domain}.mocoapp.com/api/v1/account/web_hook/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY'
This returns a single web hook representation.
Create a new web hook:
curl -X POST \
'https://{domain}.mocoapp.com/api/v1/account/web_hooks' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"target": "Activity",
"event": "create",
"hook": "https://example.org/do-stuff"
}'
Mandatory fields are marked with a star (*):
- target* – "Activity" (Activity/Company/Contact/Project/Invoice/Offer/Deal/Expense)
- event* – "create" (create/update/delete)
- hook* – "https://example.org/do-stuff"
Update the web hook:
curl -X PUT \
'https://{domain}.mocoapp.com/api/v1/account/web_hooks/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"hook": "https://example.org/v2"
}'
Fields are analogous to the POST request.
Disable the web hook (if already disabled, it does nothing):
curl -X PUT \
'https://{domain}.mocoapp.com/api/v1/account/web_hooks/{id}/disable' \
-H 'Authorization: Token token=YOUR_API_KEY'
Enable the web hook (if already enabled, it does nothing):
curl -X PUT \
'https://{domain}.mocoapp.com/api/v1/account/web_hooks/{id}/enable' \
-H 'Authorization: Token token=YOUR_API_KEY'
Removes the web hook:
curl -X DELETE \
'https://{domain}.mocoapp.com/api/v1/account/web_hooks/{id}' \
-H 'Authorization: Token token=YOUR_API_KEY'