Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

epi content-graph add-hook command

Add hook.

Usage

epi content-graph add-hook [OPTIONS] --app <APP> --url <URL>

Examples

Add a webhook that listens for doc.updated OR bulk.completed events, filtering for documents with a Published status AND matching a specific siteId:

epi cg add \
  --app dev \
  --url https://domain.com/api/content/publish?token=MY_PUBLISH_TOKEN \
  --topic doc.updated \
  --topic bulk.completed \
  --filter '{ "status": { "eq": "Published" }, "siteId": { "eq": "site_id" } }'

Add a webhook that listens for all events, filtering for documents that have Published OR Draft status:

epi cg add \
  --app dev \
  --url https://domain.com/api/content/publish?token=MY_PUBLISH_TOKEN \
  --topic '*.*' \
  --filter '{ "status": { "eq": "Published" } }' \
  --filter '{ "status": { "eq": "Draft" } }'

Options

-a, –app <APP>

The app name.
Aliases: name.

–url <URL>

The URL of the hook.
Aliases: url.

–method <METHOD>

The HTTP method for the hook.
Default: POST.
Aliases: method.

–disabled <DISABLED>

Whether the hook is disabled.
Possible values: true, false.

–topic <TOPIC>

The topics to subscribe to.

–filter <FILTER>

Optional filters for the hook.

–preset <PRESET>

Optional preset for the hook.
Default: next.

-h, –help

Print help.