> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/integrations/webhook-notifications/events.md).

# Events

## Project created

A `PROJECT_CREATED` event will be sent when a new project is created.

### Example

#### Request body

All JSON examples have been prettified for documentation purposes.

```json
{
  "eventType": "PROJECT_CREATED",
  "data": {
    "timestamp": "2023-11-17T09:02:45.258Z",
    "project": {
      "id": "N2E4MjNlYTc",
      "name": "hamlet.TXT",
      "tags": [
        "CUSTOM"
      ]
    },
    "team": {
      "id": "1",
      "name": "User's Team Workspace"
    }
  }
}
```

#### Request header

{% code overflow="wrap" %}

```json
{
  "accept-encoding": "gzip, compress, deflate, br",
  "accept": "application/json, text/plain, */*",
  "content-length": "200",
  "content-type": "application/json",
  "user-agent": "Datasaur",
  "x-datasaur-signature": "643a34cd1a649b37a6d3611ff7fb561a0255e899ca89a9475c79b38764775033"
}
```

{% endcode %}

## Before update labels

A `BEFORE_UPDATE_LABELS` event will be sent just before the labeler apply a new label or update an existing label.

### Example

#### Request body

```json
{
  "eventType": "BEFORE_UPDATE_LABELS",
  "data": {
    "timestamp": "2023-11-17T09:49:54.108Z",
    "document": {
      "id": "cdf0631f-66b6-4330-be05-4c87fd169afb",
      "originId": "97812272-e8cd-4f92-97e3-e83de1e33db0",
      "name": "hamlet.TXT",
      "fileName": "hamlet.TXT",
      "createdAt": "2023-11-17T09:48:41.000Z",
      "lastSavedAt": "2023-11-17T09:48:41.048Z"
    },
    "isReviewDocument": false,
    "labelUpdateList": {
      "toDeleteList": [],
      "toUpsertList": [
        {
          "documentId": "cdf0631f-66b6-4330-be05-4c87fd169afb",
          "startCellIndex": 0,
          "startCellLine": 0,
          "startTokenIndex": 0,
          "startCharIndex": 0,
          "endCellIndex": 0,
          "endCellLine": 0,
          "endTokenIndex": 0,
          "endCharIndex": 2,
          "counter": 0,
          "layer": 0,
          "labeledBy": "LABELER",
          "type": "SPAN",
          "labelSetItemId": "geo",
          "confidenceScore": null,
          "labeledByUserId": 1
        }
      ]
    },
    "owner": {
      "id": "1",
      "email": "user+1@datasaur.ai",
      "username": "",
      "name": ""
    },
    "team": {
      "id": "1"
    }
  }
}
```

#### Request header

{% code overflow="wrap" %}

```json
{
  "accept-encoding": "gzip, compress, deflate, br",
  "accept": "application/json, text/plain, */*",
  "content-length": "808",
  "content-type": "application/json",
  "user-agent": "Datasaur",
  "x-datasaur-signature": "4dd97f9908612bc4d0a7bc7bd0135c72fd5cc51a47e465f274233732e4733271"
}
```

{% endcode %}

## Project completed

A `PROJECT_COMPLETED` event will be sent after the labeler marks the project as complete in labeler mode.

### Example

#### Request body

```json
{
  "eventType": "PROJECT_COMPLETED",
  "data": {
    "timestamp": "2023-11-17T09:52:57.478Z",
    "labeler": {
      "id": "1",
      "email": "user+1@datasaur.ai",
      "username": "",
      "name": ""
    },
    "project": {
      "id": "ZTYzZjRhYjE",
      "name": "hamlet.TXT",
      "tags": [
        "CUSTOM"
      ]
    },
    "team": {
      "id": "1"
    }
  }
}
```

#### Request header

{% code overflow="wrap" %}

```json
{
  "accept-encoding": "gzip, compress, deflate, br",
  "accept": "application/json, text/plain, */*",
  "content-length": "243",
  "content-type": "application/json",
  "user-agent": "Datasaur",
  "x-datasaur-signature": "ff872ff9b07652a35ced110de99f190dd159814d04836a5fdb5b73bdf0396db0"
}
```

{% endcode %}

## Project reviewed

A `PROJECT_REVIEWED` event will be sent after the reviewer marks the project as complete in reviewer mode.

### Example

#### Request body

```json
{
  "eventType": "PROJECT_REVIEWED",
  "data": {
    "timestamp": "2023-11-17T09:53:23.514Z",
    "reviewer": {
      "id": "1",
      "email": "user+1@datasaur.ai",
      "username": "",
      "name": ""
    },
    "project": {
      "id": "ZTYzZjRhYjE",
      "name": "hamlet.TXT",
      "tags": [
        "CUSTOM"
      ]
    },
    "team": {
      "id": "1"
    }
  }
}
```

#### Request header

{% code overflow="wrap" %}

```json
{
  "accept-encoding": "gzip, compress, deflate, br",
  "accept": "application/json, text/plain, */*",
  "content-length": "243",
  "content-type": "application/json",
  "user-agent": "Datasaur",
  "x-datasaur-signature": "f9e52fba3fe2f74467f81dd7b3f0569610ffc4b428ad23939d69621d13af0a68"
}
```

{% endcode %}


---

# 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://docs.datasaur.ai/integrations/webhook-notifications/events.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.
