> ## Documentation Index
> Fetch the complete documentation index at: https://cloud.laravel.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create webhook endpoint

> Create a webhook endpoint. Cloud sends a signed `POST` request to the URL for each selected deployment event and retries failed deliveries. Each request has the `X-Cloud-Event`, `X-Cloud-Event-Id`, `X-Cloud-Delivery`, `X-Cloud-Timestamp` and `X-Cloud-Signature` headers. The signature is `sha256=` followed by the hex HMAC-SHA256 of `{timestamp}.{body}`, keyed with the endpoint's signing secret. The secret is returned only in this response and when you rotate it. An environment can have up to 5 webhook endpoints.

**Required permission:** `environment.edit`


## OpenAPI

````yaml https://cloud.laravel.com/api-docs/api.json post /environments/{environment}/webhook-endpoints
openapi: 3.1.2
info:
  title: Laravel Cloud
  version: 0.0.1
servers:
  - url: https://cloud.laravel.com/api
security:
  - http: []
tags:
  - name: Applications
  - name: Environments
  - name: Domains
  - name: Commands
  - name: Deployments
  - name: Instances
  - name: Webhooks
  - name: Email
  - name: Background Processes
  - name: Scheduled Commands
  - name: Database Clusters
  - name: Databases
  - name: Database Users
  - name: Database Snapshots
  - name: Database Restores
  - name: Object Storage Buckets
  - name: Bucket Keys
  - name: Caches
  - name: WebSocket Clusters
  - name: WebSocket Applications
  - name: Dedicated Clusters
  - name: Edge Networks
  - name: Secrets
  - name: Usage
  - name: Meta
  - name: Databases (Legacy)
