# Site web

Base URL `https://pfcloud.pfctek.com/api/v1`. Every call needs `Authorization: Bearer mf_…`. Changes accept an `Idempotency-Key` header. Ids are public ids (UUIDs).

## POST /sites/{site}/certificate

**Install your own certificate**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

| Body field | Type | Description |
| --- | --- | --- |
| `certificate` | string | PEM chain |
| `private_key` | string | PEM key; never stored or logged |

## GET /sites/{site}/redirects

**List redirects**

Scope: `sites:read`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

## POST /sites/{site}/redirects

**Add a redirect**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

| Body field | Type | Description |
| --- | --- | --- |
| `from` | string |  |
| `to` | string |  |
| `code` | integer |  |
| `keep_query` | boolean |  |

## DELETE /sites/{site}/redirects

**Remove a redirect**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |
| `from` | query | The redirected path (required) |

## POST /sites/{site}/nginx-extras

**Let pfcloud add to an imported site’s Nginx config**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

## DELETE /sites/{site}/nginx-extras

**Stop pfcloud adding to the Nginx config**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

## POST /sites/{site}/https

**Request a Let’s Encrypt certificate now**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

## POST /sites/{site}/certificate/wildcard

**Request a wildcard certificate through Cloudflare**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

## POST /sites/{site}/releases

**Move an imported site to zero-downtime releases**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

| Body field | Type | Description |
| --- | --- | --- |
| `shared_paths` | string |  |
| `confirm` | string | The site’s domain, typed out to confirm |

## DELETE /sites/{site}/releases

**Switch back to the old folder**

Scope: `sites:write`

| Parameter | In | Description |
| --- | --- | --- |
| `site` | path | Public id from the dashboard address (required) |

