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

# Register a Webhook



## OpenAPI

````yaml post /api/webhooks/{type}
openapi: 3.0.0
info:
  version: v1.0.0
  title: Webhooks API
  description: API for managing webhooks in the Rio platform
servers:
  - url: https://app.sandbox.rio.trade
security:
  - apiKeyAuth: []
paths:
  /api/webhooks/{type}:
    post:
      summary: Create a webhook registration
      parameters:
        - name: type
          in: path
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/webhookTypePathParameter'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createWebHookSchema'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseCreatedWebhookSchema'
components:
  parameters:
    webhookTypePathParameter:
      name: type
      in: path
      description: Type of webhook to be created.
      required: true
      schema:
        enum:
          - orders
          - bank-accounts
          - users
  schemas:
    createWebHookSchema:
      type: object
      properties:
        userId:
          description: The user ID of the user that the webhook is being created for
          type: string
          example: 66290ac8bd3903485989f82e
        url:
          type: string
          description: URL to send the webhook to
        retryOnFailure:
          type: boolean
          description: >-
            Whether to retry webhook delivery on failure. If true, the system
            will retry up to 5 times with exponential backoff. If false or not
            provided, only one attempt will be made.
          example: true
      required:
        - url
    responseCreatedWebhookSchema:
      type: object
      properties:
        id:
          type: string
          description: Id of the created webhook
          example: 66733d33222710ab2785dc62
        secret:
          description: Webhook secret
          type: string
          example: IgAeeIIorKQ86gAGItsmY0slzhxRY1Gvj/VIJz8DtIs=
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````