---
title: "Add an agent section"
method: POST
path: "/v1/agents/{id}/sections"
---

# Add an agent section

`POST /v1/agents/{id}/sections`

## Request

- Base URL: `https://api.runbear.io`
- URL: `https://api.runbear.io/v1/agents/{id}/sections`
- Auth: HTTP bearer

Add a section after the agent's existing sections. Returns 404 when the agent is not found and 409 when another section already has the name.

## Path parameters

- `id` string, uuid, required: Agent ID

## Request body

- AgentSectionCreateRequest
  - `name` string, required: Section name, unique within the agent, at most 200 characters. Shown as the section heading in the agent's instructions.
  - `content` string, required: Section text, at most 100,000 characters.

## Response `201`

Default Response

- AgentSection
  - `id` string, required: Section ID
  - `name` string, required: Section name
  - `content` string, required: Section text
  - `position` integer, required: Zero-based place of the section in the agent's instructions. Read-only: change the order with `PUT /v1/agents/{id}/sections`.
  - `createdAt` string, required: ISO 8601 timestamp when the section was created
  - `updatedAt` string, required: ISO 8601 timestamp when the section was last changed

## Other responses

- `400`: Default Response
- `403`: Default Response
- `404`: Default Response
- `409`: Default Response

---

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