---
title: "Creates a new webhook subscription. On success, returns the ID of the new webhook subscription."
method: POST
path: "/api/Webhook"
tags: ["Webhook"]
---

# Creates a new webhook subscription. On success, returns the ID of the new webhook subscription.

`POST /api/Webhook`

When you receive a webhook, you should respond with Http 200 OK Status Code, otherwise we will retry. To create a webhook, you need both the webhook_notifications scope, as well as the scope for the required entity being monitored.  Event values are: "company_created", "company_deleted", "company_updated", "contact_created", "contact_deleted", "contact_updated", "invoice_created", "invoice_sent","invoice_updated","invoice_deleted", "project_created", "project_deleted", "project_updated", "task_created", "task_updated","task_deleted", "timesheet_created", "timesheet_deleted", "timesheet_updated, "bill_created", "bill_updated", "estimate_created", "estimate_updated", "estimate_deleted", "expense_created", "expense_updated", "expense_deleted", "scheduleseries_created", "scheduleseries_updated", "scheduleseries_deleted", "team_member_created", "team_member_updated", "team_member_deleted".  You can subscribe to any webhook, but you will only receive notifications for data appropriate to the roles of your user account. There is an optional  Secret parameter (string 255 char max). This allows for webhook authentication. If provided, the Secret will be BASE 64 encoded and passed with notications as a basic authentication http header. i.e. Authorization Basic [BASE64 of Secret]"

## Request body

- CreateSubscription — New Subscription to be Created
  - `target_url` string, required — The URL that should be notified of the event.
  - `event` string, required — The event code to be notified about. Possible values: company_created, company_deleted, company_updated, contact_created, contact_deleted, contact_updated, invoice_created, invoice_sent, invoice_updated, invoice_deleted, project_created, project_deleted, project_updated, task_created, task_updated, task_deleted, timesheet_created, timesheet_deleted, timesheet_updated, bill_created, bill_updated, estimate_created, estimate_updated, estimate_deleted, team_member_created, team_member_updated, team_member_deleted
  - `secret` string — Optional Secret string (255 char max). If provided, the secret will be BASE 64 encoded and used as a basic authentication http header with webhook notifications. i.e. Authorization Basic [BASE64 of Secret]"

## Response `201`

Subscription created

- SubscribeResult — Result of creating a webhook subscription, containing the new Subscription ID.
  - `ID` integer — The ID of the newly created webhook subscription.

## Other responses

- `401` — Unauthorized
- `409` — Duplicate subscription already exists

---

[API](https://skmtc.net/avaza/apis/avaza-api-documentation.md) · [All operations](https://skmtc.net/avaza/apis/avaza-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/avaza/avaza-api-documentation/versions/1eeadf750514/schema)
