---
title: "Subscribe webhook to a workspace"
method: POST
path: "/api/v1/workspace/{workspace_id}/webhooks"
tags: ["Webhooks"]
---

# Subscribe webhook to a workspace

`POST /api/v1/workspace/{workspace_id}/webhooks`

Subscribe a webhook URL to receive events for every link in the workspace. The endpoint receives a `POST` for each `click`, `link.created`, `link.updated`, and `link.deleted`. Branch on the JSON `event` field; see the Webhooks section for payload shapes.

## Path parameters

- `workspace_id` integer, required

## Request body

- object — Request body for subscribing a webhook
  - `url` string, uri, required — The webhook URL to receive click notifications

## Response `200`

Webhook subscribed

- object — Response after subscribing a webhook
  - `id` string — The webhook URL (used as the hook ID for unsubscribing)

## Other responses

- `400` — Bad request
- `403` — Forbidden

---

[API](https://skmtc.net/linklyhq/apis/linkly-url-shortener-api.md) · [All operations](https://skmtc.net/linklyhq/apis/linkly-url-shortener-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/linklyhq/linkly-url-shortener-api/revisions/351c1f004617/schema)
