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

## Headers

- `X-Glean-ActAs` string, email
- `X-Glean-Auth-Type` string

## 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-client-api.md) · [All operations](https://skmtc.net/gleanwork/apis/glean-client-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gleanwork/glean-client-api/versions/98678e54a6c5/schema)
