> For the complete documentation index, see [llms.txt](https://docs.somewear.app/developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.somewear.app/developer-docs/webhooks/quick-start.md).

# Quick Start

## Sample Repo

<https://github.com/somewear-labs/hello-space-server>

## Configure

{% hint style="danger" %}
You must have a Somewear Organization to create webhooks. If you're interested in setting up a Somewear Organization with our team/enterprise plans, please inquire at <https://somewearlabs.com/> or contact <sales@somewearlabs.com>.
{% endhint %}

1. Sign into the Somewear web app at <https://somewear.app>.
2. Navigate to your **Organization Settings** page by clicking `Account > Settings`.
3. Click `Add Server Connection > Webhook`.
4. Fill out the name & URL for your webhook. Somewear will send a HTTP POST request to this address. You can include basic credentials in the **Authentication Credentials** section or any other required headers like API keys in the **Custom Headers** section.
5. Click submit and the webhook will be tested with a health check request.
6. Upon save, click the settings icon to configure which Workspaces will push data to your webhook.

## JSON

<details>

<summary>Location</summary>

```json
{
  "requestId": "66ef6f9b-8870-4e18-99e1-f14ee7eae91d",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "device": {
        "id": "0",
        "serial": "SERIAL"
      },
      "events": [
        {
          "type": "Location",
          "latitude": "37.781001",
          "longitude": "-122.393456",
          "altitude": "1000.0",
          "timestamp": "2023-04-12T19:15:14Z"
        }
      ]
    }
  ]
}
```

</details>

<details>

<summary>Data</summary>

```json
{
  "requestId": "fe06b693-af2e-49da-963b-97fddaaa97eb",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "device": {
        "id": "0",
        "serial": "SERIAL"
      },
      "events": [
        {
          "type": "Data",
          "payload": "VGVzdAo=",
          "timestamp": "2023-04-12T18:56:32Z"
        }
      ]
    }
  ]
}
```

</details>

<details>

<summary>Message</summary>

```json
{
  "requestId": "66ef6f9b-8870-4e18-99e1-f14ee7eae91d",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "device": {
        "id": "0",
        "serial": "SERIAL"
      },
      "events": [
        {
          "type": "Message",
          "timestamp": "2023-04-12T19:15:14Z"
          "content": "Example content"
        }
      ]
    }
  ]
}
```

</details>

<details>

<summary>Sos Event</summary>

```json
{
  "requestId": "66ef6f9b-8870-4e18-99e1-f14ee7eae91d",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "device": {
        "id": "0",
        "serial": "SERIAL"
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "events": [
        {
          "type": "SosEvent",
          "eventType": "Alarm",
          "sessionId": "0",
          "latitude": "37.781001",
          "longitude": "-122.393456",
          "timestamp": "2023-04-12T19:15:14Z"
        }
      ]
    }
  ]
}
```

```
eventType:
  Alarm - When the user first triggers the SOS
  AlarmCancel - When the user resolves their SOS
```

</details>
