CLI reference
Hooks CLI command reference
Interact with hooks in your project
npx sanity hooks --help
pnpm dlx sanity hooks --help
yarn dlx sanity hooks --help
bunx 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=<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-id projectIdcreate
USAGE
$ sanity hooks create [-p <id>]
OVERRIDE FLAGS
-p, --project-id=<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-id abc123delete
USAGE
$ sanity hooks delete [NAME] [-p <id>]
ARGUMENTS
[NAME] Name of webhook to delete (will prompt if not provided)
OVERRIDE FLAGS
-p, --project-id=<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-id abc123list
USAGE
$ sanity hooks list [-p <id>]
OVERRIDE FLAGS
-p, --project-id=<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-id abc123logs
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=<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-id abc123