> For the complete documentation index, see [llms.txt](https://developers.socialboards.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.socialboards.com/docs/apis/tickets/webhooks/create-endpoint.md).

# Create Endpoint

Your endpoint must be able to process two types of HTTPS requests: Verification Requests and Event Notifications. Since both requests use HTTPs, your server must have a valid TLS or SSL certificate correctly configured and installed. Self-signed certificates are not supported.

The sections below explain what will be in each type of request and how to respond to them.

**Verification Requests**

Anytime you configure the Webhooks product in your community settings page, we'll send a GET request to your endpoint URL. Verification requests include the following query string parameters, appended to the end of your endpoint URL. They will look something like this:

```
GET https://www.your_domain_name.com/webhooks?
  challenge=2135675231&
  verifyToken=someverificationtoken
```

**Validating Verification Requests**

Whenever your endpoint receives a verification request, it must:

* Verify that the *`verifyToken`* value matches the string you set in the **Verify Token** field when you configure the Webhooks product in your community settings.

  (you will set up this token during configuring webhooks).
* Respond body should should contain `challenge` value.

#### Event Notifications

When you configure your Webhooks product, you will subscribe to specific events on an object type (e.g., the status change event on the ticket object). Whenever such event happened, we will send your endpoint a POST request with a JSON payload describing the change. For example, let's say you set up a “Ticket”

Webhook and subscribed to “Status changed” event. If ticket’s status was changed from “open” to “pending”, we'd send you a notification that would look like this:

```json
{
	"CommunityName": "yourCompany",
	"EventType": "ticket_status_change",
	"Events": [
		{
			"InboxLink": "https://inbox.socialboards.com/yourCompany/tickets?ticketId=4478963",
			"PreviousTicketStatus": "open",
			"Ticket": {
				"Author": {
					"CustomIdentifier": null,
					"Id": "35692164-bfaa-4c49-a23c-ecfa618f7d20",
					"Name": "Robert Baker",
					"Image": null,
					"Email": "robert78baker@gmail.com",
					"Status": "client",
					"IsBot": false
				},
				"Category": {
					"Id": 15721,
					"Name": "Other cases",
					"Parents": []
				},
				"CreationTime": "2019-12-17T08:03:48.318717+01:00",
				"DetailedSource": "web_website",
				"Id": 4478963,
				"LastThreadElementCreationTime": "2019-12-17T08:10:03.8181291+01:00",
				"LockedBy": null,
				"Message": "I want to take my cat to a vet",
				"OriginalLink": null,
				"Properties": {
					"IsAnonymized": false,
					"IsMuted": false,
					"HasAttachments": false,
					"HasDraft": false,
					"IsAssignedToBot": false,
					"IsDeleted": false,
					"IsExpired": false,
					"IsHidden": false,
					"IsLocked": false,
					"IsSpam": false,
					"IsSensitive": false
				},
				"ReplyCount": 1,
				"Sentiment": "question",
				"Source": "web",
				"SourceName": null,
				"Status": "pending",
				"Title": "Cat is ill",
				"HtmlMessage": "I want to take my cat to a vet"
			},
			"TicketId": 4478963
		}
	]
}

```

**Payload Contents**

We format all payloads with JSON, so you can parse the payload using common JSON parsing methods or packages.

{% hint style="info" %}
We do not store any Webhook event notification data that we send you, so be sure to capture and store any payload content that you want to keep.
{% endhint %}

The structure of the JSON body you receive, will look like this:

```json
{
	"CommunityName": "yourCompany",
	"EventType": "note_deletion",
	"Events": [
		{
			"NoteId": 182605
		}
	]
}
```

More info about event payload structure you can get in the [following document.](/docs/apis/tickets/reference/webhook-payload.md)

#### Responding to Event Notifications

Your endpoint should respond to all Event Notifications with 200 OK HTTPS. Your endpoint should respond to all webhook events in 20 seconds or less.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.socialboards.com/docs/apis/tickets/webhooks/create-endpoint.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
