---
title: "Create subscription"
method: POST
path: "/api/v1/projects/{projectId}/subscriptions"
tags: ["Subscriptions"]
---

# Create subscription

`POST /api/v1/projects/{projectId}/subscriptions`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/projects/{projectId}/subscriptions`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Subscribes an endpoint to specific event types

## Path parameters

- `projectId` string, uuid, required

## Request body

- SubscriptionRequest
  - `endpointId` string, uuid, required
  - `eventType` string, required
  - `enabled` boolean
  - `orderingEnabled` boolean
  - `maxAttempts` integer
  - `timeoutSeconds` integer
  - `retryDelays` string
  - `retryableStatuses` string
  - `payloadTemplate` string
  - `customHeaders` string
  - `transformationId` string, uuid

## Response `201`

Subscription created

---

[API](https://skmtc.dev/railhook/apis/railhook-api.md) · [All operations](https://skmtc.dev/railhook/apis/railhook-api/llms.txt) · [OpenAPI document](https://skmtc.dev/railhook/apis/railhook-api/revisions/4e2c76dfc33d?raw)
