---
title: "Install instructions"
method: GET
path: "/sites/{site}/install-instructions"
tags: ["Tracking"]
---

# Install instructions

`GET /sites/{site}/install-instructions`

## Request

- Base URL: `https://api.onelence.com/v1`
- URL: `https://api.onelence.com/v1/sites/{site}/install-instructions`
- Auth: one of:
  - OAuth 2 (authorization code, authorization URL `https://api.onelence.com/oauth/authorize`, token URL `https://api.onelence.com/oauth/token`, scopes: `tracking:read`)
  - HTTP bearer

Everything needed to install OneLence tracking in a website: the browser-safe publishable key, site id and host, npm and script snippets, the server-side conversion endpoint and a step-by-step guide for coding agents. Secret keys are never returned; the team manages them in OneLence under Settings → API keys.

## Path parameters

- `site` string, required

## Response `200`

Success.

- object
  - `object` 'install_instructions', required
  - `site` object, required
    - `id` string, required
    - `domain` string, required
  - `publishable_key` string, nullable, required
  - `browser` object, required
    - `package` '@crelora/mark', required
    - `npm_snippet` string, required
    - `script_snippet` string, required
    - `track_example` string, required
  - `server_conversions` object, required
    - `endpoint` string, required
    - `auth_header` 'x-secret-key', required
    - `secret_env_var` 'ONELENCE_SECRET_KEY', required
    - `example_body` object, required
    - `secret_key_location` string, required
  - `agent_guide` string, required
  - `rules` string[], required

## Other responses

- `400`: Invalid input; `error.param` names the field.
- `401`: Missing, expired or revoked token. WWW-Authenticate points to the resource metadata.
- `402`: subscription_required or upgrade_required; the error carries billing_url.
- `403`: insufficient_scope or admin_required.
- `404`: Unknown endpoint, site, source or record.
- `429`: Rate limited. Retry after Retry-After seconds.
- `500`: OneLence could not complete the request.

---

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