API Reference
The RubricHQ API lets you manage agents, metrics, scenarios, and runs, and ingest calls for analysis — programmatically.
Base URL: https://api.rubrichq.io/api/public/v1
All requests are authenticated with an API key: Authorization: Bearer <YOUR_API_KEY>. Create one under Settings → API Keys in the dashboard.
Each key is scoped to one workspace, so client_id is optional everywhere — omit it and the API uses your key’s workspace. Pass it only to target another workspace you can access.
Resources
- Agents — the AI agents under test, and how RubricHQ reaches them (phone and/or web).
- Metrics — the rubrics calls and runs are scored on: built-in ones plus your own.
- Scenarios — scripted test conversations, and the endpoint that runs one against an agent.
- Runs — the result of running a scenario: status, transcript, recording, metric results.
- Calls (Observability) — your real production calls, ingested as a recording and/or transcript and scored on the same metrics.
End-to-end in six requests
The steps below take you from nothing to a scored test call and a scored production call. Export your key first:
Create an agent
name and phone_number are always required. An agent you host yourself (agent_source: internal, the default) also needs instructions, language_id and opening_message. Add a web_channel if it can be reached over the web.
Keep the id from the response — it is your agent_id. (language_id 15 is English (US); GET /languages lists the rest.)
Create a metric
A metric applies to an agent only if you attach it with agent_ids, or make it workspace-wide with mark_as_global: true. A metric with neither is saved but never scored.
Create a scenario
A scenario is the script for RubricHQ’s simulated caller. Pick a persona_id from GET /personas.
Run it
This places a real call to your agent. channel picks how: phone, web, or text.
The response returns a run_id straight away.
Things that apply everywhere
- Errors come back as
{ "error": "…" }with a 4xx status —401bad or missing key,402out of credits,404not found in your workspace,409duplicate,422invalid or missing fields. Missing-field errors also list therequiredfield names. - Asynchronous work (ingesting a call, running a scenario, re-running metrics) returns immediately with a
pending/queuedstatus. Poll the matchingGETendpoint for the result. - Credits. Every metric that is scored and every call that is placed consumes credits. Pass
metric_idswhen ingesting a call or running a scenario to score only the metrics you need. - Deleting an agent or scenario archives it: it disappears from lists and lookups, but its history (calls, runs, results) is kept. Deleting a call or a custom metric is permanent.
- Pagination. List endpoints take
pageandper_page(max 100) and return ametaobject withtotal_countandtotal_pages.
Select a resource on the left to see its endpoints, parameters, and example requests.