CLI reference

Hooks CLI command reference

Interact with hooks in your project

npx sanity hooks --help

Commands

attempt

USAGE
  $ sanity hooks attempt ATTEMPTID [-p <id>]

ARGUMENTS
  ATTEMPTID  The delivery attempt ID to get details for

OVERRIDE FLAGS
  -p, --project=<id>  Project ID to view webhook attempt for (overrides CLI configuration)

DESCRIPTION
  Print details of a given webhook delivery attempt

EXAMPLES
  Print details of webhook delivery attempt with ID abc123

    $ sanity hooks attempt abc123

  Get attempt details for a specific project

    $ sanity hooks attempt abc123 --project projectId

create

USAGE
  $ sanity hooks create [-p <id>]

OVERRIDE FLAGS
  -p, --project=<id>  Project ID to create webhook for (overrides CLI configuration)

DESCRIPTION
  Create a new webhook for the project

EXAMPLES
  Create a new webhook for the project

    $ sanity hooks create

  Create a webhook for a specific project

    $ sanity hooks create --project abc123

delete

USAGE
  $ sanity hooks delete [NAME] [-p <id>]

ARGUMENTS
  [NAME]  Name of webhook to delete (will prompt if not provided)

OVERRIDE FLAGS
  -p, --project=<id>  Project ID to delete webhook from (overrides CLI configuration)

DESCRIPTION
  Delete a webhook from the project

EXAMPLES
  Interactively select and delete a webhook

    $ sanity hooks delete

  Delete a specific webhook by name

    $ sanity hooks delete my-hook

  Delete a webhook from a specific project

    $ sanity hooks delete --project abc123

list

USAGE
  $ sanity hooks list [-p <id>]

OVERRIDE FLAGS
  -p, --project=<id>  Project ID to list webhooks for (overrides CLI configuration)

DESCRIPTION
  List webhooks for the project

EXAMPLES
  List webhooks for the project

    $ sanity hooks list

  List webhooks for a specific project

    $ sanity hooks list --project abc123

logs

USAGE
  $ sanity hooks logs [NAME] [-p <id>] [--detailed]

ARGUMENTS
  [NAME]  Name of the webhook to show logs for

FLAGS
      --detailed  Include detailed payload and attempts

OVERRIDE FLAGS
  -p, --project=<id>  Project ID to view webhook logs for (overrides CLI configuration)

DESCRIPTION
  Show log entries for project webhooks

EXAMPLES
  Show log entries for project webhooks

    $ sanity hooks logs

  Show log entries for a specific webhook by name

    $ sanity hooks logs [NAME]

  Show log entries for a specific project

    $ sanity hooks logs --project abc123

Was this page helpful?

Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change site theme