---
title: "Subscribe (create subscription)"
method: POST
path: "/subscriptions"
tags: ["webhooks"]
---

# Subscribe (create subscription)

`POST /subscriptions`

A subscription allows you to register a callback URI for events in the EarthCache platform.

## Request body

- SubscriptionCreate
  - `events` string[], required
  - `secret` string — When your `secret` token is set, a hash signature is created with each payload. This hash signature is included with the headers of each request as `x-ec-signature-256`. The intention is to calculate a hash of the payload received using your `secret` token, and check that the hash matches the one from EarthCache.
  - `callback_uri` string, required
  - `callback_headers` object

## Response `201`

Success - subscription created

- 2xxResponse3
  - `data` SubscriptionResource, required
    - `id` string, required
    - `events` string[], required
    - `status` 'active' | 'inactive', required
    - `callback_uri` string, uri, required
    - `callback_headers` object
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `4XX` — Client-side error - invalid request

---

[API](https://skmtc.net/skywatch/apis/api-specification.md) · [All operations](https://skmtc.net/skywatch/apis/api-specification/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/skywatch/api-specification/revisions/51f7c5a8d15d/schema)
