> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowengineering.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Overview

> Connect your tools to Flow with the customer API.

![Abstract sunset in blue, orange, and purple](https://mintcdn.com/flow-engineering/jl4LvP43NPuN-oQK/images/api-overview-sunset.png?fit=max\&auto=format\&n=jl4LvP43NPuN-oQK\&q=85\&s=bf9dc51e00a68d4a7ef229d404ddda52)

Read and update your systems graph with the Flow API. Flow's REST API gives you access to projects, entities, relationships, and automations through authenticated HTTPS requests.

## Get started

* [**Quickstart**](https://docs.flowengineering.com/api/quickstart.md) — Authenticate and read data from your first project.
* [**Authentication**](https://docs.flowengineering.com/api/authentication.md) — Create an API key and understand its permissions.
* [**API reference**](https://docs.flowengineering.com/api/reference.md) — Explore endpoints, request examples, and the interactive playground.
* [**Download the OpenAPI specification (JSON)**](https://docs.flowengineering.com/openapi/customer-api.json) — Import the API definition into your tools.

## Explore current capabilities

Use [API conventions](https://docs.flowengineering.com/api/conventions.md) for pagination, branches, and error handling. Follow the examples to [list, search, or filter entities](https://docs.flowengineering.com/api/examples/read-entities.md) and [write or restore them](https://docs.flowengineering.com/api/examples/batch-writes.md). To react to item changes and review decisions, [poll project events](https://docs.flowengineering.com/api/examples/project-events.md).

The endpoint reference also covers starting and continuing agent chats and managing project automations. Use the generated endpoint pages for exact request and response schemas.

## Connect an AI client

Use [Flow MCP](https://docs.flowengineering.com/api/mcp/overview.md) to connect an AI client to your systems graph. Follow [Connect a client](https://docs.flowengineering.com/api/mcp/connect.md), then [use Flow tools](https://docs.flowengineering.com/api/mcp/tools.md) to read and update project data.

## Start agent chats

Use `POST /ai/agents` with `project_id` and an optional opening `messages` array to create a chat. Chats are private to the key owner by default; set `visibility` to `shared` only when the workspace should see them. When you provide opening messages, the default `wait: false` returns while the agent works. Without messages, the chat starts idle. Read `GET /ai/agents/{id}` for its transcript and status, then use `POST /ai/agents/{id}/messages` to start or continue it. The [endpoint reference](https://docs.flowengineering.com/api/reference.md) describes the full request bodies.

`POST /ai/agents/{id}/messages` returns `job_id`, `queued`, and `duplicate`. With `queued: false`, the turn has started. Poll `GET /ai/trigger/runs?agent_ids={id}` until the run is not `running`, then read `GET /ai/agents/{id}`. With `queued: true`, an earlier turn is still running and the message waits for it to end. Poll `GET /ai/agents/{id}` until the reply is in the transcript. With `duplicate: true`, this exact send already happened and `job_id` is the original send.

To have a running turn read a queued message at its next step, send [`PATCH /ai/agents/{id}/messages/{jobId}`](https://docs.flowengineering.com/api/endpoints/patch-ai-agents-id-messages-jobid) with `delivery` set to `live`. This applies only when the running turn is yours (same person and role). Otherwise the message keeps waiting. `eventually` is the default. A message that moves the chat to another branch cannot be `live` and returns `400`. A message that has already started a turn is left as it is.

## Check whether a branch can merge

Use [`GET /project/{projectId}/branch/{id}/merge-readiness`](https://docs.flowengineering.com/api/endpoints/get-project-projectid-branch-id-merge-readiness) before you merge a branch. The response lists every gate that blocks the merge in `blockers`, not only the first. Each blocker has a `kind`, a `message`, and, when relevant, the `items` it names and the `people` whose action clears it. Gates that Flow cannot judge yet, such as a scan that is still running, appear in `unknown` with a `reason`. `ready` is `true` only when both lists are empty.

The read enforces nothing. `POST /project/{projectId}/branch/{id}/merge` checks its own gates again when you merge.

## Revert a merge safely

[`POST /project/{projectId}/branch/baseline/{baselineId}/revert`](https://docs.flowengineering.com/api/endpoints/post-project-projectid-branch-baseline-baselineid-revert) creates a branch that undoes a merge. Reverting a large merge can take longer than your connection stays open. Send a `request_id` that you generate as a UUID, and reuse it if you retry. A retry with the same `request_id` returns the branch the earlier attempt created instead of creating a second one. While that attempt is still running, a retry returns `409`. Wait and retry again. Reusing a `request_id` for a different revert also returns `409`.

## Manage shared saved views

[`GET /project/{projectId}/views/saved`](https://docs.flowengineering.com/api/endpoints/get-project-projectid-views-saved) lists the project's shared saved views in display order. A view's `id` is the `view_id` that sharing a view takes. Creating, updating, and deleting shared views requires Admin access, and changes apply to every project member.

* [`POST /project/{projectId}/views/saved`](https://docs.flowengineering.com/api/endpoints/post-project-projectid-views-saved) adds a view after the existing ones. Set its start type and nesting rules by data type ID, and optionally its table `columns`, `filters`, and `sort`. Flow checks each against the data model and refuses a filter that names an unknown field, option, or type without saving anything. An `id` that already belongs to a shared view returns `409`.
* [`PATCH /project/{projectId}/views/saved/{viewId}`](https://docs.flowengineering.com/api/endpoints/patch-project-projectid-views-saved-viewid) changes only the fields you send. `relationships`, `columns`, `filters`, and `sort` each replace that whole part of the view. Send `null` to clear columns, filters, or sort.
* [`POST`](https://docs.flowengineering.com/api/endpoints/post-project-projectid-views-saved-viewid-relationships) and [`DELETE /project/{projectId}/views/saved/{viewId}/relationships`](https://docs.flowengineering.com/api/endpoints/delete-project-projectid-views-saved-viewid-relationships) add or remove one nesting rule, identified by `parentType` and `childType`, and keep the view's other rules. Adding a rule the view already has with the same `direction` changes nothing, so a retry is safe. The same pair with another direction returns `409`.

Display options are edited in Flow.

## Assign people to items

To list who can be an item's owner, assignee, or reviewer, call [`GET /users`](https://docs.flowengineering.com/api/endpoints/get-users) or [`GET /users/page`](https://docs.flowengineering.com/api/endpoints/get-users-page) with `assignable=true`. This leaves out personal agents. A personal agent works for one person, so writing its user ID to a user field such as owner, assignee, or reviewers returns `400`. A personal agent also cannot own a branch.

## Import ReqIF documents

A ReqIF import runs as a job. Each step returns quickly. Poll [`GET /project/{projectId}/reqif-import/{jobId}`](https://docs.flowengineering.com/api/endpoints/get-project-projectid-reqif-import-jobid) for its `status`, `phase`, and progress.

1. [`POST /project/{projectId}/reqif-import/upload`](https://docs.flowengineering.com/api/endpoints/post-project-projectid-reqif-import-upload) with `file_name`, `size`, and `mime_type` creates the job. PUT the `.reqif` or `.reqifz` bytes to the returned `upload_url` with its `upload_headers`.
2. [`POST /project/{projectId}/reqif-import/{jobId}/parse`](https://docs.flowengineering.com/api/endpoints/post-project-projectid-reqif-import-jobid-parse) parses the archive. Once parsed, the job's `schema` describes the file's types and attributes for your mapping.
3. [`POST /project/{projectId}/reqif-import/{jobId}/preview`](https://docs.flowengineering.com/api/endpoints/post-project-projectid-reqif-import-jobid-preview) shows what a commit with your mapping `clauses` would write. It writes nothing.
4. [`POST /project/{projectId}/reqif-import/{jobId}/commit`](https://docs.flowengineering.com/api/endpoints/post-project-projectid-reqif-import-jobid-commit) with the same `clauses` and a `branch_name` writes the import onto a new branch. Poll the job for progress and its `branch_id`.

Send the preview the clauses in the order you will commit them. `base_branch_id` names the branch the import would start from (omit it or send `master` for Base), and that branch decides whether each row creates or updates an item. Set `clause_id` to one clause's `id` to get a page of its rows. Each row has the ReqIF `identifier`, its `id_value`, the `values` the commit would write, and an `outcome` of `created` or `updated`. Page with `offset` and `limit` (default 50, maximum 100) while `has_more` is `true`. Set `include_counts` to also get created and updated `counts` for every clause. When `counts_complete` is `false`, the counts stopped before the end of the document and are lower bounds. The preview returns `400` unless the job is parsed and waiting for your mapping (`status` `waiting`, `phase` `parsed`).

## Draw diagrams with engineering symbols

[`GET /project/{projectId}/diagram-symbols`](https://docs.flowengineering.com/api/endpoints/get-project-projectid-diagram-symbols) lists every ISO 1219 fluid-power, IEC 60617 electrical, and ISA-5.1 instrumentation symbol. The response is `libraries`, each with an `id`, a `label`, and `symbols`. Each symbol has an `id`, a `label`, a `size` (`w`, `h`), a `labelSlot` of `below` or `inside`, and its `ports`. Each port has an `id`, a normalized `at` position as `[x, y]`, and a `side` of `n`, `e`, `s`, or `w`.

In the structured input of `POST /project/{projectId}/diagrams`, use a symbol `id`, such as `iso1219:pump`, as a node's `shape` or an entity's `geo`. Set a connection's `fromPort` or `toPort` to a terminal `id` from that symbol's `ports`, or omit them for automatic routing. A port that is not a terminal of the symbol at that end returns `400`. Symbols cannot contain children, so an item whose `parentId` is a symbol returns `400`. Use a card or rectangle as the container instead.

`GET` and `PUT /project/{projectId}/symbol-libraries` were removed, so remove calls to them from your clients. `GET /project/{projectId}/diagram-symbols` returns symbols from every library, and `POST /project/{projectId}/diagrams` accepts them all.

## Run automations

Learn how [automations and triggers](https://docs.flowengineering.com/api/automations/overview.md) work together. [Set up a webhook automation](https://docs.flowengineering.com/api/automations/webhooks.md), then [start runs and poll their results](https://docs.flowengineering.com/api/examples/automations.md).

## Shared item paths

Shared access grants can include `upstream_context_path_entity_ids` when a share shows the path above its item. Individual context grants have `view_id: null` and `context_of_grant_ids`; clients reading grants must handle a nullable `view_id`. Use `PUT /shared-grants/project/{projectId}/{id}/upstream-context` to replace the path. See the [endpoint reference](https://docs.flowengineering.com/api/reference.md) for its request schema.

API updates are included in the [release notes](https://docs.flowengineering.com/release-notes.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.