Every webhook Content Snare sends is a JSON object, and its structure depends on the event. Most events send one flat object. The event_name is at the top, next to the record's own fields. A few events (email, SMS and request-viewed) arrange things differently, and those are covered below. To turn webhooks on and choose which events you receive, see Webhooks.
What's in every payload
event_nametells you which event fired. It's the machine name, and a few of them don't match the label you picked when you set the webhook up. Deleting a request sendsrequest_destroyed, moving a request to another Board stage sendsrequest_board_column_changed, and saving a draft sendsrequest_draft. Key your handler off theevent_namestring.- IDs are prefixed strings, like
req_7v80jRXC4M0mAofor a request orfld_B783LN8u6LaeEqfor a field. Each record type has its own prefix:req_for requests,fld_for fields,sec_for sections,pag_for pages,acc_for people,cmp_for companies. Treat them as opaque text, not numbers. - Links point to
app.contentsnare.com. Theurlandshare_linkfields hold the live web address of the request.
A basic request payload looks like this:
{
"event_name": "request_created",
"id": "req_7v80jRXC4M0mAo",
"name": "Example Request",
"status": "draft",
"url": "https://app.contentsnare.com/requests/EXAMPLE_ONLY",
"due_date": "2024-10-20",
"folder_name": "Default Folder",
"request_template_name": "Example Template",
"communications_template_name": "Default",
"completion_percentage": 0,
"owner_name": "Example Owner",
"author_name": "Example Author",
"client": {
"id": "acc_3Z02jLuqYAN0eX",
"company_name": "Example Company",
"email": "example@example.com",
"full_name": "Example Client",
"phone": "123-456-7890",
"avatar": null
}
}
Every payload except the three *_destroyed events carries a clients array with one entry per client, alongside the single client object.
Request payloads also carry a wildcards object with the value of each variable you can use in instructions, such as client.contact and request.due_date, filled in for the primary client. The two clients.* variables are the exception: each is a list with one entry per client, primary client first. The values are raw text, not HTML-escaped, so sanitize them before you show them on a web page. request_board_column_changed doesn't include it.
Which events include your client's answers
Only some events include answers. When they do, the payload adds a pages array containing the full tree of pages, sections and fields, with each field's values. These events include the answer tree:
request_published,request_scheduledandrequest_archivedrequest_completed,request_expiredandrequest_waiting_for_approvalall_fields_completed
request_created, request_updated and request_draft include only the request's details. If you need the answers, subscribe to one of the events above.
The pages array looks like this:
"pages": [
{
"name": "About your business",
"instruction_text": "",
"sections": [
{
"name": "Company details",
"instruction_text": "",
"fields": [
{
"name": "Business name",
"type": "text",
"status": "done",
"confidential": false,
"values": ["Acme Pty Ltd"],
"values_flat": "Acme Pty Ltd"
}
],
"fields_count": 1
}
],
"fields_count": 1
}
]
Each field has a type (the question type as a lowercase string, such as text, number, file or checkbox), a status, the answer in a values array, and the same answer as plain text in values_flat. Field types lists every question type Content Snare offers.
- Every field is included. The payload holds your clients' real answers, so send it to an endpoint you control and keep it private.
- Files and images arrive as download links, not the files themselves. A file answer's
valueshold a URL you fetch the file from. Those links point to the stored file, so treat them as sensitive as well. - Variables in
instruction_textstay as tags. Pages, sections and fields send their instruction text with the variable tags as you typed them. Read the filled-in values fromwildcards.
In the all_fields_completed payload, the request and its answers are nested under a request key.
Field, section and page events
field_completed, field_approved and field_rejected each report a single field. The field's own details are at the top, with the request nested under a request key:
{
"event_name": "field_completed",
"id": "fld_B783LN8u6LaeEq",
"name": "Business name",
"type": "text",
"status": "done",
"values": ["Acme Pty Ltd"],
"values_flat": "Acme Pty Ltd",
"section_id": "sec_36DNbxLI29QbxV",
"section_name": "Company details",
"page_id": "pag_k5vqbXLtO5r9YP",
"page_name": "About your business",
"request": {
"id": "req_7v80jRXC4M0mAo",
"name": "Example Request",
"status": "published",
"url": "https://app.contentsnare.com/requests/EXAMPLE_ONLY"
}
}
section_completed and page_completed are narrower. section_completed sends the section with its fields and its request. page_completed sends the page with its sections, their fields, and the request. Neither carries the whole request-level pages tree.
Comments
A new comment sends comment_created. The commenter is under an account object, and the comment text comes as HTML. The tab_id is the page the comment is on:
{
"event_name": "comment_created",
"id": "com_RJ1zp49c7Xz4km",
"answer_id": "ans_RQ1zp49c7Xz4km",
"field_id": "fld_1lqbwY6TaMPmAo",
"section_id": "sec_YlVGMK1svdga0D",
"tab_id": "pag_jAxqEgBi4prM6g",
"request_id": "req_1k7zv4aUlpN8PB",
"text": "<div>Looks good, thanks</div>",
"type": "user",
"unread": false,
"reference_meta": {},
"account": {
"id": "acc_e7EVAXvJfxZ9zb",
"full_name": "Example Client",
"email": "client@example.com",
"company_name": "New company",
"client_company": {
"id": "cmp_z105QJxhy7YdlX",
"name": "New company",
"avatar_url": null
}
}
}
The email, SMS and request-viewed events
Six events use a different structure: email_delivered, email_bounced, email_spam_complained, sms_delivered, sms_failed and request_viewed. Instead of the record's fields at the top, they have id, request_id, account_id, an event_type, and a parameters object with the event's detail. The request and client are nested under their own keys:
{
"event_name": "email_delivered",
"id": "evt_oenkkeur60WnWV",
"request_id": "req_EwzeeKIpx22zjP",
"account_id": "acc_3Z02jLuqYAN0eX",
"event_type": "actions",
"parameters": {
"from": "example <donotreply@contentsnare-mail.com>",
"email": "example@example.com",
"status": "email_delivered",
"subject": "Information required for New Request"
},
"client": {
"id": "acc_3Z02jLuqYAN0eX",
"full_name": "Example Client",
"email": "example@example.com",
"company_name": "",
"client_company": null
},
"request": {
"id": "req_EwzeeKIpx22zjP",
"name": "New Request",
"status": "published",
"url": "https://app.contentsnare.com/requests/EXAMPLE_ONLY"
}
}
Read the event's detail out of parameters. When a message fails, parameters adds an error_messages array explaining why. Both sms_failed and email_bounced use it. The event_type marks severity: actions for a normal delivery, critical for a failure, warning for a spam complaint.
Client, team member and product events
- Clients.
client_createdandclient_updatedare flat objects holding the client'sid(anacc_string),full_name,email,phone,company_nameandavatar. - Team members.
team_member_createdandteam_member_updatedinclude the member's contact details in the same flat format, with anacc_id. - Deletions.
request_destroyed,client_destroyedandteam_member_destroyedsend only theevent_nameand the deleted record'sid, nothing else. - Board stage moves.
request_board_column_changedadds aboard_columnobject to the usual request payload, withid,name,sorting_positionandprotected. The same object also arrives underboard_column_attrs. That copy is deprecated and will be removed, so readboard_column. - Credit purchases.
product_item_manual_purchaseon a direct purchase,product_item_auto_purchaseon an automatic top-up, andproduct_item_purchase_failedwhen one doesn't go through. These are a different shape from the credit-usage events below.
| Field | What it holds |
|---|---|
id | The payment's prefixed id |
status | paid on a successful purchase |
payment_initiator | customer or merchant |
quantity | How many credits |
product | What was bought |
invoice | The invoice id, when there is one |
errors | Present only on a failed purchase |
Scroll sideways to see the whole table
{
"event_name": "product_item_manual_purchase",
"id": "pay_M1yg0LAfjBg9rD",
"status": "paid",
"payment_initiator": "customer",
"quantity": 50,
"product": "identityverification",
"invoice": "inv_EXAMPLE",
"account_id": "acc_vK7Zym9U35Z69l"
}
- Verification credits used.
product_item_used,product_item_returnedandproduct_item_exhaustedreport ID verification credits being spent. Each is flat and names theproduct, thequantity, and the request, page, section and field it relates to:
{
"event_name": "product_item_used",
"id": "vss_M1yg0LAfjBg9rD",
"quantity": 1,
"product": "identityverification",
"client_full_name": "Example Client",
"client_email": "example@example.com",
"request_name": "Website Page Information",
"request_id": "req_7v80jRXC4M0mAo",
"page_id": "pag_k5vqbXLtO5r9YP",
"section_id": "sec_36DNbxLI29QbxV",
"field_id": "fld_B783LN8u6LaeEq",
"account_id": "acc_vK7Zym9U35Z69l"
}
When an action fails
The create, update and delete events have failed counterparts, such as request_create_failed and client_update_failed. A failed payload looks like its successful version with an errors array added, listing what went wrong. On a create failure the record was never saved, so id is null. On an update or delete failure the record exists, so id holds its real prefixed id.
{
"event_name": "request_create_failed",
"id": null,
"name": "Example Request",
"status": "draft",
"client": {
"id": "acc_3Z02jLuqYAN0eX",
"full_name": "Example Client",
"email": "example@example.com"
},
"errors": [
"First error message example",
"Second error message example"
]
}
A failure arrives under its own event_name, such as request_create_failed, so you can catch it by name.