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

# Create Webhook

> This endpoint allows you to create a new webhook for your account. By specifying the URL and the process you want to monitor, you can set up real-time notifications for specific events.

#### Request

| Field | **Type** | Required | Description |
| --- | --- | --- | --- |
| Authorization | Header | Yes | The access token, valid for 5 minutes, is used to authenticate requests to other endpoints. |
| clientID | URL | Yes | Include your assigned **ID** in the URL, obtainable through the **Get infoClient** endpoint. |

#### Request Body

The request body should be in JSON format and include the following fields:

| **Field** | **Description** |
| --- | --- |
| url | The URL where webhook notifications will be sent. This must be a valid and accessible space. |
| process | The process to monitor: `ramp`, `compliance` or `wallet_transfer`. |

#### Response

On success, the server returns the details of the newly created webhook, including its unique identifier, status, and configuration.

| **Field** | **Description** |
| --- | --- |
| Id | The unique identifier of the webhook. |
| method | The HTTP method used by the webhook (e.g., POST). |
| process | The process the webhook monitors (`ramp`, `compliance` or `wallet_transfer`). |
| status | Indicates whether the webhook is active (true) or inactive (false). |
| url | The destination URL where notifications are sent. |
| userId | The unique identifier of the user associated with the webhook. |

## Webhook Payload

When an event occurs in the monitored process, the webhook will send a POST request to your specified URL containing the relevant information about the process and the specific changes or updates that triggered the notification.

Below is an example of a webhook payload for the ramp process. This is provided as a reference to illustrate the type of information that might be included, but the actual payload will vary depending on the specific process being monitored and the type of update that occurred.

``` json
{
    "amountReceived": 2.29,              
    "amountSent": 10000.0,              
    "bankAccountId": "04637bb8-be4c-4fc7-8312-7b0541736d86",  
    "destinationUserId": "20ec3cb9-497c-480f-9478-4d64c7b43064",  
    "id": "de98e68a-1051-4803-a1e6-0fda74de333b",  
    "numberRamp": "0005277",            
    "operationCategory": "ramp",        
    "originUserId": "20ec3cb9-497c-480f-9478-4d64c7b43064",  
    "rampType": "on_ramp",              
    "registerDate": "2025-01-17 16:05:25.873917",  
    "status": "paidawaitingfunds",      
    "symbolTypeReceived": "USDC",       
    "symbolTypeSent": "COP",           
    "userId": "20ec3cb9-497c-480f-9478-4d64c7b43064",  
    "walletId": "0ed2aa92-da56-4774-847f-6352c8e8e177",
    "rampDetails": {
        "txid": "0x7281e10bc6db3684340b3d53d927cea34312dea3e6c4b8ab926d666d3ffbd46c"
    }
}

 ```

In this example, if the webhook is monitoring a ramp process and there's a status update (for example, from "pending" to "paidawaitingfunds"), the webhook will send a notification containing the complete updated information of the ramp operation.

| **Field** | **Type** | **Description** |
| --- | --- | --- |
| amountReceived | number | The amount received in the destination currency |
| amountSent | number | The amount sent in the origin currency |
| bankAccountId | string | Unique identifier of the bank account used in the operation |
| destinationUserId | string | Identifier of the user receiving the funds |
| id | string | Unique identifier of the ramp operation |
| numberRamp | string | Sequential number assigned to the ramp operation |
| operationCategory | string | Category of the operation (always "ramp") |
| originUserId | string | Identifier of the user sending the funds |
| rampType | string | Type of the ramp operation ("on_ramp" or "off_ramp") |
| registerDate | string | Timestamp of when the operation was registered |
| status | string | Current status of the ramp operation |
| symbolTypeReceived | string | Symbol of the currency received |
| symbolTypeSent | string | Symbol of the currency sent |
| userId | string | Identifier of the user who initiated the operation |
| walletId | string | Identifier of the wallet associated with the operation |
| rampDetails | object | Specifies the details of the operation |



## OpenAPI

````yaml /business/openapi.json post /api/webhooks/{clientId}
openapi: 3.1.0
info:
  title: Kravata Business API
  version: '1.0'
  description: >-
    Kravata Business API: on-ramp and off-ramp orders between fiat and
    stablecoins for your own accounts and wallets.
servers:
  - url: https://testapi.kravata.co
    description: Test
  - url: https://apiv2.kravata.co
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Accounts
  - name: Wallets
  - name: Ramp Orders
  - name: Webhooks
