GET /v1/targets/{id}/read
Run a target’s pinned measure for at most 12 started periods per call (12 bounds measure runs, not periods returned: the first page runs the current period and up to 11 before it and also lists every not-started period with stated values only, up to 52 entries total). Pass next_cursor as cursor with the same version or as_of (for a latest read, pass the returned version so an intervening revision does not invalidate the cursor). Optional version or as_of selects which revision’s periods, stated values, pinned measure version and holder are used; actuals and today always reflect current books and date. Returns per period and stated column: stated value, actual, exact decimal integer gap (actual - stated, which can exceed signed 64-bit), status (met, not_met, in_progress, cant_be_measured with reason, not_started, or not_run for a started period current_only did not run), open-pipeline estimate as read, supporting context columns (the measure’s remaining declared non-estimate columns for each measured started period), and target and measure versions used; a measure failure for a period (including an overflow in an unstated column) marks every stated column in that period cant_be_measured and each supporting context column ok: false without failing other periods.
All operations · Reusable schemas
Complete operation contract
{
"operationId": "targets.read",
"description": "Run a target's pinned measure for at most 12 started periods per call (12 bounds measure runs, not periods returned: the first page runs the current period and up to 11 before it and also lists every not-started period with stated values only, up to 52 entries total). Pass next_cursor as cursor with the same version or as_of (for a latest read, pass the returned version so an intervening revision does not invalidate the cursor). Optional version or as_of selects which revision's periods, stated values, pinned measure version and holder are used; actuals and today always reflect current books and date. Returns per period and stated column: stated value, actual, exact decimal integer gap (actual - stated, which can exceed signed 64-bit), status (met, not_met, in_progress, cant_be_measured with reason, not_started, or not_run for a started period current_only did not run), open-pipeline estimate as read, supporting context columns (the measure's remaining declared non-estimate columns for each measured started period), and target and measure versions used; a measure failure for a period (including an overflow in an unstated column) marks every stated column in that period cant_be_measured and each supporting context column ok: false without failing other periods.",
"parameters": [
{
"name": "X-Economico-Business",
"in": "header",
"required": true,
"description": "Explicit business slug for this request; must be approved by the connection and token.",
"schema": {
"type": "string"
}
},
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"pattern": "^tgt_[0-9A-HJKMNP-TV-Z]{26}$"
}
},
{
"name": "version",
"in": "query",
"required": false,
"description": "Target version number to evaluate (selects that revision's periods, stated values, pinned measure version and holder; actuals and today reflect current books and date). Mutually exclusive with as_of.",
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "as_of",
"in": "query",
"required": false,
"description": "UTC calendar date (YYYY-MM-DD) compared with when each version was recorded; selects the highest version recorded on or before this date (its periods, stated values, pinned measure version and holder), while reading current actuals and today. Mutually exclusive with version.",
"schema": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
}
},
{
"name": "cursor",
"in": "query",
"required": false,
"description": "Opaque next_cursor returned by a previous page. Must be sent with the same version or as_of it was issued for (for a latest read, pass the returned version so an intervening revision does not invalidate it).",
"schema": {
"type": "string",
"minLength": 1
}
},
{
"name": "current_only",
"in": "query",
"required": false,
"description": "true runs the measure for the current period only (the one containing today, else the latest started one) and returns every other period on one page without running it: started ones with status not_run, upcoming ones not_started. Takes no cursor.",
"schema": {
"type": "boolean"
}
}
],
"responses": {
"200": {
"description": "Target read result with per-period stated values, actuals, exact decimal integer gaps, statuses, open-pipeline estimates, supporting context columns and versions used.",
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"spec": {
"type": "string",
"const": "economico.target-read/1"
},
"id": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"measure"
]
},
"status": {
"type": "string",
"enum": [
"proposed",
"active",
"archived"
]
},
"version": {
"type": "number"
},
"latest_version": {
"type": "number"
},
"name": {
"type": "string"
},
"description": {
"type": [
"string",
"null"
]
},
"measure": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"version": {
"type": "number"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"version",
"name"
],
"additionalProperties": false
},
"holder": {
"anyOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "company"
}
},
"required": [
"kind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "pipeline"
},
"pipeline": {
"type": "string"
}
},
"required": [
"kind",
"pipeline"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "party"
},
"party": {
"type": "string"
}
},
"required": [
"kind",
"party"
],
"additionalProperties": false
}
]
},
"mode": {
"type": "string",
"enum": [
"each_period",
"to_date"
]
},
"labels": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
},
"today": {
"type": "string"
},
"time_zone": {
"type": "string"
},
"head": {
"anyOf": [
{
"type": "object",
"properties": {
"event_id": {
"type": "number"
},
"cid": {
"type": "string"
}
},
"required": [
"event_id",
"cid"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"total_periods": {
"type": "number"
},
"periods_run": {
"type": "number"
},
"periods": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"index": {
"type": "number"
},
"from": {
"type": "string"
},
"through": {
"type": "string"
},
"window": {
"type": "object",
"properties": {
"from": {
"type": "string"
},
"through": {
"type": "string"
}
},
"required": [
"from",
"through"
],
"additionalProperties": false
},
"started": {
"type": "boolean",
"const": true
},
"values": {
"type": "array",
"items": {
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"comparison": {
"type": "string",
"enum": [
"at_least",
"at_most"
]
},
"stated": {
"type": "string"
},
"status": {
"type": "string",
"const": "not_run"
}
},
"required": [
"column",
"unit",
"comparison",
"stated",
"status"
],
"additionalProperties": false
}
}
},
"required": [
"index",
"from",
"through",
"window",
"started",
"values"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"index": {
"type": "number"
},
"from": {
"type": "string"
},
"through": {
"type": "string"
},
"window": {
"type": "object",
"properties": {
"from": {
"type": "string"
},
"through": {
"type": "string"
}
},
"required": [
"from",
"through"
],
"additionalProperties": false
},
"started": {
"type": "boolean",
"const": true
},
"error": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"comparison": {
"type": "string",
"enum": [
"at_least",
"at_most"
]
},
"stated": {
"type": "string"
},
"actual": {
"type": "string"
},
"gap": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"met",
"not_met",
"in_progress"
]
},
"estimate": {
"anyOf": [
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"ok": {
"type": "boolean",
"const": true
},
"value": {
"type": "string"
}
},
"required": [
"column",
"unit",
"ok",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"ok": {
"type": "boolean",
"const": false
},
"reason": {
"type": "string"
}
},
"required": [
"column",
"unit",
"ok",
"reason"
],
"additionalProperties": false
}
]
}
},
"required": [
"column",
"unit",
"comparison",
"stated",
"actual",
"gap",
"status"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"comparison": {
"type": "string",
"enum": [
"at_least",
"at_most"
]
},
"stated": {
"type": "string"
},
"status": {
"type": "string",
"const": "cant_be_measured"
},
"reason": {
"type": "string"
},
"estimate": {
"anyOf": [
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"ok": {
"type": "boolean",
"const": true
},
"value": {
"type": "string"
}
},
"required": [
"column",
"unit",
"ok",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"ok": {
"type": "boolean",
"const": false
},
"reason": {
"type": "string"
}
},
"required": [
"column",
"unit",
"ok",
"reason"
],
"additionalProperties": false
}
]
}
},
"required": [
"column",
"unit",
"comparison",
"stated",
"status",
"reason"
],
"additionalProperties": false
}
]
}
},
"context": {
"description": "Present when the pinned measure declares non-estimate columns not stated in this period; returns each supporting column's evaluated value or why it could not be measured.",
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"ok": {
"type": "boolean",
"const": true
},
"value": {
"type": "string"
}
},
"required": [
"column",
"unit",
"ok",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"ok": {
"type": "boolean",
"const": false
},
"reason": {
"type": "string"
}
},
"required": [
"column",
"unit",
"ok",
"reason"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"index",
"from",
"through",
"window",
"started",
"values"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"index": {
"type": "number"
},
"from": {
"type": "string"
},
"through": {
"type": "string"
},
"started": {
"type": "boolean",
"const": false
},
"values": {
"type": "array",
"items": {
"type": "object",
"properties": {
"column": {
"type": "string"
},
"unit": {
"anyOf": [
{
"type": "string",
"const": "number"
},
{
"type": "string",
"const": "percent"
},
{
"type": "string",
"pattern": "^[A-Z]{3}$"
}
],
"description": "\"number\", \"percent\", or an uppercase 3-letter ISO 4217 currency code (e.g. \"USD\")."
},
"decimals": {
"description": "Present when the column's whole number is scaled: divide by ten to this power to place the decimal point. Absent means a whole number.",
"type": "integer",
"minimum": 1,
"maximum": 6
},
"comparison": {
"type": "string",
"enum": [
"at_least",
"at_most"
]
},
"stated": {
"type": "string"
},
"status": {
"type": "string",
"const": "not_started"
}
},
"required": [
"column",
"unit",
"comparison",
"stated",
"status"
],
"additionalProperties": false
}
}
},
"required": [
"index",
"from",
"through",
"started",
"values"
],
"additionalProperties": false
}
]
}
},
"next_cursor": {
"type": [
"string",
"null"
]
}
},
"required": [
"spec",
"id",
"kind",
"status",
"version",
"latest_version",
"name",
"description",
"measure",
"holder",
"mode",
"labels",
"today",
"time_zone",
"head",
"total_periods",
"periods_run",
"periods",
"next_cursor"
],
"additionalProperties": false
}
}
}
},
"400": {
"description": "Invalid envelope, query or domain input; also `missing_rates`, a foreign-currency command whose exchange rates the shared store could not supply (`details.missing_rates: [{ base, quote, date }]`, plus `details.refusal: { code, message }` when the command also refused), answered by stating an evidenced `exchangeRate`.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing or invalid bearer token. Follow the WWW-Authenticate resource_metadata URL.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"WWW-Authenticate": {
"schema": {
"type": "string"
}
}
}
},
"402": {
"description": "plan_required: the command needs a platform plan this business is not on, or would record more events than its allowance has left. The refusal writes nothing (a retry may keep its idempotency key). `details.reason` names which, and each reason has its own details schema: `solo_limit` (Solo's monthly allowance), `plan_cancelled` (a cancel caps each period at `allowed` until `endsAt`), `usage_settled` (a kept plan's period was settled at the cancel), `feature` (a feature the plan lacks) and `member_limit` (Founders' people limit). Counts are decimal strings and instants are UTC. Any new paid plan starts only once every invoice from Economico is paid; until then the billing page says so. Reads, exports and payment setup stay available, and so does upgrading unless the business is set to close (`closesAt`). Where the platform_purchase tool is offered (an owner's full-access agent while paid plans are on sale), its action billing reads the plan's end, cap and at-cancel charge before a refusal; otherwise the owner's billing page shows them.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PlanRequired"
}
}
}
},
"403": {
"description": "Membership revoked, business unavailable for writes, or command credential requirements not met (browser-only commands refuse all OAuth tokens). `demo_business`: the business is a demo (`demo: true` on the business read: fictional, its owner's alone) and the command would reach someone else, send a message (support included, for now), publish it, take a plan or make it look like a real company, or the demo has recorded the 2,000 events it may record; tell the user, who can create their own business to do this.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Target or requested version not found.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"405": {
"description": "Method not supported.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Allow": {
"schema": {
"type": "string"
}
}
}
},
"408": {
"description": "Request body transfer timed out (code `upload_timeout`): it took over 30 s, or paused over 5 s between chunks; retry the same request.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "Domain or idempotency conflict.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"411": {
"description": "Length required (code `length_required`): a JSON body larger than 256 KiB must send Content-Length.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "Payload too large (code `payload_too_large`): the request body exceeds the admitted byte limit.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "JSON body required.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Address rate budget exhausted. Wait for Retry-After seconds before retrying.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Retry-After": {
"schema": {
"type": "string",
"pattern": "^[0-9]+$"
}
}
}
},
"500": {
"description": "Internal failure.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Busy (code `busy`): the business is still receiving other document uploads or serving other large documents, and did not start this request. Retry the same request after Retry-After seconds.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Retry-After": {
"schema": {
"type": "string"
}
}
}
}
}
}