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

# Update a webhook endpoint

> Change the URL, events, filters, description or status. Omitted fields stay as they are. Disabling stops new events; enabling resumes with events that happen from then on. Repeating the same update is safe.



## OpenAPI

````yaml /openapi.json patch /webhook-endpoints/{id}
openapi: 3.0.3
info:
  title: Effective API
  version: 2.0.0
  description: The public Effective REST API. Authenticate using an Effective API key.
servers:
  - url: https://api.effectiveai.app/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /webhook-endpoints/{id}:
    patch:
      tags:
        - Webhooks
      summary: Update a webhook endpoint
      description: >-
        Change the URL, events, filters, description or status. Omitted fields
        stay as they are. Disabling stops new events; enabling resumes with
        events that happen from then on. Repeating the same update is safe.
      operationId: updateWebhookEndpoint
      parameters:
        - schema:
            type: string
            pattern: ^whk_[0-9a-f]{20}$
            description: 'Webhook endpoint ID: whk_ followed by 20 hex characters.'
          required: true
          description: 'Webhook endpoint ID: whk_ followed by 20 hex characters.'
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2WebhookEndpointUpdate'
      responses:
        '200':
          description: Updated endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2WebhookEndpoint'
        '400':
          description: Invalid request or cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '403':
          description: >-
            An organization member credential is required. Read-only members
            cannot make changes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '404':
          description: Webhook endpoint not found in your organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '413':
          description: JSON request body exceeds 64 KiB.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '415':
          description: Content-Type must be application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
        '503':
          description: Temporarily unavailable; retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2CodedError'
      security:
        - bearerAuth: []
components:
  schemas:
    V2WebhookEndpointUpdate:
      type: object
      properties:
        url:
          type: string
          maxLength: 2048
          description: >-
            Public HTTPS URL that receives signed POST requests. Credentials in
            the URL and private or local hosts are rejected.
        enabledEvents:
          type: array
          items:
            type: string
            enum:
              - answer.completed
              - answer.failed
              - osha.employer.event_added
            x-extensible-enum:
              - answer.completed
              - answer.failed
              - osha.employer.event_added
            description: >-
              answer.completed and answer.failed fire when an answer finishes.
              osha.employer.event_added fires when an OSHA inspection, accident
              or other event first appears for an employer; it needs the OSHA
              dataset.
          minItems: 1
          maxItems: 3
        filters:
          type: object
          properties:
            employerIds:
              type: array
              items:
                type: string
                pattern: ^emp_[0-9a-f]{20}$
                description: 'Effective employer ID: emp_ followed by 20 hex characters.'
              maxItems: 1000
              description: Only send events for these employers.
            states:
              type: array
              items:
                type: string
                pattern: ^[A-Za-z]{2}$
                description: Two-letter state code, such as FL.
              maxItems: 60
              description: Only send events at sites in these states.
          additionalProperties: false
          description: Replaces all filters. Send {} to clear them.
        description:
          type: string
          nullable: true
          maxLength: 500
          description: Your own note about what this endpoint is for.
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: >-
            Enable to resume an endpoint disabled for failing; only new events
            are sent.
      additionalProperties: false
    V2WebhookEndpoint:
      type: object
      properties:
        id:
          type: string
          pattern: ^whk_[0-9a-f]{20}$
          description: 'Webhook endpoint ID: whk_ followed by 20 hex characters.'
        url:
          type: string
          format: uri
          description: >-
            Public HTTPS URL that receives signed POST requests. Credentials in
            the URL and private or local hosts are rejected.
        description:
          type: string
          nullable: true
        enabledEvents:
          type: array
          items:
            type: string
            enum:
              - answer.completed
              - answer.failed
              - osha.employer.event_added
            x-extensible-enum:
              - answer.completed
              - answer.failed
              - osha.employer.event_added
            description: >-
              answer.completed and answer.failed fire when an answer finishes.
              osha.employer.event_added fires when an OSHA inspection, accident
              or other event first appears for an employer; it needs the OSHA
              dataset.
        filters:
          type: object
          properties:
            employerIds:
              type: array
              items:
                type: string
            states:
              type: array
              items:
                type: string
          additionalProperties: false
        status:
          type: string
          enum:
            - enabled
            - disabled
          description: Disabled endpoints receive nothing until enabled again.
        disabledReason:
          type: string
          nullable: true
          enum:
            - caller
            - failing
            - null
          description: >-
            caller: you disabled it. failing: deliveries failed for three days,
            so it was disabled and its queued events were dropped. Null when
            enabled.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - url
        - description
        - enabledEvents
        - filters
        - status
        - disabledReason
        - createdAt
        - updatedAt
      additionalProperties: false
    V2CodedError:
      allOf:
        - $ref: '#/components/schemas/V2Error'
        - type: object
          properties:
            code:
              type: string
              minLength: 1
              description: Stable error code. Clients must tolerate unknown future codes.
            details:
              type: array
              items:
                type: object
                properties:
                  location:
                    type: string
                    enum:
                      - path
                      - query
                      - header
                      - body
                  path:
                    type: array
                    items:
                      type: string
                      maxLength: 64
                    maxItems: 12
                  code:
                    type: string
                    enum:
                      - required
                      - invalid_type
                      - invalid_value
                      - unknown_field
                  message:
                    type: string
                    minLength: 1
                    maxLength: 200
                required:
                  - location
                  - path
                  - code
                  - message
              minItems: 1
              maxItems: 20
              description: Bounded safe validation issues; may omit some invalid fields.
            requestId:
              type: string
              minLength: 1
              maxLength: 128
              description: >-
                Existing server correlation for this HTTP attempt, when
                available.
            dataset:
              type: string
              enum:
                - naic
                - osha
              description: Dataset needed for dataset_not_enabled.
            businessCode:
              type: string
              description: The rater’s own refusal code, for business_rejection.
            violations:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                    description: Authored or built-in constraint code
                  message:
                    type: string
                    description: Authored message for the failed constraint
                  path:
                    type: string
                    description: Input path of the offending value; empty for the request
                  value:
                    nullable: true
                    description: Offending input value, size-bounded by the runtime
                  constraint:
                    type: string
                    description: The constraint the value failed, as text
                  cite:
                    type: string
                    nullable: true
                    description: >-
                      Filing citation of the constraint, when the source cites
                      one
                required:
                  - code
                  - message
                  - path
                  - value
                  - constraint
                  - cite
                additionalProperties: false
              maxItems: 256
              description: >-
                Each input constraint the submission failed, for invalid_inputs
                and business_rejection.
            violationsTruncated:
              type: boolean
              description: >-
                True when the rater reported more violations than violations
                holds.
            accessUrl:
              type: string
              nullable: true
              format: uri
              description: >-
                Where to add the product to your account, for
                product_access_required.
          required:
            - code
    V2Error:
      type: object
      properties:
        error:
          type: string
          minLength: 1
          description: Human-readable explanation of the failure.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Effective API key. Send Authorization: Bearer sk-eai-...'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.