---
title: "Add an origin"
method: POST
path: "/v1/sites/{siteId}/origins"
tags: ["Origins"]
---

# Add an origin

`POST /v1/sites/{siteId}/origins`

## Request

- Base URL: `https://api.ironfang.com/analytics`
- URL: `https://api.ironfang.com/analytics/v1/sites/{siteId}/origins`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Adds an origin the site's recorder may send from. It is normalised to exactly what a browser sends (lower case, no default port, no path). HTTPS is required except on localhost and loopback addresses, which are for development and need no verification. A public origin stays pending until its DNS TXT record is verified. Needs analytics.sites.write.

## Request body

- object
  - `origin` string, required

## Response `201`

Origin added

- object
  - `origin` Origin, required
    - `checked_at` string, date-time
    - `created_at` string, date-time, required
    - `dns_record` object: The TXT record to publish; absent for loopback origins.
      - `name` string, required
      - `type` 'TXT', required
      - `value` string, required
    - `id` string, uuid, required
    - `origin` string, required
    - `site_id` string, uuid, required
    - `verification` 'pending' | 'verified' | 'not_required', required
    - `verification_token` string
    - `verified_at` string, date-time

## Other responses

- `400`: The body is not one strict JSON value of the documented shape (`invalid_json`).
- `401`: No credential, an invalid one, an expired partner integration key, or a delegated token where none is accepted (`unauthorized`, `invalid_api_key`, `api_key_expired`, `delegated_not_allowed`).
- `403`: The credential lacks the permission or scope, names another organisation, or belongs to a partner integration that is not active (`forbidden`, `insufficient_scope`, `integration_inactive`).
- `404`: No such object in this organisation (`not_found`).
- `409`: The object already exists (`conflict`), or the site changed since it was read (`version_conflict`).
- `422`: A field is invalid, or a limit would be exceeded; the message names it (`invalid_request`, `limit_reached`).

---

[API](https://skmtc.dev/ironfang/apis/ironfang-analytics-api.md) · [All operations](https://skmtc.dev/ironfang/apis/ironfang-analytics-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ironfang/apis/ironfang-analytics-api/revisions/08197080c3d7?raw)
