---
title: "Layout Workflow"
method: POST
path: "/api/v1/workflow/layout"
tags: ["main"]
---

# Layout Workflow

`POST /api/v1/workflow/layout`

## Request

- Base URL: `https://app.dograh.com`
- URL: `https://app.dograh.com/api/v1/workflow/layout`
- Auth: none declared
- TypeScript: <https://skmtc.dev/dograh/apis/dograh-api/docs/api/v1/workflow/layout/post.ts> (a function with typed inputs; its response is checked against the schema)

Tidy Up positions for an unsaved canvas, using the same layout applied
when an agent is first created. Nothing is persisted.

## Headers

- `authorization` string, nullable
- `X-API-Key` string, nullable

## Request body

- WorkflowLayoutRequest: An unsaved canvas, reduced to what the layout needs.
  - `nodes` WorkflowLayoutNode[], required
    - `id` string, required
    - `type` string, required
  - `edges` WorkflowLayoutEdge[], required
    - `source` string, required
    - `target` string, required
  - `rankdir` 'TB' | 'LR'

## Response `200`

Successful Response

- WorkflowLayoutResponse
  - `positions` WorkflowNodePosition[], required
    - `id` string, required
    - `x` number, required
    - `y` number, required

## Other responses

- `404`: Not found
- `422`: Validation Error

## Changes

- **2026-11-05** `f41dfbe35730`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dograh/apis/dograh-api/changes/api/v1/workflow/layout/post.md)

---

[API](https://skmtc.dev/dograh/apis/dograh-api.md) - [All operations](https://skmtc.dev/dograh/apis/dograh-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dograh/apis/dograh-api/revisions/f41dfbe35730?raw)
