---
title: "Create a site"
method: POST
path: "/projects/{project_id}/sites"
tags: ["Uptime sites"]
---

# Create a site

`POST /projects/{project_id}/sites`

## Request

- Base URL: `https://app.honeybadger.io/v3`
- URL: `https://app.honeybadger.io/v3/projects/{project_id}/sites`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/honeybadger/apis/honeybadger-api/docs/projects/:project_id/sites/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates an uptime monitoring site. Requires uptime monitoring on the plan.

## Path parameters

- `project_id` string, required

## Request body

- SiteCreateInput: Writable uptime-check site attributes. Omitted fields are unchanged; null resets or clears the fields marked nullable. Read-only fields are ignored.
  - `name` string: Name shown for the site in Honeybadger and on status pages.
  - `url` string, uri, required: Must start with http:// or https://, with no surrounding whitespace.
  - `match_type` 'success' | 'exact' | 'include' | 'exclude' | 'jmespath': How a response is judged. `success`: any 2xx; `match` must be left out. `exact`: the response status code equals `match`. `include` / `exclude`: the body does / doesn't contain `match`. `jmespath`: `match` is a JMESPath expression evaluated against the JSON body; numbers in it use backticks, not quotes.
  - `match` string, nullable: What `match_type` compares against (see SiteMatchType). Required unless `match_type` is `success`, and must be left out with `success`. Null clears it.
  - `request_method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
  - `validate_ssl` boolean, nullable: Fail the check when the TLS certificate does not validate. Null resets it to true.
  - `request_body` string, password, nullable: Body to send with the request, up to 32 KB. Null clears it.
  - `request_headers` object, nullable: Headers to send with the request, as header name to value. Replaces the stored headers; null or `{}` clears them.
  - `frequency` 1 | 2 | 5 | 15: Minutes between checks. A value below the plan's floor is refused.
  - `locations` SiteLocation[], nullable: A set of location names to check from. Null or empty means every location. A set; order is ignored and duplicates are dropped.
  - `outage_threshold` integer, nullable: Consecutive failures before an outage is declared. null means down once failures reach 50% of locations.
  - `active` boolean, nullable: Whether monitoring is active. After 740 consecutive failed checks the server sets it to false. Null resets it to true.
  - `timeout` integer, nullable: Request timeout in seconds, 1 to 120, default 30, and less than the frequency in seconds. Changing it requires the uptime timeout feature on the account; without it, only the current value (on create, the default) is accepted. Null resets it to the default.

## Response `201`

Site created

- object
  - `data` Site, required: A URL Honeybadger checks for uptime from several locations on a schedule, alerting when it goes down and when it recovers.
    - `id` string, uuid, required
    - `project_id` string, required: ID of the project this site belongs to
    - `name` string, required: Display name for the site
    - `url` string, required: URL to monitor. Includes the scheme.
    - `active` boolean, required: Whether monitoring is active. After 740 consecutive failed checks the server sets it to false.
    - `state` 'pending' | 'up' | 'down', required: Current state of the site
    - `last_checked_at` string, date-time, nullable, required: When the site was last checked
    - `match_type` 'success' | 'exact' | 'include' | 'exclude' | 'jmespath', required: How a response is judged. `success`: any 2xx; `match` must be left out. `exact`: the response status code equals `match`. `include` / `exclude`: the body does / doesn't contain `match`. `jmespath`: `match` is a JMESPath expression evaluated against the JSON body; numbers in it use backticks, not quotes.
    - `match` string, nullable, required: Value to match in the response
    - `request_method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', required
    - `frequency` 1 | 2 | 5 | 15, required: Minutes between checks. A value below the plan's floor is refused.
    - `locations` SiteLocation[], required: Locations checks run from. Unordered. [] means every location.
    - `validate_ssl` boolean, required: Whether to validate SSL certificates
    - `request_headers` object, required: Custom headers sent with check requests, as header name to value; {} when there are none
    - `request_body` string, password, nullable, required: Request body for POST/PUT checks
    - `outage_threshold` integer, nullable, required: Number of failed checks before declaring an outage
    - `timeout` integer, nullable, required: The stored request timeout in seconds; null means the default, 30. On a plan without custom timeouts the default applies whatever is stored.
    - `created_at` string, date-time, required: When the site was created
    - `links` WebLinks, required: Links into the Honeybadger web UI
      - `web` string, uri, required: The resource's page in the Honeybadger web UI, as an absolute URL. Resources without a page, such as outages and deploys, don't have `links`. For a project provisioned through Heroku, error, notice and comment links go through Heroku's single sign-on.
  - `meta` ResponseMeta
    - `request_id` string: Unique identifier for the request, for correlating with support

## Other responses

- `401`: The credential is missing, invalid, expired or revoked (`unauthorized`), or was sent in a way v3 doesn't accept (see the examples).
- `403`: The credential isn't allowed to do this. `error.code` says why. An account or project the credential doesn't cover is 404 `not_found`, not 403.
- `404`: Resource not found
- `422`: Validation error

---

[API](https://skmtc.dev/honeybadger/apis/honeybadger-api.md) - [All operations](https://skmtc.dev/honeybadger/apis/honeybadger-api/llms.txt) - [OpenAPI document](https://skmtc.dev/honeybadger/apis/honeybadger-api/revisions/cbcff53f2c8a?raw)
