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

# Create Webhook

This API registers a Refold [webhook](https://app.gocobalt.io/developer/webhooks).

## Request description

#### Body Parameters

<ParamField body="webhook_url" type="string" required>
  Provide a url where you wish to listen to the event.
</ParamField>

<ParamField body="webhook_events" type="string[]" required>
  Array of strings of webhooks events to subscribe.. Accepted values are, `Connection Created`, `Connection Deleted`, `Workflow Completed`, `Workflow Errored`, `Connection Expired`.
</ParamField>

<ParamField body="is_enabled" type="boolean">
  Determines whether the webhook is active or not.
</ParamField>

<ParamField body="webhook_type" type="string">
  The type of webhook. Accepted values are `default` and `slack`.
</ParamField>

## Response description

<Tabs>
  <Tab title="200">
    <ResponseField name="is_enabled" type="boolean">
      Whether the webhook is active or not.
    </ResponseField>

    <ResponseField name="webhook_events" type="array">
      Webhook events subscribed.
    </ResponseField>

    <ResponseField name="created_At" type="string">
      Timestamp of webhook creation.
    </ResponseField>

    <ResponseField name="webhook_url" type="string">
      Webhook URL to listen to the events.
    </ResponseField>

    <ResponseField name="_id" type="string">
      Unique ID of the webhook.
    </ResponseField>

    <ResponseField name="webhook_type" type="string">
      The type of webhook. Accepted values are `default` and `slack`.
    </ResponseField>
  </Tab>

  <Tab title="Error">
    <ResponseField name="status_code" type="integer">
      System generated status Code
    </ResponseField>

    <ResponseField name="http_error_type" type="string">
      System generated error type
    </ResponseField>

    <ResponseField name="error_code" type="string">
      Specific error code to identify the error
    </ResponseField>

    <ResponseField name="message" type="string">
      Error message
    </ResponseField>

    <ResponseField name="request_id" type="string">
      System generated request id
    </ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```JSON 200 theme={null}
      {
          "is_enabled": false,
          "webhook_events": [
              "Connection Created",
              "Connection Deleted",
              "Workflow Completed",
              "Workflow Errored",
              "Connection Expired"
          ],
          "webhook_url": "https://webhookurl.com",
          "_id": "66e31564c0287b4136f77ef8",
          "createdAt": "2024-09-12T16:23:00.587Z",
          "webhook_type": "slack"
      }
  ```

  ```JSON 401 theme={null}
  {
      "status_code": 401,
      "http_error_type": "UNAUTHORIZED",
      "error_code": "SERVER_ERROR",
      "message": "Invalid Credentials"
      "request_id": "89bd1675-a826-46cb-9210-6cb2ae169f67"
  }
  ```

  ```JSON 500 theme={null}
  {
      "status_code": 500,
      "http_error_type": "INTERNAL_SERVER_ERROR",
      "error_code": "SERVER_ERROR",
      "message": "Request failed with status code 500",
      "request_id": "1340603a-8797-43ed-ab76-dd8db37fd2e6"
  }
  ```
</ResponseExample>
