---
title: "Create a subscription"
method: POST
path: "/api/v1/hooks/subscriptions/"
tags: ["webhooks"]
---

# Create a subscription

`POST /api/v1/hooks/subscriptions/`

Create a subscription for an event type. When an event is triggered in the Prolific system, the hook will automatically notify the specified target URL.

Before creating a subscription, you must ensure that you have created a secret for your workspace.

## Headers

- `Authorization` string, required

## Request body

- SubscriptionDetail
  - `id` string — The ID of the subscription.
  - `event_type` string, required — The name of the event type associated to the subscription.
  - `target_url` string, required — The URL that the subscription will notify when your event type is triggered.
  - `is_enabled` boolean — Whether the subscription is enabled or not.
  - `workspace_id` string, required — The ID of the workspace we will create the subscription in.

## Response `201`

Created

- SubscriptionList
  - `results` SubscriptionDetail[], required — List of all subscriptions.
    - `id` string — The ID of the subscription.
    - `event_type` string, required — The name of the event type associated to the subscription.
    - `target_url` string, required — The URL that the subscription will notify when your event type is triggered.
    - `is_enabled` boolean — Whether the subscription is enabled or not.
    - `workspace_id` string, required — The ID of the workspace we will create the subscription in.

## Other responses

- `400` — Error

---

[API](https://skmtc.net/prolific/apis/api-reference.md) · [All operations](https://skmtc.net/prolific/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prolific/api-reference/versions/5c53371c41a0/schema)
