> ## 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 Hosted URL

Returns the connection URL in format: `https://connect.gocobalt.io/{TOKEN}`

## Request description

#### Headers

<ParamField header="Authorization" type="string">
  Unlike other API's in this documentation, this API requires the [Session token](https://docs.gocobalt.io/api-reference/session-token/generate-token-for-linked-account) as a bearer token for authentication.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.gocobalt.io/api/v2/public/connect-url \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer {Session_token}' \
    --data '{
    "color": "<string>",
    "bgColor": "<string>",
    "name": "<string>"
  }'
  ```
</RequestExample>

#### Query Parameters

<ParamField query="config_id" type="string">
  Config ID to be used for creating Hosted URL
</ParamField>

<Info>
  If the config\_id is not found, then a new config will be created using the config\_id.
</Info>

#### Body Parameters

<ParamField body="color" type="string">
  Text Colour Hex
</ParamField>

<ParamField body="bgColor" type="string">
  Background Colour Hex
</ParamField>

<ParamField body="name" type="string">
  Customer name
</ParamField>

## Response description

<Tabs>
  <Tab title="200">
    <ResponseField name="hosted_url" type="string">
      Hosted Auth-Flow URL
    </ResponseField>
  </Tab>

  <Tab title="400">
    <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}
  {
      "hosted_url": "https://connect.gocobalt.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdfaWQiOiI2M2M5M2RhMGI0NmI3MjQzNzg1YTFlMTciLCJsaW5rZWRfYWNjb3VudF9pZCI6IjEyMzQ1Njc4IiwiZW52aXJvbm1lbnQiOiJ0ZXN0IiwiaWF0IjoxNjg2NzM1ODMxLCJleHAiOjE2ODY5OTUwMzF9.DOKY6iXkfjLcSK8vIqtQ1mHuh92pZMhlddladdovGL8"
  }
  ```

  ```JSON 400 theme={null}
  {
      "status_code": 400,
      "http_error_type": "BAD_REQUEST",
      "error_code": "SERVER_ERROR",
      "message": "Linked account Id and Template Id both are required",
      "request_id": "c34e179c-783d-4464-af6a-7a353e301a46",
  }
  ```
</ResponseExample>
