---
title: "Create a Webhook"
method: POST
path: "/webhooks"
tags: ["webhook"]
---

# Create a Webhook

`POST /webhooks`

A webhook is an HTTP callback that provides event notification. After a webhook is created, the cluster generates an HTTP POST when specific events occur, for example a VM is created or a VM power state is changed.

## Request body

- WebhookIntentInput — An intentful representation of a webhook
  - `spec` Webhook, required — Webhook input definition.
    - `name` string, required — Webhook name.
    - `resources` WebhookResources, required — Webhook resources.
      - `post_url` string, required — URL for the webhook.
      - `credentials` object — Credentials required for successful post to the webhook URL.
        - `username` string — Username to be used in basic auth.
        - `password` string — Password to be used in basic auth.
      - `events_filter_list` WebhookEventType[], required — List of events subscribed to by the webhook.
    - `description` string — A description or user annotation for the webhook.
  - `api_version` string
  - `metadata` WebhookMetadata, required — The webhook kind metadata
    - `last_update_time` string, date-time — UTC date and time in RFC-3339 format when webhook was last updated
    - `kind` string, required — The kind name
    - `uuid` string, UUID — webhook uuid
    - `spec_version` integer — Version number of the latest spec.
    - `creation_time` string, date-time — UTC date and time in RFC-3339 format when webhook was created
    - `spec_hash` string — Hash of the spec. This will be returned from server.
    - `should_force_translate` boolean — Applied on Prism Central only. Indicate whether force to translate the spec of the fanout request to fit the target cluster API schema.
    - `owner_reference` UserReference — The reference to a user
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `categories` object — Categories for the webhook
    - `name` string — webhook name

## Response `202`

Request Accepted

- WebhookIntentResponse — Response object for intentful operations on a webhook
  - `status` WebhookDefStatus — Webhook status definition.
    - `state` string — The state of the entity.
    - `message_list` MessageResource[]
      - `message` string, required — If state is ERROR, a message describing the error.
      - `reason` string, required — If state is ERROR, a machine-readable snake-cased string.
      - `details` object — Custom key-value details relevant to the status.
    - `name` string, required — Webhook name.
    - `resources` WebhookResources, required — Webhook resources.
      - `post_url` string, required — URL for the webhook.
      - `credentials` object — Credentials required for successful post to the webhook URL.
        - `username` string — Username to be used in basic auth.
        - `password` string — Password to be used in basic auth.
      - `events_filter_list` WebhookEventType[], required — List of events subscribed to by the webhook.
    - `description` string — A description or user annotation for the webhook.
  - `spec` Webhook — Webhook input definition.
    - `name` string, required — Webhook name.
    - `resources` WebhookResources, required — Webhook resources.
      - `post_url` string, required — URL for the webhook.
      - `credentials` object — Credentials required for successful post to the webhook URL.
        - `username` string — Username to be used in basic auth.
        - `password` string — Password to be used in basic auth.
      - `events_filter_list` WebhookEventType[], required — List of events subscribed to by the webhook.
    - `description` string — A description or user annotation for the webhook.
  - `api_version` string, required
  - `metadata` WebhookMetadata, required — The webhook kind metadata
    - `last_update_time` string, date-time — UTC date and time in RFC-3339 format when webhook was last updated
    - `kind` string, required — The kind name
    - `uuid` string, UUID — webhook uuid
    - `spec_version` integer — Version number of the latest spec.
    - `creation_time` string, date-time — UTC date and time in RFC-3339 format when webhook was created
    - `spec_hash` string — Hash of the spec. This will be returned from server.
    - `should_force_translate` boolean — Applied on Prism Central only. Indicate whether force to translate the spec of the fanout request to fit the target cluster API schema.
    - `owner_reference` UserReference — The reference to a user
      - `kind` string, required — The kind name
      - `name` string
      - `uuid` string, UUID, required
    - `categories` object — Categories for the webhook
    - `name` string — webhook name

## Other responses

- `default` — Internal Error

---

[API](https://skmtc.net/nutanix/apis/nutanix-intentful-api.md) · [All operations](https://skmtc.net/nutanix/apis/nutanix-intentful-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nutanix/nutanix-intentful-api/revisions/40395083ab31/schema)
