---
title: "Create Agent Version"
method: POST
path: "/v1/agents/{agent_id}/versions"
tags: ["Agent Versions"]
---

# Create Agent Version

`POST /v1/agents/{agent_id}/versions`

create a new prompt version under /agents/{agent_id}/prompts/versions.

## Path parameters

- `agent_id` integer, required

## Headers

- `X-Organization-Id` string
- `X-API-Key` string, required

## Request body

- CreateAgentVersionBody — body for agent-scoped create version endpoint (agent_id in path).
  - `prompt_text` string, nullable — Prompt content. Omit to copy the current latest version (MAX(version) / latest label) and increment. An empty string stores a blank prompt.
  - `commit_message` string, nullable
  - `labels` string[], nullable
  - `override_label` boolean, nullable — When true, a label that already points at another version (including production) moves here.
  - `metadata` object, nullable

## Response `200`

Successful Response

- AgentVersionResponse — response model for prompt without created_at.
  - `id` string, uuid, nullable — the id of the prompt
  - `prompt_text` string, required — the prompt content
  - `commit_message` string, nullable
  - `labels` string[], nullable — labels associated with the prompt
  - `metadata` object, nullable — arbitrary JSON metadata
  - `version` integer, required — the version number of the prompt
  - `agent_id` integer, required — id of the agent that owns this prompt

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-10** `547d989af0ef` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/getbluejay/apis/bluejay-api/changes/v1/agents/:agent_id/versions/post.md)

---

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