---
title: "Edit an agent"
method: POST
path: "/rest/api/v1/agents/{agent_id}"
tags: ["Agents"]
---

# Edit an agent

`POST /rest/api/v1/agents/{agent_id}`

Creates a draft or publishes an [agent](https://developers.glean.com/agents/agents-api). Use `isDraft=true` to save a draft, or `isDraft=false` (or omit) to publish immediately. Only draft and publish modes are supported.

## Path parameters

- `agent_id` string, required — The ID of the agent.

## Query parameters

- `locale` string
- `timezoneOffset` integer

## Request body

- EditWorkflowRequest
  - `name` string — The name of the workflow.
  - `id` string — The workflow ID we want to update.

## Response `200`

Success

## Other responses

- `400` — Bad request
- `401` — Not Authorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal server error

## Changes

- **2026-06-07** `ab886c377360` — 1 info
  - the endpoint scheme security `APIToken` was added to the API
- **2026-06-06** `c1a150309e52` — 1 info
  - the endpoint scheme security `APIToken` was removed from the API
- **2026-06-03** `2cb0cc06631f` — 1 info
  - the endpoint scheme security `APIToken` was added to the API
- **2026-06-03** `d2c4124e0abe` — 1 info
  - the endpoint scheme security `APIToken` was removed from the API
- **2026-05-27** `35c36b2b6d97` — 1 info
  - the endpoint scheme security `APIToken` was added to the API

[Full history](https://skmtc.dev/gleanwork/apis/glean-api/changes/rest/api/v1/agents/:agent_id/post.md)

---

[API](https://skmtc.dev/gleanwork/apis/glean-api.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-api/revisions/fc186ea8fe2b/schema)
