CLI reference
Hook CLI command reference
Interact with hooks in your project
npx sanity hook --help
pnpm dlx sanity hook --help
yarn dlx sanity hook --help
bunx sanity hook --help
Commands
attempt
USAGE
$ sanity hook attempt ATTEMPTID
ARGUMENTS
ATTEMPTID The delivery attempt ID to get details for
FLAGS
-p, --project-id=<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 hook attempt abc123
Get attempt details for a specific project
sanity hook attempt abc123 --project-id projectIdcreate
USAGE
$ sanity hook create
FLAGS
-p, --project-id=<PROJECT-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 hook create
Create a webhook for a specific project
sanity hook create --project-id abc123delete
USAGE
$ sanity hook delete [NAME]
ARGUMENTS
[NAME] Name of hook to delete (will prompt if not provided)
FLAGS
-p, --project-id=<PROJECT-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 hook delete
Delete a specific hook by name
sanity hook delete my-hook
Delete a hook from a specific project
sanity hook delete --project-id abc123list
USAGE
$ sanity hook list
FLAGS
-p, --project-id=<PROJECT-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 hook list
List hooks for a specific project
sanity hook list --project-id abc123logs
USAGE
$ sanity hook logs [NAME]
ARGUMENTS
[NAME] Name of the hook to show logs for
FLAGS
-p, --project-id=<PROJECT-ID> Project ID to view webhook logs for (overrides CLI configuration)
--detailed Include detailed payload and attempts
DESCRIPTION
List latest log entries for a given hook
EXAMPLES
List latest log entries for a given hook
sanity hook logs
List latest log entries for a specific hook by name
sanity hook logs [NAME]
List hook logs for a specific project
sanity hook logs --project-id abc123