Sites

Create a site

Creates a site with its first configuration version and one active public key. Origins are optional here and can be added later. A configuration that is left out, or names only some fields, takes the privacy-first defaults for the rest; recording is not switched on by creating a site. With an Idempotency-Key, a retry of the same request returns the first answer (with Idempotent-Replayed: true) and creates nothing; the key is honoured for 24 hours. A partner integration's managed key must send one. external_id is your own identifier: unique in the organisation and fixed, it finds the site with GET /v1/sites?external_id= even after the key has expired. Needs analytics.sites.write.

post/v1/sites

Request

  • Base URL: https://api.ironfang.com/analytics
  • URL: https://api.ironfang.com/analytics/v1/sites
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Headers

Idempotency-Keystring

Makes the request safe to retry: the same key with the same request returns the first answer for 24 hours. Generate one per logical change. Required when the caller is a partner integration's managed key.

Request body

external_idstring

Your own identifier for the site. Opaque to Ironfang, not a secret, and never changes.

namestring required
originsstring[]
retention_daysinteger
session_retention_daysinteger

How long session history is kept; at least retention_days.

timezonestring

IANA time zone used for reports.

Example request

{
  "external_id": "checkout-1042",
  "name": "Checkout",
  "origins": [
    "https://shop.example.com"
  ],
  "timezone": "Europe/London"
}

Response

Site created, or the stored answer to the same request with the same Idempotency-Key

Example response

{
  "origins": [
    {
      "dns_record": {
        "name": "_ironfang-analytics.shop.example.com"
      },
      "origin": "https://shop.example.com"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.