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

# Create or Update Webhook

> Create webhook for store. Or if webhook already exists with `externalId`, update it. Requires the [`webhooks_write`](/docs/api-reference/scopes) scope.



## OpenAPI

````yaml /api-schema/openapi.yaml post /stores/{storeId}/webhooks
openapi: 3.1.0
info:
  contact:
    email: engineering-admin@getredo.com
    name: Redo Engineering
  description: |
    ## Endpoints

    Endpoints are authenticated using the Bearer authorization scheme, using the
    REDO_API_SECRET.

    ```txt
    GET /v2.2/resource HTTP/1.1
    Authorization: Bearer 77bb7598b7a972475cc7c7e171ec33af
    Host: api.getredo.com
    ```

    ## Webhooks

    Webhooks are authenticated using the Bearer authorization scheme, using
    a secret supplied by the subscriber.

    ```txt
    POST /events HTTP/1.1
    Authorization: Bearer subscriberauth123
    Host: subscriber.example.com
    ```

    Webhook events are delivered in order for each individual subject (e.g.
    return).

    If the response is not a 2xx status code, the event will be retried multiple
    times before discarding it.
  title: Redo API
  version: 2.2.1
servers:
  - url: https://api.getredo.com/v2.2
security: []
tags:
  - name: Checkout Buttons
  - name: Coverage Info
  - name: Coverage Products
  - name: Custom Events
  - name: Customer Portal
  - name: Customer Subscriptions
  - name: Customers
  - name: Inbound Shipments
  - name: Inventory Items
  - name: Inventory Levels
  - name: Invoices
  - name: Merchant Admin
  - name: Orders
  - name: Products
  - name: Returns
  - name: Storefront
  - name: Webhooks
paths:
  /stores/{storeId}/webhooks:
    summary: Webhooks
    description: Webhooks.
    parameters:
      - $ref: '#/components/parameters/store-id.param'
    post:
      tags:
        - Webhooks
      summary: Create or Update Webhook
      description: >-
        Create webhook for store. Or if webhook already exists with
        `externalId`, update it. Requires the
        [`webhooks_write`](/docs/api-reference/scopes) scope.
      operationId: Webhook create
      requestBody:
        content:
          application/json:
            schema:
              properties:
                webhook:
                  $ref: '#/components/schemas/webhook-create.schema'
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  webhook:
                    $ref: '#/components/schemas/webhook-read.schema'
                type: object
          description: Updated
        '201':
          content:
            application/json:
              schema:
                properties:
                  webhook:
                    $ref: '#/components/schemas/webhook-read.schema'
                type: object
          description: Created
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/error.schema'
          description: Error
      security:
        - Bearer: []
components:
  parameters:
    store-id.param:
      description: Store ID
      in: path
      name: storeId
      required: true
      schema:
        example: 64e5a8a1af49a89df37e4ee7
        type: string
  schemas:
    webhook-create.schema:
      description: Webhook create.
      properties:
        backfill:
          default: false
          description: Create events for already-existing items
          title: Backfill
          type: boolean
        callback:
          $ref: '#/components/schemas/https-callback.schema'
          description: HTTPS callback to POST events.
          title: HTTPS callback
        externalId:
          default: null
          description: Optional external identifier.
          title: External ID
          type:
            - string
            - 'null'
        kind:
          $ref: '#/components/schemas/webhook-kind.schema'
          description: Kind.
          title: Kind
        topic:
          $ref: '#/components/schemas/webhook-topic.schema'
          description: Topic.
          title: Topic
      required:
        - callback
        - topic
      title: Webhook create
      type: object
    webhook-read.schema:
      description: Webhook read.
      properties:
        callback:
          $ref: '#/components/schemas/https-callback.schema'
          description: HTTPS callback URL to POST events.
          title: Callback
        createdAt:
          description: Time created.
          format: date-time
          title: Created at.
          type: string
        externalId:
          default: null
          description: Optional external identifier.
          title: External ID
          type:
            - string
            - 'null'
        id:
          description: Webhook ID.
          readonly: true
          title: ID
          type: string
        kind:
          $ref: '#/components/schemas/webhook-kind.schema'
          description: Kind.
          title: Kind
        topic:
          $ref: '#/components/schemas/webhook-topic.schema'
          description: Topic.
          title: Topic
        updatedAt:
          description: Last time updated.
          format: date-time
          title: Updated at.
          type: string
      required:
        - callback
        - createdAt
        - externalId id
        - updatedAt
        - topic
      title: Webhook read
      type: object
    error.schema:
      description: >-
        Problem details. See [RFC 7807 Section
        3](https://datatracker.ietf.org/doc/html/rfc7807#section-3).
      properties:
        detail:
          description: Human-readable description of the problem.
          title: Detail
          type: string
        instance:
          description: A URI reference that identifies this problem.
          format: uri-reference
          type: string
        title:
          description: Human-readable summary of the problem type.
          title: Title
          type: string
        type:
          default: about:blank
          description: A URI reference that identifies the problem type.
          format: uri-reference
          type: string
      title: Problem details
      type: object
    https-callback.schema:
      description: HTTPS callback
      properties:
        auth:
          description: Authorization.
          oneOf:
            - properties:
                bearer:
                  description: Bearer
                  properties:
                    token:
                      description: Token for Bearer authorization.
                      example: abc123
                      format: password
                      title: Token
                      type: string
                  title: Bearer
              title: Bearer authorization
              type: object
            - type: 'null'
          title: Authorization
        url:
          description: HTTPS callback URL.
          example: https://subscriber.example.org/events
          format: uri
          pattern: ^https://
          title: URL
          type: string
      required:
        - auth
        - url
      title: HTTPS callback
      type: object
    webhook-kind.schema:
      description: Webhook kind.
      enum:
        - redo
        - loop
      title: Webhook kind
      type: string
    webhook-topic.schema:
      description: Webhook topic.
      enum:
        - return
      title: Webhook topic
      type: string
  securitySchemes:
    Bearer:
      scheme: bearer
      type: http

````