paths:
  /api/webhooks/{clientId}:
    post:
      tags:
        - Webhooks
      summary: Create Webhook
      description: >-
        This endpoint allows you to create a new webhook for your account. By
        specifying the URL and the process you want to monitor, you can set up
        real-time notifications for specific events.


        #### Request


        | Field | **Type** | Required | Description |

        | --- | --- | --- | --- |

        | Authorization | Header | Yes | The access token, valid for 5 minutes,
        is used to authenticate requests to other endpoints. |

        | clientID | URL | Yes | Include your assigned **ID** in the URL,
        obtainable through the **Get infoClient** endpoint. |


        #### Request Body


        The request body should be in JSON format and include the following
        fields:


        | **Field** | **Description** |

        | --- | --- |

        | url | The URL where webhook notifications will be sent. This must be a
        valid and accessible space. |

        | process | The process to monitor: `ramp`, `compliance` or
        `wallet_transfer`. |


        #### Response


        On success, the server returns the details of the newly created webhook,
        including its unique identifier, status, and configuration.


        | **Field** | **Description** |

        | --- | --- |

        | Id | The unique identifier of the webhook. |

        | method | The HTTP method used by the webhook (e.g., POST). |

        | process | The process the webhook monitors (`ramp`, `compliance` or
        `wallet_transfer`). |

        | status | Indicates whether the webhook is active (true) or inactive
        (false). |

        | url | The destination URL where notifications are sent. |

        | userId | The unique identifier of the user associated with the
        webhook. |


        ## Webhook Payload


        When an event occurs in the monitored process, the webhook will send a
        POST request to your specified URL containing the relevant information
        about the process and the specific changes or updates that triggered the
        notification.


        Below is an example of a webhook payload for the ramp process. This is
        provided as a reference to illustrate the type of information that might
        be included, but the actual payload will vary depending on the specific
        process being monitored and the type of update that occurred.


        ``` json

        {
            "amountReceived": 2.29,              
            "amountSent": 10000.0,              
            "bankAccountId": "04637bb8-be4c-4fc7-8312-7b0541736d86",  
            "destinationUserId": "20ec3cb9-497c-480f-9478-4d64c7b43064",  
            "id": "de98e68a-1051-4803-a1e6-0fda74de333b",  
            "numberRamp": "0005277",            
            "operationCategory": "ramp",        
            "originUserId": "20ec3cb9-497c-480f-9478-4d64c7b43064",  
            "rampType": "on_ramp",              
            "registerDate": "2025-01-17 16:05:25.873917",  
            "status": "paidawaitingfunds",      
            "symbolTypeReceived": "USDC",       
            "symbolTypeSent": "COP",           
            "userId": "20ec3cb9-497c-480f-9478-4d64c7b43064",  
            "walletId": "0ed2aa92-da56-4774-847f-6352c8e8e177",
            "rampDetails": {
                "txid": "0x7281e10bc6db3684340b3d53d927cea34312dea3e6c4b8ab926d666d3ffbd46c"
            }
        }

         ```

        In this example, if the webhook is monitoring a ramp process and there's
        a status update (for example, from "pending" to "paidawaitingfunds"),
        the webhook will send a notification containing the complete updated
        information of the ramp operation.


        | **Field** | **Type** | **Description** |

        | --- | --- | --- |

        | amountReceived | number | The amount received in the destination
        currency |

        | amountSent | number | The amount sent in the origin currency |

        | bankAccountId | string | Unique identifier of the bank account used in
        the operation |

        | destinationUserId | string | Identifier of the user receiving the
        funds |

        | id | string | Unique identifier of the ramp operation |

        | numberRamp | string | Sequential number assigned to the ramp operation
        |

        | operationCategory | string | Category of the operation (always "ramp")
        |

        | originUserId | string | Identifier of the user sending the funds |

        | rampType | string | Type of the ramp operation ("on_ramp" or
        "off_ramp") |

        | registerDate | string | Timestamp of when the operation was registered
        |

        | status | string | Current status of the ramp operation |

        | symbolTypeReceived | string | Symbol of the currency received |

        | symbolTypeSent | string | Symbol of the currency sent |

        | userId | string | Identifier of the user who initiated the operation |

        | walletId | string | Identifier of the wallet associated with the
        operation |

        | rampDetails | object | Specifies the details of the operation |
      operationId: create-webhook
      parameters:
        - name: clientId
          in: path
          required: true
          description: ''
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                process:
                  type: string
            example:
              url: https://your-server.example.com/webhooks/kravata
              process: ramp
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  method:
                    type: string
                  process:
                    type: string
                  status:
                    type: boolean
                  url:
                    type: string
                  userId:
                    type: string
              examples:
                api-webhooks:
                  summary: api/webhooks
                  value:
                    id: 48899140-5567-4919-bc26-a0e93018c3ce
                    method: POST
                    process: ramp
                    status: true
                    url: https://your-server.example.com/webhooks/kravata
                    userId: 20ec3cb9-497c-480f-9478-4d64c7b43064
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /api/token (valid 5 minutes).

````