---
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

---

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