---
title: "Subscribe to event"
method: POST
path: "/hooks"
tags: ["RestHooks"]
---

# Subscribe to event

`POST /hooks`

## Request

- Base URL: `https://api.c1st.com/api`
- URL: `https://api.c1st.com/api/hooks`
- Auth: HTTP bearer

Subscribe to an event like product.created with a callback url to get pinged when the event triggers.

## Request body

- RestHook: Object representing a rest hook subscription.
  - `id` integer: A unique ID. Use this to handle this subscription.
  - `event` string: The event being listened for.
  - `url` string: The event being listened for.
  - `receiver` string, nullable: An identifier to distinguish different receivers.
  - `active` 0 | 1: Whether or not the hook is enabled.
  - `created` string: Creation date of hook.
  - `lastactivity` string, nullable: Date of last time the hook got used.
  - `last_updated` string: The time the hook data was last updated

## Response `201`

Added

- object: The hook information returned when subscribing to an an event.
  - `id` integer: The id needed to unsubscribe.

## Other responses

- `4XX`: Invalid input

---

[API](https://skmtc.dev/c1st/apis/customers-1st-api.md) - [All operations](https://skmtc.dev/c1st/apis/customers-1st-api/llms.txt) - [OpenAPI document](https://skmtc.dev/c1st/apis/customers-1st-api/revisions/4250bb326f2a?raw)
