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

# Create a webhook

> Registers an outbound webhook subscription. Each subscription targets a URL and one or more event names (`item.created`, `item.updated`, `edge.created`, etc. — wildcards accepted). The optional `type_filter` narrows item events to specific item types.

The `secret` field is the HMAC-SHA256 signing key the server will use on every delivery; if omitted, the server generates one and returns it in the response. The plaintext secret is returned **only** on creation — store it then. Subsequent reads redact it. See [Webhooks](/api/webhooks) for delivery semantics, retry schedule, and signature verification.



## OpenAPI

````yaml /openapi.json post /webhooks
openapi: 3.1.0
info:
  title: Marfa API
  version: 4.2.0
  description: Typed data layer for structured personal data
servers: []
security: []
paths:
  /webhooks:
    post:
      tags:
        - Webhooks
      summary: Create a webhook
      description: >-
        Registers an outbound webhook subscription. Each subscription targets a
        URL and one or more event names (`item.created`, `item.updated`,
        `edge.created`, etc. — wildcards accepted). The optional `type_filter`
        narrows item events to specific item types.


        The `secret` field is the HMAC-SHA256 signing key the server will use on
        every delivery; if omitted, the server generates one and returns it in
        the response. The plaintext secret is returned **only** on creation —
        store it then. Subsequent reads redact it. See [Webhooks](/api/webhooks)
        for delivery semantics, retry schedule, and signature verification.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  minLength: 1
                events:
                  type: array
                  items:
                    type: string
                  minItems: 1
                type_filter:
                  type: string
                  nullable: true
                secret:
                  type: string
              required:
                - url
                - events
      responses:
        '201':
          description: Webhook created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  url:
                    type: string
                  events:
                    type: array
                    items:
                      type: string
                  type_filter:
                    type: string
                    nullable: true
                  secret:
                    type: string
                  active:
                    type: boolean
                  created_at:
                    type: string
                  updated_at:
                    type: string
                required:
                  - id
                  - url
                  - events
                  - secret
                  - active
                  - created_at
                  - updated_at
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - validation_error
                          - missing_required_field
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - unauthorized
                      message:
                        type: string
                      details:
                        type: object
                        additionalProperties:
                          nullable: true
                    required:
                      - code
                      - message
                required:
                  - error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or OAuth Token
      description: Pass an API key (marfa_k1_...) or OAuth access token (marfa_at_...)

````