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

# Ensure the cluster repository webhook

> Browser session authentication; ensures the cluster's connected GitOps repository carries the platform webhook, creating or repairing it (the repository-settings 'ensure webhook' action). Rate limited per cluster: a burst answers 429 with Retry-After. A cluster with no connected repository answers 404 with the reason in detail. Browser route only; there is no bearer-PAT twin yet (the route census's twin-gap ratchet lists it).



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /org/clusters/{cluster_id}/webhook/ensure
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /org/clusters/{cluster_id}/webhook/ensure:
    post:
      tags:
        - Organisation API
      summary: Ensure the cluster repository webhook
      description: >-
        Browser session authentication; ensures the cluster's connected GitOps
        repository carries the platform webhook, creating or repairing it (the
        repository-settings 'ensure webhook' action). Rate limited per cluster:
        a burst answers 429 with Retry-After. A cluster with no connected
        repository answers 404 with the reason in detail. Browser route only;
        there is no bearer-PAT twin yet (the route census's twin-gap ratchet
        lists it).
      operationId: cluster_webhook_ensure_browser
      parameters:
        - in: path
          name: cluster_id
          required: true
          schema:
            format: uuid
            type: string
        - description: Must match the ankra_csrf browser cookie.
          in: header
          name: X-Ankra-CSRF
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnsureWebhookResponse'
          description: >-
            Webhook ensured (success) or the reason it could not be
            (success=false with message).
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Unauthenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Permission or CSRF check failed
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: >-
            Cluster not found, or no GitOps repository is connected; the detail
            field carries the reason
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: >-
            Too many webhook ensure requests for this cluster; Retry-After names
            the wait in seconds.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Provider or internal failure
      security:
        - SessionCookie: []
components:
  schemas:
    EnsureWebhookResponse:
      properties:
        message:
          title: Message
          type: string
        success:
          title: Success
          type: boolean
      required:
        - success
        - message
      title: EnsureWebhookResponse
      type: object
    ContractDetailError:
      example:
        detail: Cluster not found
      properties:
        detail:
          oneOf:
            - type: string
            - additionalProperties: true
              properties: {}
              type: object
      required:
        - detail
      type: object
  securitySchemes:
    SessionCookie:
      description: Browser session. Mutations also require X-Ankra-CSRF.
      in: cookie
      name: ankra_session
      type: apiKey

````