> ## 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.

# (Deprecated) Subscribe to events

<Warning>
  This API is now deprecated.
</Warning>

This API subscribes user to Refold [webhook](https://app.gocobalt.io/webhooks) events.

## Request description

#### Body Parameters

<ParamField body="webhook_events" type="array" required>
  Webhooks events to subscribe. Accepted values are, `connection-created`, `connection-deleted`, `workflow-completed`, `workflow-errored`.
</ParamField>

## Response description

<Tabs>
  <Tab title="200">
    <ResponseField name="webhook_url" type="string">
      Registered webhook url
    </ResponseField>

    <ResponseField name="webhook_events" type="array">
      Subscribed events.
    </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}
  {
      "webhook_url": "https://mysite.com/cobalt/webhook",
      "webhook_events": [
              "Workflow Completed",
              "Workflow Errored"
      ]
  }
  ```

  ```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>
