> For the complete documentation index, see [llms.txt](https://docs.ushahidi.com/v3-ushahidi-platform-rest-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ushahidi.com/v3-ushahidi-platform-rest-api-documentation/v3/webhooks.md).

# Webhooks

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/webhooks" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

## add webhooks

<mark style="color:green;">`POST`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/webhooks`

#### Request Body

| Name                    | Type    | Description                  |
| ----------------------- | ------- | ---------------------------- |
| user\_id                | Integer | The user identifier          |
| webhook\_uuid           | String  | Webhook unique ID            |
| shared\_secret          | String  | The shared secrete unique ID |
| name                    | String  | Webhook name                 |
| form\_id                | String  | The form identifier          |
| destination\_field\_key | String  |                              |
| event\_type             | String  | The event type               |
| url                     | String  | Webhook URL                  |
| source\_field\_key      | String  |                              |
| entity\_type            | String  | Entity type                  |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": 6,
    "url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
    "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
    },
    "form_id": null,
    "name": "test",
    "shared_secret": "test123estfds78#43fds",
    "webhook_uuid": "4472f128-4448-482a-b279-5a218d3ce559",
    "event_type": "create",
    "entity_type": "post",
    "source_field_key": null,
    "destination_field_key": null,
    "created": "2022-11-02T20:00:00+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/webhooks/2" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

## edit webhooks

<mark style="color:orange;">`PUT`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/webhooks/2`

#### Request Body

| Name                    | Type    | Description                  |
| ----------------------- | ------- | ---------------------------- |
| user\_id                | Integer | The user identifier          |
| webhook\_uuid           | String  | Webhook unique ID            |
| shared\_secret          | String  | The shared secrete unique ID |
| name                    | String  | Webhook name                 |
| form\_id                | String  | The form identifier          |
| destination\_field\_key | String  |                              |
| event\_type             | String  | The event type               |
| url                     | String  | Webhook URL                  |
| source\_field\_key      | String  |                              |
| entity\_type            | String  | Entity type                  |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "id": 6,
    "url": "http://services.nationalmap.gov/ArcGIS/services/NEXRAD_Weather/MapServer/WMSServer",
    "user": {
        "id": 1,
        "url": "http://localhost:8000/api/v3/users/1"
    },
    "form_id": null,
    "name": "test",
    "shared_secret": "test123estfds78#43fds",
    "webhook_uuid": "4472f128-4448-482a-b279-5a218d3ce559",
    "event_type": "create",
    "entity_type": "post",
    "source_field_key": null,
    "destination_field_key": null,
    "created": "2022-11-02T20:00:00+00:00",
    "updated": null,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/webhooks/3" method="delete" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

## edit a webhook post

<mark style="color:orange;">`PUT`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/webhooks/posts/96`

#### Request Body

| Name             | Type    | Description                                                                  |
| ---------------- | ------- | ---------------------------------------------------------------------------- |
| form\_id         | Integer | Form unique identifier                                                       |
| slug             | String  | Post slug                                                                    |
| type             | String  | Post type                                                                    |
| message          | String  | Additiong message for post                                                   |
| url              | String  | Post URL                                                                     |
| author\_email    | String  | Email address of source                                                      |
| title            | String  | Title of the new post                                                        |
| content          | String  | Post content                                                                 |
| user\_id         | Integer | The user's unique Identifier                                                 |
| author\_realname | String  | The full name of the Post source                                             |
| status           | String  | The status of post                                                           |
| locale           | String  | Post local language                                                          |
| color            | String  | Post color                                                                   |
| id               | String  | Unique identifier of post                                                    |
| values           | String  | This is an array containing two items, one for the title and the description |
| published\_to    | Array   | This contains an array of where the post was published                       |
| source           | String  | Source of post                                                               |
| sets             | String  | An array of set id's                                                         |
| tags             | String  | Contains an array of tag Id's                                                |
| contact          | String  | Post contact                                                                 |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "id": 0,
  "url": "string",
  "user_id": 0,
  "parent_id": 0,
  "form_id": 0,
  "title": "string",
  "content": "string",
  "message": "string",
  "color": "string",
  "type": "string",
  "slug": "string",
  "author_email": "string",
  "author_realname": 0,
  "status": "string",
  "created": "string",
  "updated": "string",
  "locale": "string",
  "values": [
    "string"
  ],
  "post_date": "string",
  "tags": [
    "string"
  ],
  "published_to": [
    0
  ],
  "completed_stages": [
    0
  ],
  "sets": [
    0
  ],
  "lock": "string",
  "source": "string",
  "data_source_message_id": "string",
  "allowed_privileges": [
    "string"
  ]
}
```

{% endtab %}
{% endtabs %}
