---
title: "Custom response headers, force-HTTPS and path-based redirect rules"
method: GET
path: "/projects/{projectId}/edge-rules"
tags: ["Edge rules"]
---

# Custom response headers, force-HTTPS and path-based redirect rules

`GET /projects/{projectId}/edge-rules`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/projects/{projectId}/edge-rules`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `projectId` string, uuid, required

## Response `200`

Edge rules

- object
  - `projectId` string, uuid, required
  - `headers` object, required
    - `presets` string[], required
    - `custom` object[], required
      - `name` string, required
      - `value` string, required
  - `forceHttps` boolean, required
  - `redirects` object[], required
    - `matchType` 'exact' | 'prefix' | 'regex', required
    - `source` string, required
    - `destination` string, required
    - `statusCode` union
      - 301
      - 302
    - `keepQuery` boolean
    - `enabled` boolean
    - `id` string, uuid, required
  - `rewrites` object[]
    - `matchType` 'exact' | 'prefix', required
    - `source` string, required
    - `destination` string, required
  - `vercelRuntime` boolean
  - `engine` object, required
    - `status` 'applied' | 'pending_deploy' | 'not_configured' | 'error', required
    - `message` string, nullable, required
    - `appliedAt` string, nullable, required: ISO-8601 timestamp
  - `updatedAt` string, nullable, required: ISO-8601 timestamp

## Other responses

- `400`: Invalid request, e.g. a bad CIDR/header/redirect pattern, or 307/308 on a redirect rule (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
