# Client API: Reverse Proxy

> User-managed reverse-proxy routes (TLS, upstreams, WAF settings).

Source: https://docs.coritan.com/api/reference/client/reverse-proxy/

User-managed reverse-proxy routes (TLS, upstreams, WAF settings).

Base URL: `https://api.coritan.com/api/v1`. Paths below are complete.

To try these requests in the browser, open the [interactive Client API reference](https://api.coritan.com/docs).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/proxy/routes`](#op-get-api-v1-proxy-routes) | List proxy routes owned by the current user |
| POST | [`/api/v1/proxy/routes`](#op-post-api-v1-proxy-routes) | Create a proxy route for a domain you own |
| POST | [`/api/v1/proxy/routes/connect-domain`](#op-post-api-v1-proxy-routes-connect-domain) | Connect a user's domain to their container server |
| GET | [`/api/v1/proxy/routes/{route_id}`](#op-get-api-v1-proxy-routes-route-id) | Get details of a proxy route you own |
| PATCH | [`/api/v1/proxy/routes/{route_id}`](#op-patch-api-v1-proxy-routes-route-id) | Update a proxy route you own |
| DELETE | [`/api/v1/proxy/routes/{route_id}`](#op-delete-api-v1-proxy-routes-route-id) | Delete a proxy route you own |
| POST | [`/api/v1/proxy/routes/{route_id}/error-page/preview`](#op-post-api-v1-proxy-routes-route-id-error-page-preview) | Render the page visitors would see, for a block that is not saved yet |
| GET | [`/api/v1/proxy/routes/{route_id}/redirect-rules`](#op-get-api-v1-proxy-routes-route-id-redirect-rules) | List redirect rules for a route you own |
| POST | [`/api/v1/proxy/routes/{route_id}/redirect-rules`](#op-post-api-v1-proxy-routes-route-id-redirect-rules) | Create a redirect rule for a route you own |
| PATCH | [`/api/v1/proxy/routes/{route_id}/redirect-rules/{rule_id}`](#op-patch-api-v1-proxy-routes-route-id-redirect-rules-rule-id) | Update a redirect rule for a route you own |
| DELETE | [`/api/v1/proxy/routes/{route_id}/redirect-rules/{rule_id}`](#op-delete-api-v1-proxy-routes-route-id-redirect-rules-rule-id) | Delete a redirect rule for a route you own |
| POST | [`/api/v1/proxy/routes/{route_id}/ssl`](#op-post-api-v1-proxy-routes-route-id-ssl) | Request SSL certificate issuance for a proxy route you own |

### List proxy routes owned by the current user {#op-get-api-v1-proxy-routes}

`GET /api/v1/proxy/routes`

List proxy routes owned by the current user.

The list stays slim: what the Proxies list and the website's WAF tab
show for a row, so neither reads a route or a certificate per row. That
is the origin and whether it speaks TLS, the redirect, the extra origins,
the switches, development mode as the edge reads it and the certificate
``GET /ssl/certificates/{domain}/status`` would name. Origin protocol,
gRPC, and outbound PROXY are on create/update and the detail ``SELECT *``.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `page` | query | integer | no | Default: `1`. |
| `per_page` | query | integer | no | Default: `50`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Create a proxy route for a domain you own {#op-post-api-v1-proxy-routes}

`POST /api/v1/proxy/routes`

Create a proxy route for a domain you own.
Ownership is verified via domain registration or DNS zone.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `domain` | string | yes |
| `upstream_host` | string or null | no |
| `upstream_port` | integer | no |
| `upstream_ssl` | boolean | no |
| `force_https` | boolean | no |
| `websocket_enabled` | boolean | no |
| `waf_enabled` | boolean | no |
| `send_proxy_protocol` | boolean | no |
| `upstream_protocol` | string | no |
| `grpc_enabled` | boolean | no |
| `max_body_size_mb` | integer | no |
| `timeout_seconds` | integer | no |
| `auto_ssl` | boolean | no |
| `redirect_to` | string or null | no |
| `redirect_status_code` | integer | no |
| `redirect_preserve_path` | boolean | no |
| `redirect_preserve_query` | boolean | no |
| `strip_path_prefix` | string or null | no |
| `upstream_path_prefix` | string or null | no |
| `custom_headers` | any or null | no |
| `upstream_backends` | any or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Connect a user's domain to their container server {#op-post-api-v1-proxy-routes-connect-domain}

`POST /api/v1/proxy/routes/connect-domain`

Connect a user's domain to their container server.
Creates or updates a proxy route pointing the domain at the container's IP/port,
and optionally provisions an SSL certificate.

Requirements:
- User must own the domain (via registration or DNS zone)
- User must own the server

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `server_uuid` | string | yes |
| `domain` | string | yes |
| `auto_ssl` | boolean | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Get details of a proxy route you own {#op-get-api-v1-proxy-routes-route-id}

`GET /api/v1/proxy/routes/{route_id}`

Get details of a proxy route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Update a proxy route you own {#op-patch-api-v1-proxy-routes-route-id}

`PATCH /api/v1/proxy/routes/{route_id}`

Update a proxy route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `upstream_host` | string or null | no |
| `upstream_port` | integer or null | no |
| `upstream_ssl` | boolean or null | no |
| `force_https` | boolean or null | no |
| `websocket_enabled` | boolean or null | no |
| `waf_enabled` | boolean or null | no |
| `send_proxy_protocol` | boolean or null | no |
| `upstream_protocol` | string or null | no |
| `grpc_enabled` | boolean or null | no |
| `max_body_size_mb` | integer or null | no |
| `timeout_seconds` | integer or null | no |
| `redirect_to` | string or null | no |
| `redirect_status_code` | integer or null | no |
| `redirect_preserve_path` | boolean or null | no |
| `redirect_preserve_query` | boolean or null | no |
| `strip_path_prefix` | string or null | no |
| `upstream_path_prefix` | string or null | no |
| `custom_headers` | any or null | no |
| `upstream_backends` | any or null | no |
| `development_mode` | boolean or null | no |
| `development_mode_minutes` | integer or null | no |
| `error_page` | any or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Delete a proxy route you own {#op-delete-api-v1-proxy-routes-route-id}

`DELETE /api/v1/proxy/routes/{route_id}`

Delete a proxy route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Render the page visitors would see, for a block that is not saved yet {#op-post-api-v1-proxy-routes-route-id-error-page-preview}

`POST /api/v1/proxy/routes/{route_id}/error-page/preview`

Render the page visitors would see, for a block that is not saved yet.

``error_page: null`` shows the inherited page instead, so the console can
put "with" and "without" side by side.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `error_page` | any or null | no |
| `status` | integer | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### List redirect rules for a route you own {#op-get-api-v1-proxy-routes-route-id-redirect-rules}

`GET /api/v1/proxy/routes/{route_id}/redirect-rules`

List redirect rules for a route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Create a redirect rule for a route you own {#op-post-api-v1-proxy-routes-route-id-redirect-rules}

`POST /api/v1/proxy/routes/{route_id}/redirect-rules`

Create a redirect rule for a route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `source_pattern` | string | yes |
| `match_type` | string | no |
| `target_url` | string | yes |
| `status_code` | integer | no |
| `preserve_query` | boolean | no |
| `priority` | integer | no |
| `enabled` | boolean | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Update a redirect rule for a route you own {#op-patch-api-v1-proxy-routes-route-id-redirect-rules-rule-id}

`PATCH /api/v1/proxy/routes/{route_id}/redirect-rules/{rule_id}`

Update a redirect rule for a route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |
| `rule_id` | path | integer | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `source_pattern` | string or null | no |
| `match_type` | string or null | no |
| `target_url` | string or null | no |
| `status_code` | integer or null | no |
| `preserve_query` | boolean or null | no |
| `priority` | integer or null | no |
| `enabled` | boolean or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Delete a redirect rule for a route you own {#op-delete-api-v1-proxy-routes-route-id-redirect-rules-rule-id}

`DELETE /api/v1/proxy/routes/{route_id}/redirect-rules/{rule_id}`

Delete a redirect rule for a route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |
| `rule_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Request SSL certificate issuance for a proxy route you own {#op-post-api-v1-proxy-routes-route-id-ssl}

`POST /api/v1/proxy/routes/{route_id}/ssl`

Request SSL certificate issuance for a proxy route you own.

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `route_id` | path | integer | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
