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 current project
EXAMPLES
Create a new webhook for the current 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 hook 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 hook within your project
EXAMPLES
Interactively select and delete a hook
$ sanity hooks delete
Delete a specific hook by name
$ sanity hooks delete my-hook
Delete a hook 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 hooks for a given project
EXAMPLES
List hooks for a given project
$ sanity hooks list
List hooks for a specific project
$ sanity hooks list --project-id abc123logs
USAGE
$ sanity hooks logs [NAME] [-p <id>] [--detailed]
ARGUMENTS
[NAME] Name of the hook 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
List latest log entries for a given hook
EXAMPLES
List latest log entries for a given hook
$ sanity hooks logs
List latest log entries for a specific hook by name
$ sanity hooks logs [NAME]
List hook logs for a specific project
$ sanity hooks logs --project-id abc123