Percia API

JSON HTTP API to create and manage camera watches, agents, sites, cameras, alert destinations, REST hooks, events with keyframe evidence, usage and billing. Auth by Bearer API key (pk_live_) with scopes, or OAuth 2.1 with PKCE.

GitHub OpenAPI

Operations 145

GET /health Liveness check #
GET /config Public client configuration #
GET /status Public status of each alert destination #
GET /openapi.json This document #
GET /auth/{path} Better Auth endpoints (sign-in, session, ...) #
POST /auth/{path} Better Auth endpoints (sign-up, sign-in, sign-out, ...) #
GET /me Current user and subscription #
GET /me/sign-in-methods How this account signs in: the linked providers (Google, GitHub, Apple) with when they were linked, and whether it has an email and password. Session only; never a token or provide #
POST /me/delete Delete your account and all its data (session, or an OAuth token with account:delete; never an API key). Body {confirm: }. The sign-in must be under 15 minutes old. #
POST /keys Create an API key (session only). The full key is returned once. #
GET /keys List your API keys (prefix, scopes, created, last used, revoked). Never the key itself. #
DELETE /keys/{id} Revoke an API key immediately #
GET /connected-apps List OAuth apps (MCP clients) you approved: name, permissions, last used (session only) #
DELETE /connected-apps/{clientId} Revoke an OAuth app immediately (session only) #
POST /stripe/webhook Stripe webhook receiver (signed by Stripe) #
POST /billing/checkout Start a Stripe checkout (403 selling_disabled while paid plans are not on sale; 409 already_subscribed when the account already has a subscription: use the portal) #
PATCH /billing/cap Set your monthly spend cap in cents ($5 to $10,000; default $200). When this month's camera time reaches it, watches pause (only while billing is enforced). Change it only when the #
POST /billing/redeem Redeem a credit code for camera-minutes (credits are minutes of watching, used before the free minutes and before the card). A code is shown to its owner once: pass it in the body, #
GET /billing/credits Your credit grants (minutes, remaining, source, expiry) and your last 20 redemptions. Never returns a code. #
POST /billing/pay-invoice Retry paying the open failed invoice with the stored payment method (session only; allowed while blocked). To change the card use the portal. #
POST /billing/portal Open the Stripe customer portal (also the way to update a failed payment method) #
POST /billing/card/replace Replace your card: a Stripe setup Checkout that adds a new card and charges nothing (a card must stay on file: it can be replaced, never removed). 404 when no card was added yet. #
POST /billing/card/finish After a replace: the newest card becomes the default and older cards are detached; the last card is never detached. Safe to repeat. #
POST /cameras Create a camera. For a camera on a private network (ONVIF, RTSP, Frigate, Home Assistant, NVR) the person installs the Percia bridge (https://github.com/velvee-ai/percia-bridge), w #
GET /cameras List your cameras, newest first #
POST /cameras/link Make a camera from a public video link (rtsp, rtsps, http or https). Percia pulls it on its media host while a watch on it is active, so the camera then works like any other: use p #
POST /cameras/{id}/pair Issue a new pairing link; any unused earlier link stops working (no request body; phone cameras) #
POST /cameras/bulk Register up to 10 push cameras at once (an NVR connector). Each needs name and externalId and is idempotent by externalId (existing ones come back with token null). All or nothing #
GET /cameras/{id}/status Poll one camera: state waiting (never published), online, offline or revoked, lastSeenAt, secondsSinceSeen and a hint with the likely reason and next step. Online means a heartbeat #
POST /cameras/{id}/token Rotate the publish token of a push camera (no request body); the old one stops working at once. Returns the new token once. Phone cameras: 409 wrong_kind (pair again). #
DELETE /cameras/{id}/token Revoke the publish token of a push camera: publishing stops at once, the camera stays. Rotate to publish again. #
POST /cameras/pair/check Check that a pairing token belongs to one of your cameras and has not expired. show_link does this for you #
DELETE /cameras/{id} Remove a camera; its token stops working at once #
POST /uploads Start uploading a video file (mp4, mov, webm, mkv) as a watch source. Declare name and size; refused here (400 unsupported_type, 413 too_large, 429 upload_limit) before any byte mo #
GET /uploads List your video files, newest first #
POST /uploads/from-url Make a video file from a public https URL (for MCP agents, which cannot send bytes). Percia fetches it itself, one request: public https only (no IP addresses, private or internal #
PUT /uploads/{id}/parts/{n} Send part n (1-based) as the raw request body (application/octet-stream). Every part but the last is exactly `partSize` bytes. Returns the etag to give to /complete. A part may be #
POST /uploads/{id}/complete Finish the upload with the part etags. The file is read back and checked: container, codec (H.264, H.265, VP8, VP9, AV1) and length (over the limit = too_long). A refused file is d #
GET /uploads/{id} One video file #
DELETE /uploads/{id} Delete a video file (or stop an upload). The file also goes with the last watch that uses it, with the account, and after its retention period. #
GET /uploads/{id}/play A short-lived (15 minutes) signed address for playing the file in a video element. A credential: do not store or share it. #
GET /files/{id} The signed, ranged read of a video file (query exp and sig). Used by the pool and the player; the signature is the credential. Never cached. #
POST /devices Register this phone for push alerts (Percia Camera app). Upserts by Expo push token: a token registered by someone else moves to you. Alerts carry only the watch goal, 'Goal met' a #
GET /devices List your registered phones (the push token is never returned) #
DELETE /devices/{token} Stop push alerts to one phone (your own Expo push token, URL-encoded). Needs only devices:write #
POST /cam/claim Pair a phone: exchange the single-use pairing token for the camera token (returned once). Public, rate limited per IP. #
GET /cam/whip Where this camera publishes right now. Authorization: Bearer . Returns {whipUrl}: the camera's home relay host while it is up, else another up relay. Ask on every (re #
POST /cam/heartbeat Camera is alive (no request body). Authorization: Bearer : a phone's token or a push camera's publish token. Send it every 20 s while publishing; online = under 60 s #
POST /watches/owned Create a watch as the signed-in user (email or webhook; no Turnstile). sourceUrl may be percia-cam:// for one of your own phone or bridge cameras; a private address (192. #
POST /watches/draft Start a watch the clarifying way (Percia). Send the plain ask and the camera (`cameraId` of one of your cameras, or a public `sourceUrl`). Percia's intelligence layer reads it and #
GET /watches/draft/{id} Read a clarify draft (your own): its status, question, options, conditions and the conversation so far. #
POST /watches/draft/{id}/answer Answer the draft's question: `text` is the number of one of the options ("2") or the person's own words. Only a draft that is still clarifying takes an answer; a draft that became #
GET /watches/{id} Get one of the signed-in user's watches #
PATCH /watches/{id} Update a watch. `status: "active"` with `testRun: true` starts a 30-minute live test run (events are marked test events); `status: "active"` alone goes live, also from a running te #
DELETE /watches/{id} Delete a watch #
POST /watches/{id}/secret/rotate Rotate the webhook signing secret (the old one stops working at once) #
POST /watches/{id}/test-delivery Send a signed goal.test event to the watch's webhook and report the response #
GET /watches/mine List the signed-in user's watches #
GET /watches/{id}/events Page through a watch's events, newest first #
GET /events List events across all your watches, newest first #
GET /events/stream Developer event feed: server-sent events of your account, for local development #
GET /events/sample One example event in the shape of the feed #
POST /hooks Register a REST hook that receives each event, signed #
GET /hooks List your REST hooks #
DELETE /hooks/{id} Remove a REST hook (idempotent) #
POST /hooks/{id}/test Send one signed goal.test event to the hook and report the answer #
GET /sites List your sites with watchCount and memoryUpdatedAt #
POST /sites Create a site (at most 20 per user). Watches join it with siteId on create or PATCH. #
GET /sites/{id} Get a site: notes, memory (brief, entities), memoryRev and its watches #
PATCH /sites/{id} Update the name and/or notes. A notes change updates the context of every watch in the site. #
DELETE /sites/{id} Delete a site. Its watches keep working without context. #
POST /sites/{id}/memory/clear Reset the brief and entities (notes stay) #
PATCH /sites/{id}/memory Correct the memory: brief and/or entities (at most 30) #
POST /sites/{id}/ask Ask Percia a question about the site; answers from the memory, notes and the last 200 events. 30 per user per hour. API keys need only watches:read. #
GET /sites/{id}/timeline Page through the events of all watches in the site, newest first #
PUT /sites/{id}/context Replace the site's context (SiteContext): calibration, facts, zones, signal declarations (advanced) #
GET /sites/{id}/context Read the site's context and its open context requests (advanced) #
POST /signals Send timed machine signals (Signal) for a camera or site (advanced) #
GET /watches/{id}/actions The typed recommendations (ActionEvent) the engine made for an advanced watch, newest first #
GET /deployments List your watches that run an agent, with agent, version (pinned or latest), status and last event #
GET /agents List your agents, newest first #
POST /agents Create an agent with this config as its draft (at most 50 per user) #
POST /agents/build Describe what to watch for in plain words; the builder creates an agent (draft) and explains it. 30 builder calls per user per hour. #
GET /agents/{id} Get one of your agents: draft, published config and versions #
PATCH /agents/{id} Update the name and/or the draft (published versions never change) #
DELETE /agents/{id} Delete an agent and its versions #
POST /agents/{id}/publish Freeze the draft as the next version. Deployments following the latest version move to it. #
GET /agents/{id}/versions/{version} One frozen version of an agent #
POST /agents/{id}/chat Ask the builder to change the draft in plain words. It sees the draft and the last 20 messages. #
GET /agents/{id}/messages The builder conversation for this agent, oldest first (last 100) #
GET /watches/{id}/events/{eventId}/keyframe The decrypted keyframe (JPEG) of an event. Needs events:read with an API key. #
GET /cameras/{id}/thumbnail The latest snapshot (JPEG) of one of your cameras, cut from its recording: the picture on watch cards and camera tiles. 404 when the camera never sent video. Needs cameras:read and #
GET /watches/{id}/events/{eventId}/clip The event's clip (video/mp4, H.264, no audio): from about 10 seconds before the event to 6 seconds after it, cut from the camera's recording. Supports `Range` requests. Needs event #
GET /evidence/{token} The clip (video/mp4, ranges supported) or keyframe (JPEG) a signed link names. Public: the token is the credential, it names one event and expires (24 hours for links in email, int #
GET /img/{token} The image a signed link names (JPEG). Public: the token is the credential; 404 once it expires (10 minutes for the app and agents; a link sent to a connected service does not expir #
POST /watches/{id}/live Live view of a watch. Phone cameras get a WHEP address and a 10 minute viewer token; other sources get the latest keyframe. #
GET /quality/tests The test side of Quality: ground-truth clips (total and across how many watches), tests started in the last 7 days, and per watch its clip count and the scores of its last finished #
GET /watches/{id}/dataset The watch's dataset: clips labelled should_match, should_not or counterfactual. They are the ground truth tests score against. #
POST /watches/{id}/dataset Upload one clip to the dataset: multipart/form-data with `file` (MP4 or MOV, up to 32 MB and 120 s), `label` (should_match, should_not, counterfactual) and an optional `note` (up t #
GET /watches/{id}/dataset/near-misses Moments worth labelling: close calls (alerts the judge was barely sure of), false alarms you marked (events with a stored clip) and the misses you reported (windows, cut from the r #
POST /watches/{id}/dataset/from-event Keep an event's clip in the dataset with a label. An event already in the dataset only has its label changed. Marking an event Correct or False alarm does this by itself (should_ma #
POST /watches/{id}/dataset/from-miss Keep a miss you reported (POST /watches/{id}/misses) as a dataset clip with a label: the footage of the first 100 seconds of the window you reported is cut from the camera's record #
PATCH /watches/{id}/dataset/{clipId} Change a clip's label or note. #
DELETE /watches/{id}/dataset/{clipId} Delete a clip and its stored video. The dataset also goes with the watch and with the account. #
GET /watches/{id}/dataset/{clipId}/thumb A clip's thumbnail (the event's keyframe), decrypted for the owner. 404 for an uploaded clip (it has none). #
GET /watches/{id}/tests The watch's test runs, newest first, and the latest finished one with its scores. A test replays the watch on recorded video and scores it; nothing is delivered. #
POST /watches/{id}/tests Start a test. JSON {source: "recent", minutes?: 1..10} replays the camera's last minutes, {source: "window", from, minutes?: 1..10} an earlier time (up to 14 days back, ending at l #
GET /watches/{id}/tests/{testId} One test run. While it runs, `status` is running and there are no scores; when it ends, `scores` has Caught, False alarms, Avg delay and Verdict (each a figure with its total, or n #
GET /test-clips/{testId}/{clipId} The signed, short-lived read of one dataset or uploaded clip for a running test, or (clipId arc-) of one five minute range of the camera's archive for an earlier-time test (quer #
POST /watches/{id}/misses Report a miss: the watch should have alerted in this window and did not. The window is at most 600 seconds, not in the future, not older than 30 days. On a running Percia watch it #
GET /watches/{id}/misses The misses reported on a watch, newest first, with what the engine did with each #
GET /watches/{id}/quality How right one watch is. `marks` are exact counts of your own Correct / False alarm / Partly / Missed marks (`rightShare` is null until 3 events are rated). `engine` is the running #
GET /quality How right all your watches are: totals from your marks, events still to review (unmarked alerts of the last 14 days), one row per watch, and a coaching tip when your marks give a r #
POST /watches/{id}/events/{eventId}/feedback Mark an event correct, a false alarm, or partly right (`partly` needs the correction in `note`). With a keyframe a correct or false alarm becomes (or updates) a test case with the #
GET /agents/{id}/tests The agent's test cases (pinned examples), newest first #
GET /agents/{id}/tests/runs Latest test runs of the agent (20), newest first #
POST /agents/{id}/tests/run Judge every test case (at most 50) against a version of the agent, or its draft, and store the run #
DELETE /tests/{caseId} Delete a test case and its pinned image #
GET /tests/{caseId}/image The pinned image (JPEG) of a test case #
GET /metrics Per watch and per agent: events per day, feedback counts, false-alarm rate and the last test pass rate #
POST /agents/{id}/actions/{index}/test Run one action of the draft against a sample event (counts toward 60 action calls per hour) #
GET /usage Daily usage (UTC days): active watch-hours, camera-minutes (what is priced), events, model calls and action calls #
GET /usage/cameras This UTC month's camera minutes per camera (a phone camera by its name, a video link by its host), priced at the list price. `costCents` is list price, not what was charged: free a #
GET /plan Your plan (free, or pro shown as Pay as you go), its limits and your current counts. Limits count active watches only and bind only when `enforced` is true; when it is false they a #
GET /integrations/services Services a watch can reach. available is false when Percia has no app for that service yet. #
GET /integrations List your connected destinations #
POST /integrations/connect/{token}/start The person pressed Connect: returns the page to send them to (the service's approval page, or the Telegram bot) (session only) #
POST /integrations/connect/{token}/url Finish a Home Assistant, Microsoft Teams or webhook connect with a public https URL (session only). Teams takes only a Workflows webhook address (logic.azure.com or environment.api #
POST /integrations/connect/{token}/key Finish an IFTTT connect (Webhooks key and event) or a PagerDuty connect (Events API v2 integration key and severity info|warning|error|critical, default warning) (session only) #
POST /integrations/connect/{token}/twilio Finish an SMS or WhatsApp connect with the person's own Twilio credentials (session only) #
GET /integrations/callback/{service} Where Slack and Discord return the browser (session only). Redirects to /integrations?connected= or ?connect_error=. #
GET /session-hint Is this browser signed in? Reads the session cookie only and answers {signedIn} (no user data). For the percia.ai landing page: CORS with credentials for https://percia.ai and http #
POST /integrations/telegram/webhook Telegram bot updates (authenticated by X-Telegram-Bot-Api-Secret-Token) #
PATCH /integrations/{id} Make a destination a default (attached to every new watch automatically) or stop doing so. applyToExisting also adds it to the watches you already have. #
DELETE /integrations/{id} Disconnect a destination and remove its rules. Past delivery results stay until they age out (30 days). #
POST /integrations/{id}/test Send one labelled test alert ("Percia test: ignore") to one of your connected destinations, to check it works. No event or delivery is recorded and the connection is not changed. A #
GET /watches/{id}/integrations The connected destinations this watch sends to when its goal is met #
PUT /watches/{id}/integrations Replace the watch's rules (at most 5). They add to its notify and agent actions; an empty list removes them all. #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/percia-ai:percia-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

percia-ai-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Percia API
  version: 1.0.0
  description: Public HTTP API. Internal (/internal/*) and test (/test-sink/*) routes
    are not documented.
servers:
- url: https://playground.percia.ai/api
  description: Production (spec declares relative /api; served from playground.percia.ai)
tags:
- name: platform
  description: Public configuration, health and this document.
- name: identity
  description: Sign-in, the account, API keys and connected apps. Mostly for people
    (session only).
- name: billing
  description: Plans, checkout, and usage.
- name: cameras
  description: 'Cameras: a phone (pairing link a person opens) or a push camera (WHIP
    URL and token for a connector on a private network).'
- name: uploads
  description: 'Video files as watch sources (where enabled): upload in parts (a person''s
    app), `POST /uploads/from-url` for a public https video URL, or `POST /uploads/link`
    for an upload page the person opens (agents over MCP cannot send bytes), then
    watch `percia-file://<id>`. The file plays once at real speed and the watch ends.'
- name: devices
  description: Push devices of the Percia Camera app.
- name: watches
  description: 'Watches: a camera or video URL plus a plain-language goal. Create,
    change, pause, delete, and read their events.'
- name: events
  description: The account-wide event feed, for polling triggers in automation tools.
- name: hooks
  description: 'REST hooks: addresses an automation platform (Zapier, Make, n8n, Pipedream)
    registers to receive each event, signed like watch webhooks.'
- name: sites
  description: 'Sites: shared memory across the watches of one place.'
- name: advanced
  description: 'Advanced (Percia engine): a site''s context (calibration, facts, signal
    declarations), timed machine signals, and compound conditions on a watch (`advanced`
    on create). For agents and SDK users; see /docs/advanced.md.'
- name: agents
  description: 'Agents: reusable sets of concerns with versions, tests and actions.'
- name: evidence
  description: Keyframes, feedback, test cases and metrics.
- name: tests
  description: 'A watch''s dataset of labelled clips and its test runs: replay recorded
    video through the watch and read Caught, False alarms, Avg delay and a verdict.
    Nothing is delivered.'


# --- truncated at 32 KB (402 KB total) ---
# Full source: https://artifacts.apis.io/percia-ai/openapi/percia-ai-openapi.yml