1. Docs
  2. Pulumi Cloud
  3. Pulumi Cloud REST API
  4. Webhooks

Webhooks

    The Webhooks API allows you to create and manage webhooks for organizations and stacks. Webhooks notify external services of events happening within your Pulumi organization, such as stack updates, deployments, or policy violations.

    For comprehensive information about webhooks including event filtering, payload formats, and UI setup, see the Webhooks documentation.

    Webhook Operations

    The API provides endpoints for the following operations:

    • Creating new webhooks for organizations or stacks
    • Listing webhooks with filtering options
    • Getting webhook details
    • Updating webhook configuration
    • Testing webhooks with ping functionality
    • Deleting webhooks

    Create Webhook

    Create a new webhook for an organization or stack.

    // To create an organization webhook
    POST /api/orgs/{organization}/hooks
    
    // To create a stack webhook
    POST /api/stacks/{organization}/{project}/{stack}/hooks
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathOrganization name
    projectstringpathOptional. Project name (required for stack webhooks)
    stackstringpathOptional. Stack name (required for stack webhooks)
    activebooleanbodyEnable webhook
    displayNamestringbodyName of webhook
    organizationNamestringbodyOrganization name
    payloadUrlstringbodyURL to send request to
    projectNamestringbodyOptional. Project name (required for stack webhooks)
    stackNamestringbodyOptional. Stack name (required for stack webhooks)
    formatstringbodyOptional. Format of the payload. Possible values are raw, slack, ms_teams or pulumi_deployments. Default is raw.
    filtersarray[string]bodyOptional. List of filters for events the webhook should receive. See webhook docs for more information on what filters are available
    secretstringbodyOptional. Secret used as the HMAC key. See webhook docs for more information

    Example

    # Create organization webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request POST \
      --data '{"active": true, "displayName": "My Webhook", "organizationName": "myorg", "payloadUrl": "https://example.com/webhook"}' \
      https://api.pulumi.com/api/orgs/{organization}/hooks
    
    # Create stack webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request POST \
      --data '{"active": true, "displayName": "Stack Webhook", "organizationName": "myorg", "projectName": "myproject", "stackName": "production", "payloadUrl": "https://example.com/webhook"}' \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/hooks
    

    List Webhooks

    List all webhooks for an organization or stack.

    // List organization webhooks
    GET /api/orgs/{organization}/hooks
    
    // List stack webhooks
    GET /api/stacks/{organization}/{project}/{stack}/hooks
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathOrganization name
    projectstringpathOptional. Project name (required for stack webhooks)
    stackstringpathOptional. Stack name (required for stack webhooks)
    continuationTokenstringqueryOptional. The continuation token to use for retrieving the next set of results if results were truncated

    Example

    # List organization webhooks
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      https://api.pulumi.com/api/orgs/{organization}/hooks
    
    # List stack webhooks
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/hooks
    

    Get Webhook

    Get details about a specific webhook.

    // Get organization webhook
    GET /api/orgs/{organization}/hooks/{webhookname}
    
    // Get stack webhook
    GET /api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathOrganization name
    projectstringpathOptional. Project name (required for stack webhooks)
    stackstringpathOptional. Stack name (required for stack webhooks)
    webhooknamestringpathName of the webhook

    Example

    # Get organization webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      https://api.pulumi.com/api/orgs/{organization}/hooks/{webhookname}
    
    # Get stack webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}
    

    Update Webhook

    Update an existing webhook.

    // Update organization webhook
    PATCH /api/orgs/{organization}/hooks/{webhookname}
    
    // Update stack webhook
    PATCH /api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}
    

    Parameters

    The update endpoint accepts the same body parameters as the create endpoint. Only include the fields you want to update.

    Example

    # Update organization webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request PATCH \
      --data '{"active": false, "displayName": "Updated Webhook Name"}' \
      https://api.pulumi.com/api/orgs/{organization}/hooks/{webhookname}
    

    Delete Webhook

    Delete a webhook.

    // Delete organization webhook
    DELETE /api/orgs/{organization}/hooks/{webhookname}
    
    // Delete stack webhook
    DELETE /api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathOrganization name
    projectstringpathOptional. Project name (required for stack webhooks)
    stackstringpathOptional. Stack name (required for stack webhooks)
    webhooknamestringpathName of the webhook

    Example

    # Delete organization webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request DELETE \
      https://api.pulumi.com/api/orgs/{organization}/hooks/{webhookname}
    
    # Delete stack webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request DELETE \
      https://api.pulumi.com/api/{organization}/{project}/{stack}/hooks/{webhookname}
    

    Ping Webhook

    Send a test ping to a webhook to validate it’s working.

    // Ping organization webhook
    POST /api/orgs/{organization}/hooks/{webhookname}/ping
    
    // Ping stack webhook
    POST /api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}/ping
    

    Parameters

    ParameterTypeInDescription
    organizationstringpathOrganization name
    projectstringpathOptional. Project name (required for stack webhooks)
    stackstringpathOptional. Stack name (required for stack webhooks)
    webhooknamestringpathName of the webhook

    Example

    # Ping organization webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request POST \
      https://api.pulumi.com/api/orgs/{organization}/hooks/{webhookname}/ping
    
    # Ping stack webhook
    curl \
      -H "Accept: application/vnd.pulumi+8" \
      -H "Content-Type: application/json" \
      -H "Authorization: token $PULUMI_ACCESS_TOKEN" \
      --request POST \
      https://api.pulumi.com/api/stacks/{organization}/{project}/{stack}/hooks/{webhookname}/ping
    
      AI Agentic Workflows: Register now