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

# Create a catalog webhook endpoint

> Validates DNS and permits only public HTTPS destinations outside local development.

## Save the signing secret

The `201` response includes `secret` exactly once. Store it securely before discarding the response. List and update operations never return it again.

* Production destinations must use public HTTPS. Lasso validates DNS and rejects local, private, and otherwise unsafe targets.
* `events` must contain at least one unique supported event.
* `name` is optional for API clients and defaults to the destination hostname.

Verify signatures using the raw request body. See [Catalog webhooks](https://productlasso.com/docs/api-reference/webhooks.md) for headers, signature verification, retries, and payloads.

## Examples

```bash cURL theme={null}
curl --request POST \
  --url https://app.productlasso.com/api/v1/catalog/webhooks \
  --header "Authorization: Bearer $LASSO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "ERP product sync",
    "url": "https://erp.example.com/webhooks/lasso",
    "events": ["product.created", "product.updated", "product.deleted"]
  }'
```

```typescript TypeScript theme={null}
const response = await fetch("https://app.productlasso.com/api/v1/catalog/webhooks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LASSO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "ERP product sync",
    url: "https://erp.example.com/webhooks/lasso",
    events: ["product.created", "product.updated", "product.deleted"],
  }),
});

if (!response.ok) throw new Error(await response.text());
const webhook = await response.json();
// Store webhook.secret now. It is returned only once.
```

```python Python theme={null}
import os
import requests

response = requests.post(
    "https://app.productlasso.com/api/v1/catalog/webhooks",
    headers={"Authorization": f"Bearer {os.environ['LASSO_API_KEY']}"},
    json={
        "name": "ERP product sync",
        "url": "https://erp.example.com/webhooks/lasso",
        "events": ["product.created", "product.updated", "product.deleted"],
    },
    timeout=30,
)
response.raise_for_status()
webhook = response.json()
# Store webhook["secret"] now. It is returned only once.
```

```json Example response theme={null}
{
  "id": "f4146cf6-393e-411f-a93e-b62212e7b5c1",
  "company_id": "81e2b625-e6e8-4dd5-a50f-22803806cc10",
  "name": "ERP product sync",
  "url": "https://erp.example.com/webhooks/lasso",
  "events": ["product.created", "product.updated", "product.deleted"],
  "enabled": true,
  "description": null,
  "secret": "whsec_store_this_value_now",
  "created_at": "2026-08-31T09:40:00.000Z",
  "updated_at": "2026-08-31T09:40:00.000Z"
}
```


## OpenAPI

````yaml openapi.yaml POST /catalog/webhooks
openapi: 3.1.0
info:
  title: Lasso API
  description: AI-powered product data extraction and enhancement API
  version: 1.0.0
  contact:
    name: Lasso Support
    url: https://lasso.ai
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://app.productlasso.com/api/v1
    description: Production
security:
  - BearerAuth: []
paths:
  /catalog/webhooks:
    post:
      tags:
        - Catalog Webhooks
      summary: Create a catalog webhook endpoint
      description: >-
        Validates DNS and permits only public HTTPS destinations outside local
        development.
      operationId: createCatalogWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CatalogWebhookCreateInput'
      responses:
        '201':
          description: Endpoint plus its one-time signing secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogWebhookCreateResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl --request POST \
              --url https://app.productlasso.com/api/v1/catalog/webhooks \
              --header "Authorization: Bearer $LASSO_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
                "name": "ERP product sync",
                "url": "https://erp.example.com/webhooks/lasso",
                "events": ["product.created", "product.updated", "product.deleted"]
              }'
        - lang: typescript
          label: TypeScript
          source: >
            const response = await
            fetch("https://app.productlasso.com/api/v1/catalog/webhooks", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.LASSO_API_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                name: "ERP product sync",
                url: "https://erp.example.com/webhooks/lasso",
                events: ["product.created", "product.updated", "product.deleted"],
              }),
            });


            if (!response.ok) throw new Error(await response.text());

            const webhook = await response.json();

            // Store webhook.secret now. It is returned only once.
        - lang: python
          label: Python
          source: |
            import os
            import requests

            response = requests.post(
                "https://app.productlasso.com/api/v1/catalog/webhooks",
                headers={"Authorization": f"Bearer {os.environ['LASSO_API_KEY']}"},
                json={
                    "name": "ERP product sync",
                    "url": "https://erp.example.com/webhooks/lasso",
                    "events": ["product.created", "product.updated", "product.deleted"],
                },
                timeout=30,
            )
            response.raise_for_status()
            webhook = response.json()
            # Store webhook["secret"] now. It is returned only once.
components:
  schemas:
    CatalogWebhookCreateInput:
      type: object
      required:
        - url
        - events
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
          description: >-
            Optional for API clients; defaults to the destination hostname. The
            dashboard requires it.
        url:
          type: string
          format: uri
          maxLength: 2048
        events:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/CatalogWebhookEvent'
        description:
          type:
            - string
            - 'null'
          maxLength: 500
      example:
        name: ERP product sync
        url: https://erp.example.com/webhooks/lasso
        events:
          - product.created
          - product.updated
          - product.deleted
        description: Synchronize Catalog changes to the ERP.
    CatalogWebhookCreateResponse:
      allOf:
        - $ref: '#/components/schemas/CatalogWebhookEndpoint'
        - type: object
          required:
            - secret
          properties:
            secret:
              type: string
              description: >-
                One-time signing secret. It is never returned by later reads or
                updates.
    CatalogWebhookEvent:
      type: string
      enum:
        - product.created
        - product.updated
        - product.deleted
        - attribute.created
        - attribute.updated
        - attribute.deleted
    CatalogWebhookEndpoint:
      type: object
      required:
        - id
        - company_id
        - name
        - url
        - events
        - enabled
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
        company_id:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
          maxLength: 120
        url:
          type: string
          format: uri
          description: >-
            HTTPS public destination. HTTP localhost is accepted only by local
            development servers.
        events:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/CatalogWebhookEvent'
        enabled:
          type: boolean
        description:
          type:
            - string
            - 'null'
          maxLength: 500
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - status_code
        - error_type
        - message
        - request_id
      properties:
        status_code:
          type: integer
        error_type:
          type: string
          enum:
            - invalid_request
            - unauthenticated
            - forbidden
            - not_found
            - conflict
            - validation_error
            - rate_limited
            - service_unavailable
            - internal_error
        message:
          type: string
        request_id:
          type: string
        code:
          type: string
          description: >-
            Stable machine-readable detail code for validation, conflict, and
            retryable availability errors.
        retryable:
          type: boolean
          description: Whether the request can be retried without changing its payload.
        attribute_id:
          type: string
          format: uuid
          description: Stable Attribute identity when the error is scoped to one Attribute.
        attribute_key:
          type: string
          description: Attribute key when the error is scoped to one Attribute.
        details:
          type: object
          additionalProperties: true
        current_updated_at:
          type: string
          format: date-time
          description: >-
            Current resource revision supplied for client-directed refetch after
            a stale write.
  responses:
    Unauthorized:
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Request validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````

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