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

# POST /webhooks

> If this request returns 503, stop the workflow and retry later when instructed, or contact support with its requestId. Subscribe your HTTPS receiver to selected workspace events. Maximum 10 non-archived subscriptions, including paused subscriptions. Delivery is signed and at-least-once; deduplicate event IDs. May return 503 while unavailable. Required permissions: webhooks.manage. Use Postman or your backend. Keep your API key private; do not enter it in this public documentation page.

Subscribe your public HTTPS receiver to selected workspace events. Required permission: `webhooks.manage`. Send an [Idempotency-Key](https://docs.layarva.com/developers/platform-request-keys.md).

Generate and securely save a separate `signingSecret` before creating the subscription; it is not an API key and is never returned. Save `data.id` to view delivery history or pause the subscription. At most ten non-archived subscriptions are allowed, including paused subscriptions.

> [!NOTE]
>
> If this request returns `503`, stop the workflow and retry later when instructed, or contact support with the response `requestId`. Use your Platform key privately in Postman or your backend, not this page. Follow the [creation and signature-verification guide](https://docs.layarva.com/developers/platform-webhooks.md).


## OpenAPI

````yaml api/platform-workspace.openapi.json POST /webhooks
openapi: 3.1.0
info:
  title: Layarva Platform / Workspace API
  version: 1.1.0
  description: >-
    Manage Library, Playlists, Channels, Locations, Edges, Screens and
    Schedules. Use a Platform key, not a Widget key. See
    https://docs.layarva.com/developers/platform-quickstart. Upload supported
    files, export eligible offline packages and receive signed Platform
    webhooks. Permissions, plan limits and publishing rules apply. If a request
    returns 503, stop that workflow and contact support with its requestId.
servers:
  - url: https://api.layarva.com/api/platform/v1/workspaces/{workspaceId}
    variables:
      workspaceId:
        default: workspace_example
security:
  - PlatformBearer: []
paths:
  /webhooks:
    post:
      tags:
        - webhooks
      summary: POST /webhooks
      description: >-
        If this request returns 503, stop the workflow and retry later when
        instructed, or contact support with its requestId. Subscribe your HTTPS
        receiver to selected workspace events. Maximum 10 non-archived
        subscriptions, including paused subscriptions. Delivery is signed and
        at-least-once; deduplicate event IDs. May return 503 while unavailable.
        Required permissions: webhooks.manage. Use Postman or your backend. Keep
        your API key private; do not enter it in this public documentation page.
      operationId: post__webhooks
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9._:-]{1,128}$
          description: >-
            An operation ID, not your API key. Generate a UUID for each new
            change and reuse it when retrying the same request. See
            https://docs.layarva.com/developers/platform-request-keys for
            Postman, PowerShell and Node.js examples. Upload instructions are
            refreshed when requested again.
      requestBody:
        required: true
        description: >-
          Send application/json using the fields below. JSON requests must be no
          larger than 64 KiB.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCreate'
      responses:
        '201':
          description: Safe live-authorized result
          headers:
            X-Request-Id:
              schema:
                type: string
            Cache-Control:
              schema:
                const: private, no-store
            X-RateLimit-Limit:
              schema:
                type: string
            X-RateLimit-Remaining:
              schema:
                type: string
            Idempotency-Replayed:
              schema:
                enum:
                  - 'true'
                  - 'false'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Webhook'
                required:
                  - data
                additionalProperties: false
        default:
          description: >-
            Error with code, message and requestId. Follow Retry-After when
            present. Contact support with the requestId if the problem
            continues.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            X-Request-Id:
              schema:
                type: string
            Retry-After:
              schema:
                type: string
components:
  schemas:
    WebhookCreate:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          pattern: ^[^\u0000-\u001f\u007f]+$
        url:
          type: string
          maxLength: 2048
        events:
          minItems: 1
          maxItems: 7
          type: array
          items:
            type: string
            enum:
              - platform.command.completed
              - library.upload.committed
              - library.upload.failed
              - playlist.ready
              - publication.succeeded
              - publication.failed
              - offline.export.ready
        signingSecret:
          type: string
          minLength: 32
          maxLength: 256
          pattern: ^[A-Za-z0-9_-]+$
      required:
        - name
        - url
        - events
        - signingSecret
      additionalProperties: false
      description: >-
        Create a public HTTPS receiver subscription. Generate an independent
        random signingSecret (32–256 base64url characters), not your API key. It
        is accepted only at creation and never returned. URL/events/secret
        cannot be changed: archive and recreate to rotate. Private destinations,
        redirects, credentials and query strings are refused.
    Webhook:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        url:
          type: string
        events:
          type: array
          items:
            enum:
              - platform.command.completed
              - library.upload.committed
              - library.upload.failed
              - playlist.ready
              - publication.succeeded
              - publication.failed
              - offline.export.ready
        enabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - url
        - events
        - enabled
        - createdAt
        - updatedAt
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            requestId:
              type: string
          required:
            - code
            - message
            - requestId
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    PlatformBearer:
      type: http
      scheme: bearer
      bearerFormat: lv_platform_<43 base64url characters>
      description: >-
        Platform API key for one workspace. Create it in Settings with an expiry
        date or Never expire. Keep it private; use it from Postman or your
        backend, not browser code. Widget keys are not accepted.

````

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