Skip to content
Content SnareHelp centre

Webhook payload examples

Quick answer

A Content Snare webhook sends a JSON object with an `event_name` that tells you which event fired. Only some events include your client's answers, such as `request_completed` and `request_published`. `request_created` and `request_updated` send only the request's details.

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_name tells 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 sends request_destroyed, moving a request to another Board stage sends request_board_column_changed, and saving a draft sends request_draft. Key your handler off the event_name string.
  • IDs are prefixed strings, like req_7v80jRXC4M0mAo for a request or fld_B783LN8u6LaeEq for 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. The url and share_link fields 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_scheduled and request_archived
  • request_completed, request_expired and request_waiting_for_approval
  • all_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 values hold a URL you fetch the file from. Those links point to the stored file, so treat them as sensitive as well.
  • Variables in instruction_text stay as tags. Pages, sections and fields send their instruction text with the variable tags as you typed them. Read the filled-in values from wildcards.

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_created and client_updated are flat objects holding the client's id (an acc_ string), full_name, email, phone, company_name and avatar.
  • Team members. team_member_created and team_member_updated include the member's contact details in the same flat format, with an acc_ id.
  • Deletions. request_destroyed, client_destroyed and team_member_destroyed send only the event_name and the deleted record's id, nothing else.
  • Board stage moves. request_board_column_changed adds a board_column object to the usual request payload, with id, name, sorting_position and protected. The same object also arrives under board_column_attrs. That copy is deprecated and will be removed, so read board_column.
  • Credit purchases. product_item_manual_purchase on a direct purchase, product_item_auto_purchase on an automatic top-up, and product_item_purchase_failed when 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
{
  "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_returned and product_item_exhausted report ID verification credits being spent. Each is flat and names the product, the quantity, 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.