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

# Set the webhook endpoint URL

> Must be https. A signing secret is generated on first use and returned in the response. ORG_ADMIN only. NOTE: PUT /organizations/me/settings does NOT configure webhooks — it accepts only brandColor and contactPhone.



## OpenAPI

````yaml /api-reference/openapi.json put /organizations/me/webhook
openapi: 3.1.0
info:
  title: MicroCrop Partner API
  version: 1.0.0
  description: >-
    Parametric crop & livestock insurance API for integrating partners. All
    requests authenticate with an organization API key in the `x-api-key`
    header.
servers:
  - url: https://app.microcrop.app/api
    description: Production (Base mainnet)
security:
  - apiKey: []
tags:
  - name: Farmers
  - name: Plots
  - name: Herds
  - name: Policies
  - name: Payments
  - name: Payouts
  - name: Organization
  - name: Determinations
paths:
  /organizations/me/webhook:
    put:
      tags:
        - Organization
      summary: Set the webhook endpoint URL
      description: >-
        Must be https. A signing secret is generated on first use and returned
        in the response. ORG_ADMIN only. NOTE: PUT /organizations/me/settings
        does NOT configure webhooks — it accepts only brandColor and
        contactPhone.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  example: https://your-system.example.com/microcrop/webhooks
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookConfigEnvelope'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  schemas:
    WebhookConfigEnvelope:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            url:
              type: string
              nullable: true
            secretSet:
              type: boolean
            secret:
              type: string
              nullable: true
              description: >-
                Plaintext HMAC signing secret. Stored in plaintext because you
                need the raw value to verify signatures.
              example: whsec_…
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              example: INVALID_INPUT
            message:
              type: string
            details: {}
  responses:
    BadRequest:
      description: Validation or business-rule error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````