paths:
  /environments/{environment}/webhook-endpoints:
    post:
      tags:
        - Webhooks
      summary: Create webhook endpoint
      description: >-
        Create a webhook endpoint. Cloud sends a signed `POST` request to the
        URL for each selected deployment event and retries failed deliveries.
        Each request has the `X-Cloud-Event`, `X-Cloud-Event-Id`,
        `X-Cloud-Delivery`, `X-Cloud-Timestamp` and `X-Cloud-Signature` headers.
        The signature is `sha256=` followed by the hex HMAC-SHA256 of
        `{timestamp}.{body}`, keyed with the endpoint's signing secret. The
        secret is returned only in this response and when you rotate it. An
        environment can have up to 5 webhook endpoints.
      operationId: public.environments.webhook-endpoints.store
      parameters:
        - name: environment
          in: path
          required: true
          description: The environment identifier
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          description: >-
            A unique value, such as a UUID, that identifies this operation. When
            you send the same request again with the same key, Laravel Cloud
            returns the first successful response from the last 24 hours instead
            of performing the action again. See [Idempotent
            requests](https://laravel.com/cloud/docs/api/idempotency).
          schema:
            type: string
            minLength: 1
            maxLength: 255
          example: 3f8b2a6e-5c1d-4e7a-9b0c-2d4f6a8e1c3b
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreWebhookEndpointRequest'
      responses:
        '201':
          description: '`WebhookEndpointResource`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WebhookEndpointResource'
                  included:
                    type: array
                    items:
                      anyOf:
                        - $ref: '#/components/schemas/JsonApiResource'
                        - $ref: '#/components/schemas/WebhookEndpointResource'
                        - $ref: '#/components/schemas/EnvironmentResource'
                required:
                  - data
          headers:
            Idempotent-Replayed:
              description: >-
                Present with the value `true` when this response is the stored
                response of an earlier request with the same `Idempotency-Key`.
              schema:
                type: string
                enum:
                  - 'true'
        '400':
          description: The `Idempotency-Key` header is empty or longer than 255 characters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A description of the error.
                  code:
                    type: string
                    enum:
                      - idempotency_key_invalid
                required:
                  - message
                  - code
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '409':
          description: >-
            A request with the same `Idempotency-Key` is still in progress, or
            it succeeded but Cloud could not store its response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A description of the error.
                  code:
                    type: string
                    enum:
                      - idempotency_key_in_use
                      - idempotency_key_response_unavailable
                required:
                  - message
                  - code
          headers:
            Retry-After:
              description: >-
                The number of seconds to wait before you retry. Cloud sends this
                header only with the `idempotency_key_in_use` code.
              schema:
                type: integer
        '422':
          description: >-
            Validation error


            You already used this `Idempotency-Key` for a request with a
            different method, path, query string, or body.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      message:
                        type: string
                        description: Errors overview.
                      errors:
                        type: object
                        description: >-
                          A detailed description of each field that failed
                          validation.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                    required:
                      - message
                      - errors
                  - type: object
                    properties:
                      message:
                        type: string
                        description: A description of the error.
                      code:
                        type: string
                        enum:
                          - idempotency_key_reused
                    required:
                      - message
                      - code
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error overview.
                required:
                  - message
components:
  schemas:
    StoreWebhookEndpointRequest:
      type: object
      properties:
        url:
          type: string
          description: >-
            The HTTPS endpoint that receives the events. It must resolve to a
            public address.
          maxLength: 2048
        events:
          type: array
          description: The deployment events to send.
          items:
            type: string
            enum:
              - deployment.live
              - deployment.succeeded
              - deployment.failed
              - deployment.post_deploy_failed
          minItems: 1
          uniqueItems: true
        enabled:
          type: boolean
          description: Whether Cloud sends events to the webhook. Defaults to `true`.
      required:
        - url
        - events
      title: StoreWebhookEndpointRequest
    WebhookEndpointResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - webhook_endpoints
        attributes:
          type: object
          properties:
            url:
              type: string
            secret:
              type: string
              description: >-
                The signing secret. Returned only when the webhook is created
                and when its secret is rotated.
            events:
              type: array
              items:
                $ref: '#/components/schemas/WebhookEventType'
            enabled:
              type: boolean
              description: >-
                Cloud disables a webhook when its endpoint responds with `410
                Gone`.
            last_delivery_at:
              type:
                - string
                - 'null'
              format: date-time
            last_outcome:
              anyOf:
                - $ref: '#/components/schemas/WebhookDeliveryOutcome'
                  description: >-
                    The outcome of the last delivery, or null when nothing has
                    been delivered yet.
                - type: 'null'
            created_at:
              type:
                - string
                - 'null'
              format: date-time
          required:
            - url
            - events
            - enabled
            - last_delivery_at
            - last_outcome
            - created_at
        relationships:
          type: object
          properties:
            subscribables:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/JsonApiResourceIdentifier'
              required:
                - data
      required:
        - id
        - type
      title: WebhookEndpointResource
    JsonApiResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
      required:
        - id
        - type
      title: JsonApiResource
    EnvironmentResource:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - environments
        attributes:
          type: object
          properties:
            name:
              type: string
            display_name:
              type: string
            slug:
              type: string
            status:
              $ref: '#/components/schemas/EnvironmentStatus'
            color:
              $ref: '#/components/schemas/EnvironmentColor'
            cluster_id:
              type:
                - string
                - 'null'
              description: >-
                The identifier of the dedicated cluster the environment runs on.
                `null` on shared compute.
            edge_network_id:
              type:
                - string
                - 'null'
              description: >-
                The identifier of the edge network the environment serves
                traffic through. `null` when it has none.
            created_from_automation:
              type: boolean
            pull_request:
              type: 'null'
            uses_vanity_domain:
              type: boolean
              description: >-
                Whether the environment is served on its vanity domain.
                `vanity_domain` keeps its value while this is `false`.
            vanity_domain:
              type: string
            framework:
              $ref: '#/components/schemas/Framework'
            language:
              $ref: '#/components/schemas/Language'
            php_major_version:
              type: string
            serving:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - process
                    - static
                root:
                  type: 'null'
              required:
                - mode
                - root
            build_command:
              type:
                - string
                - 'null'
            node_version:
              $ref: '#/components/schemas/NodeVersion'
            deploy_command:
              type:
                - string
                - 'null'
            post_deploy_command:
              type:
                - string
                - 'null'
              description: The commands that run after the deployment goes live.
            start_command:
              type:
                - string
                - 'null'
            build_addons:
              type: array
              description: >-
                The slugs of the build add-ons installed on the environment,
                such as `ffmpeg`.
              items:
                type: string
            uses_octane:
              type: boolean
            uses_hibernation:
              type: boolean
            hibernation_wake_up_interval:
              type:
                - integer
                - 'null'
            timeout:
              type: integer
              description: >-
                The number of seconds the environment will wait for your
                application to respond before timing out. Changes take effect on
                the next deployment.
            shutdown_timeout:
              type: integer
              description: >-
                The number of seconds to wait before stopping the previous
                deployment's compute instances, allowing it to finish processing
                requests and jobs after a new deployment becomes active. Changes
                take effect on the next deployment.
            aws_role_arn:
              type:
                - string
                - 'null'
              description: >-
                The ARN of the IAM role the environment's application assumes to
                access AWS. `null` when none is set. Only present for an
                environment on a dedicated cluster, in an organization with
                bring your own IAM role enabled, when the token may view the
                environment. Changes take effect on the next deployment.
            aws_trust_policy:
              type: string
              description: >-
                The trust policy, as JSON, that the IAM role in `aws_role_arn`
                must have so the environment can assume it. Present when
                `aws_role_arn` is.
            uses_push_to_deploy:
              type: boolean
            uses_deploy_hook:
              type: boolean
            uses_purge_edge_cache_on_deploy:
              type: boolean
              description: >-
                Whether each deployment purges the environment's edge cache.
                Changes take effect on the next deployment.
            uses_read_only_build_token:
              type: boolean
              description: >-
                Whether builds clone the repository with a read-only token. Only
                GitHub repositories support it.
            deploy_hook_url:
              type:
                - string
                - 'null'
              description: >-
                The URL to send a `POST` request to in order to deploy the
                environment. `null` when the deploy hook is disabled or the
                token lacks the `environment_deploy_hook.edit` permission.
            uses_http_basic_auth:
              type: boolean
              description: >-
                Whether visitors must sign in with HTTP basic authentication,
                using the username `admin`. The password is never returned.
            uses_nightwatch:
              type: boolean
              description: >-
                Whether Laravel Nightwatch monitoring is on. The Nightwatch
                token is never returned.
            resend:
              type:
                - object
                - 'null'
              properties:
                from_address:
                  type:
                    - string
                    - 'null'
                from_name:
                  type:
                    - string
                    - 'null'
                key_name:
                  type: string
              required:
                - from_address
                - from_name
                - key_name
            internal_networking:
              type: object
              description: The environment's internal networking settings.
              properties:
                enabled:
                  type: boolean
                  description: >-
                    Whether other environments on the same cluster can reach
                    this environment over the private network.
                hostname:
                  type:
                    - string
                    - 'null'
                  description: >-
                    The private hostname other environments use to reach this
                    environment. `null` when internal networking is disabled.
                access_level:
                  anyOf:
                    - $ref: >-
                        #/components/schemas/EnvironmentInternalNetworkingAccessLevel
                      description: >-
                        Which environments can send internal traffic to this
                        environment. `null` when internal networking is
                        disabled.
                    - type: 'null'
                environment_ids:
                  type: array
                  description: >-
                    The IDs of the environments that can send internal traffic
                    to this environment. Empty unless `access_level` is
                    `specific`.
                  items:
                    type: string
              required:
                - enabled
                - hostname
                - access_level
                - environment_ids
            error_monitoring:
              $ref: '#/components/schemas/EnvironmentErrorMonitoringResource'
              description: >-
                The environment's error monitoring settings, which turn errors
                into issues. Only present when error monitoring is available for
                your organization and the environment's framework. Changes take
                effect on the next deployment.
            environment_variables:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  value:
                    type: string
                required:
                  - key
                  - value
            network_settings:
              type: object
              properties:
                cache:
                  type: object
                  properties:
                    strategy:
                      type: string
                  required:
                    - strategy
                response_headers:
                  type: object
                  properties:
                    frame:
                      type: string
                    content_type:
                      type: string
                    hsts:
                      type: object
                      properties:
                        max_age:
                          type: integer
                        include_subdomains:
                          type: boolean
                        preload:
                          type: boolean
                      required:
                        - max_age
                        - include_subdomains
                        - preload
                  required:
                    - frame
                    - content_type
                    - hsts
                firewall:
                  type: object
                  properties:
                    bot_categories:
                      type: array
                      items:
                        $ref: '#/components/schemas/BotControlCategory'
                    rate_limit:
                      type: object
                      properties:
                        '429':
                          type: boolean
                        level:
                          $ref: '#/components/schemas/RateLimitLevel'
                        per_minute:
                          $ref: '#/components/schemas/RateLimitPerMinute'
                        4xx:
                          type: boolean
                      required:
                        - level
                        - per_minute
                        - 4xx
                        - '429'
                    under_attack_mode_started_at:
                      type:
                        - integer
                        - 'null'
                    block_path:
                      type: boolean
                  required:
                    - bot_categories
                    - rate_limit
                    - under_attack_mode_started_at
                    - block_path
                content_converter:
                  type: boolean
              required:
                - cache
                - response_headers
                - firewall
                - content_converter
            created_at:
              type:
                - string
                - 'null'
              format: date-time
          required:
            - name
            - display_name
            - slug
            - status
            - color
            - cluster_id
            - edge_network_id
            - created_from_automation
            - pull_request
            - uses_vanity_domain
            - vanity_domain
            - framework
            - language
            - php_major_version
            - serving
            - build_command
            - node_version
            - deploy_command
            - start_command
            - uses_octane
            - uses_hibernation
            - hibernation_wake_up_interval
            - timeout
            - shutdown_timeout
            - uses_push_to_deploy
            - uses_deploy_hook
            - uses_purge_edge_cache_on_deploy
            - uses_read_only_build_token
            - deploy_hook_url
            - uses_http_basic_auth
            - uses_nightwatch
            - resend
            - internal_networking
            - network_settings
            - created_at
        relationships:
          type: object
          properties:
            application:
              type: object
              properties:
                data:
                  anyOf:
                    - $ref: '#/components/schemas/ApplicationResourceIdentifier'
                    - type: 'null'
              required:
                - data
            branch:
              type: object
              properties:
                data:
                  anyOf:
                    - $ref: '#/components/schemas/BranchResourceIdentifier'
                    - type: 'null'
              required:
                - data
            deployments:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/DeploymentResourceIdentifier'
              required:
                - data
            currentDeployment:
              type: object
              properties:
                data:
                  anyOf:
                    - $ref: '#/components/schemas/DeploymentResourceIdentifier'
                    - type: 'null'
              required:
                - data
            domains:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/DomainResourceIdentifier'
              required:
                - data
            primaryDomain:
              type: object
              properties:
                data:
                  anyOf:
                    - $ref: '#/components/schemas/DomainResourceIdentifier'
                    - type: 'null'
              required:
                - data
            instances:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/InstanceResourceIdentifier'
              required:
                - data
            database:
              type: object
              properties:
                data:
                  anyOf:
                    - $ref: '#/components/schemas/DatabaseSchemaResourceIdentifier'
                    - type: 'null'
              required:
                - data
            cache:
              type: object
              properties:
                data:
                  anyOf:
                    - $ref: '#/components/schemas/CacheResourceIdentifier'
                    - type: 'null'
              required:
                - data
            bucketKeys:
              type: object
              description: >-
                Each key's identifier meta holds the disk it is mounted as and
                whether it is the default disk.
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/FilesystemKeyResourceIdentifier'
              required:
                - data
            automation:
              type: object
              description: >-
                Automations have no view policy, so the edit permission on the
                automation's source environment decides access, as it does in
                the MCP tools.
              properties:
                data:
                  anyOf:
                    - $ref: '#/components/schemas/AutomationResourceIdentifier'
                    - type: 'null'
              required:
                - data
            buckets:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/FilesystemResourceIdentifier'
              required:
                - data
            websocketApplication:
              type: object
              properties:
                data:
                  anyOf:
                    - $ref: >-
                        #/components/schemas/WebsocketApplicationResourceIdentifier
                    - type: 'null'
              required:
                - data
            secrets:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/SecretResourceIdentifier'
              required:
                - data
        links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/Link'
          required:
            - self
      required:
        - id
        - type
        - links
      title: EnvironmentResource
    WebhookEventType:
      type: string
      enum:
        - deployment.live
        - deployment.succeeded
        - deployment.failed
        - deployment.post_deploy_failed
        - ping
      title: WebhookEventType
    WebhookDeliveryOutcome:
      type: string
      enum:
        - pending
        - succeeded
        - failed
        - blocked
      title: WebhookDeliveryOutcome
    JsonApiResourceIdentifier:
      type: object
      properties:
        type:
          type: string
        id:
          type: string
      required:
        - type
        - id
      title: JsonApiResourceIdentifier
    EnvironmentStatus:
      type: string
      enum:
        - deploying
        - running
        - hibernating
        - stopped
      title: EnvironmentStatus
    EnvironmentColor:
      type: string
      enum:
        - blue
        - green
        - orange
        - purple
        - red
        - yellow
        - cyan
        - gray
      title: EnvironmentColor
    Framework:
      type: string
      enum:
        - laravel
        - symfony
        - jigsaw
        - html
        - php
        - express
        - hono
        - nuxt
        - next
        - tanstack
        - elysia
        - nestjs
        - astro
        - javascript
        - go
        - hugo
        - laravel-go
        - ruby
        - rails
        - jekyll
        - django
        - fastapi
        - flask
        - pelican
        - python
        - java
        - spring
        - rust
        - zola
        - axum
        - rocket
        - actix
        - warp
        - laravel-rust
      title: Framework
    Language:
      type: string
      enum:
        - html
        - php
        - javascript
        - python
        - go
        - ruby
        - java
        - rust
      title: Language
    NodeVersion:
      type: string
      enum:
        - '20'
        - '22'
        - '24'
        - '26'
      title: NodeVersion
    EnvironmentInternalNetworkingAccessLevel:
      type: string
      enum:
        - all
        - specific
      title: EnvironmentInternalNetworkingAccessLevel
    EnvironmentErrorMonitoringResource:
      type: object
      properties:
        enabled:
          type: boolean
          description: >-
            Whether error monitoring captures the application's errors as
            issues.
        capture_request_payload:
          type: boolean
          description: >-
            Whether error reports include the request payload, which can contain
            personal data.
        redact_request_payload_fields:
          type: array
          description: >-
            The request payload fields whose values are redacted from error
            reports.
          items:
            type: string
        redact_headers:
          type: array
          description: The request headers whose values are redacted from error reports.
          items:
            type: string
        redact_command_input_fields:
          type: array
          description: >-
            The command arguments and options whose values are redacted from
            error reports.
          items:
            type: string
      required:
        - enabled
        - capture_request_payload
        - redact_request_payload_fields
        - redact_headers
        - redact_command_input_fields
      title: EnvironmentErrorMonitoringResource
    BotControlCategory:
      type: string
      enum:
        - academic_research
        - accessibility
        - advertising_and_marketing
        - aggregator
        - ai_assistant
        - ai_crawler
        - ai_search
        - feed_fetcher
        - monitoring_and_analytics
        - page_preview
        - search_engine_crawler
        - search_engine_optimization
        - security
        - social_media_marketing
        - webhooks
        - other
      title: BotControlCategory
    RateLimitLevel:
      type: string
      enum:
        - challenge
        - throttle
        - ban
      title: RateLimitLevel
    RateLimitPerMinute:
      type: integer
      enum:
        - 100
        - 300
        - 500
        - 750
        - 1000
      title: RateLimitPerMinute
    ApplicationResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - applications
        id:
          type: string
      required:
        - type
        - id
      title: ApplicationResourceIdentifier
    BranchResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - branches
        id:
          type: string
      required:
        - type
        - id
      title: BranchResourceIdentifier
    DeploymentResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - deployments
        id:
          type: string
      required:
        - type
        - id
      title: DeploymentResourceIdentifier
    DomainResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - domains
        id:
          type: string
      required:
        - type
        - id
      title: DomainResourceIdentifier
    InstanceResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - instances
        id:
          type: string
      required:
        - type
        - id
      title: InstanceResourceIdentifier
    DatabaseSchemaResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - databaseSchemas
        id:
          type: string
      required:
        - type
        - id
      title: DatabaseSchemaResourceIdentifier
    CacheResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - caches
        id:
          type: string
      required:
        - type
        - id
      title: CacheResourceIdentifier
    FilesystemKeyResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - filesystemKeys
        id:
          type: string
      required:
        - type
        - id
      title: FilesystemKeyResourceIdentifier
    AutomationResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - automations
        id:
          type: string
      required:
        - type
        - id
      title: AutomationResourceIdentifier
    FilesystemResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - filesystems
        id:
          type: string
      required:
        - type
        - id
      title: FilesystemResourceIdentifier
    WebsocketApplicationResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - websocketApplications
        id:
          type: string
      required:
        - type
        - id
      title: WebsocketApplicationResourceIdentifier
    SecretResourceIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - secrets
        id:
          type: string
      required:
        - type
        - id
      title: SecretResourceIdentifier
    Link:
      type: object
      properties:
        href:
          type: string
          format: uri
        rel:
          type: string
        describedby:
          type: string
        title:
          type: string
        type:
          type: string
        hreflang:
          anyOf:
            - type: string
            - type: array
              items:
                type: string
        meta:
          type: object
      required:
        - href
      title: Link
  responses:
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
  securitySchemes:
    http:
      type: http
      description: The Bearer Token generated on the Cloud UI.
      scheme: bearer
      bearerFormat: bearer

````