---
search:
  tags:
    - Topics
    - POST
seo:
  description: >-
    Resolve the physical read plan for a topic identity over a time… Reference
    for the POST /v2/topics/id/{topic_id}/read-plan endpoint in the Roboto REST
    API.
sidebar:
  label: Resolve read plan
  badge: POST
title: Resolve read plan
type: openapi-operation
---
Resolve the physical read plan for a topic identity over a time window.

The request body carries the window, the field projection (as field-subtree
addresses), an optional per-subtree representation ``prefer`` grammar, and
optionally names the schema and timeline source to use. A malformed
body, or a schema named by both id and checksum, yields a 400.

Authorization is two layers. The caller must first hold topic view
access in the org that owns the topic. Within the org, authorization
is all-or-nothing over the window, through view access to every
in-window partition's backing file: if the caller cannot view any
part of the requested window, the whole request fails with a 401
(``RobotoUnauthorizedException``) rather than returning a plan that
silently omits data.

When the body carries a ``session_id``, the read is scoped to the files
recorded in that session (so a shared topic name does not pull data
from unrelated files org-wide), and the caller must additionally hold
session-view access in the org that owns the session; an unknown session
yields a 404 and one the caller cannot view yields a 401.

A ``file_id`` limits the read to the topic's data in that file, a ``dataset_id`` to its data in the dataset's
files, and a ``device_id`` to its data in the device's files (a file belongs to the device it names, or, when it
names none, to the device its dataset names). A named file or dataset must exist and, on a credential limited to
one org, be in that org (else 404), and the caller must hold view access to it (else 401). A device is not looked
up, so an unknown device yields an empty plan. Every restriction the body names narrows the read, and restrictions
named together intersect. Data a restriction leaves out does not affect the read: its schemas cause no ambiguity
and its files need no access.

With a session, file, dataset or device named, the body may omit ``start_time``, ``end_time`` or both. An omitted
bound puts no limit on that side of the read, and the plan's ``window`` carries the int64 limit there. When a bound
is omitted and no partition of the topic lies in the window within the body's restrictions, the plan has no
partitions and a null ``window``.

A caller pinned to an API version below 2026-10-05 receives on every
partition the ``extent`` field that SDK releases pinned to those versions
require. Such an SDK selects rows by the requested window alone, so a plan
is refused for that caller with a 400 (``RobotoDeprecatedException``)
asking them to upgrade when any partition owns a slice of a shared file, or
when a session narrows any partition's window below the requested one:
reading it on that version would return rows belonging to another session
or to another partition packed in the same file.

A caller whose ``X-Roboto-Api-Version`` header names a version below
2026-11-02 keeps the coverage checks that later versions skip: ``resolve``
applies ``representation_coverage_error`` to the stored representations of
each partition. A partition fails the checks when one of its
representations names a field outside its schema, or when it owns a slice
of a shared file and a projected field that one of its representations
holds is held by none readable at the slice's row positions. When any
partition fails, the read is refused for that caller with a 400
(``RobotoDeprecatedException``) that names up to 20 failing partitions and
why each fails. SDK releases that send those versions drop a partition
with no scan tasks without a warning, and releases before 0.58 also return
a partition's rows without a projected field that its scan tasks leave
out. A caller at 2026-11-02 or later, or one sending no header or an
unknown version (either is served as the latest), gets such a partition
planned from the representations that can serve the read, with no scan
tasks when none can.

#### Access control
 - Restricted tokens need the API scope `api.everything_else`

`POST /v2/topics/id/{topic_id}/read-plan`

**Request body** (`application/json`, required)

- `start_time` (integer | null)
- `end_time` (integer | null)
- `fields_include` (FieldAddress[] | null)
- `fields_exclude` (FieldAddress[] | null)
- `prefer` (RepresentationPreference | null)
- `schema_id` (string | null)
- `schema_checksum` (string | null)
- `timeline_source_id` (string | null)
- `timeline_source_name` (string | null)
- `session_id` (string | null)
- `file_id` (string | null)
- `dataset_id` (string | null)
- `device_id` (string | null)
- `accepts_element_selection` (boolean)

Request body example:

```json
{
  "start_time": null,
  "end_time": null,
  "fields_include": null,
  "fields_exclude": null,
  "prefer": null,
  "schema_id": null,
  "schema_checksum": null,
  "timeline_source_id": null,
  "timeline_source_name": null,
  "session_id": null,
  "file_id": null,
  "dataset_id": null,
  "device_id": null,
  "accepts_element_selection": false
}
```

**Responses**

- `200` — OK
- `400` — A conversation with Roboto's AI is longer than the AI model can read at once. The conversation's messages and tool results, together with the AI's instructions, exceed the model's context window. The exception does not carry the token count or the model's limit.
- `401` — The caller's token is expired or malformed.
- `403` — The request would take the user or organization past a limit on a resource, such as AI credits.
- `404` — The request names an API route Roboto does not serve.
- `409` — The request conflicts with an existing resource, such as by giving a name another resource already has.
- `410` — The resource the request names is missing or has expired.
- `500` — Roboto reported an error that this release of the SDK cannot match to a specific exception class. Reported for an element of a :py:class:\`\~roboto.http.BatchResponse\` whose error names a code this release defines no class for, or that arrived without a code, without a message, or as text that is not an error envelope at all. It carries whatever code and message Roboto sent, so a caller handling the failure still learns what went wrong; when no message could be read, the message is the error's raw text. :py:meth:\`\~roboto.domain.devices.Device.create\_session\` raises it, and :py:meth:\`\~roboto.domain.devices.Device.create\_sessions\` lists it in the batch's :py:attr:\`\~roboto.http.BatchResponse.failed\`. The error envelope carries no status code, so \`\`http\_status\_code\`\` reports the 500 inherited from \`\`RobotoDomainException\`\` rather than the status the failure had.
- `501` — The request asks for an operation this deployment of Roboto does not provide.
- `503` — Roboto could not accept the request, such as under heavy load. Retrying later may succeed.
- `504` — Roboto ran out of time while processing the request. Retrying may succeed.
- `507` — The response to the request is larger than Roboto can send. Retrying the same request fails the same way; request less data at a time.

Response example, 200:

```json
{
  "data": {
    "plan_version": 1,
    "topic_id": "string",
    "window": {
      "start": 0,
      "end": 0
    },
    "schema": null,
    "projection": {
      "all": false,
      "fields": null
    },
    "partitions": []
  }
}
```
