---
title: "Publish Agent Version"
method: POST
path: "/core/agents/{id}/versions/{version}/publish"
tags: ["Agents"]
---

# Publish Agent Version

`POST /core/agents/{id}/versions/{version}/publish`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/core/agents/{id}/versions/{version}/publish`
- Auth: HTTP bearer

Publish and deploy a specific agent version to phone numbers.

## Path parameters

- `id` string, required
- `version` integer, required

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- AgentPublishRequest: Request schema for agent publishing.
  - `phone_numbers` string[], nullable: Optional list of phone numbers to deploy to
  - `unassign_phone_numbers` string[], nullable: Optional list of phone numbers to unassign from this agent
  - `direction` 'inbound' | 'outbound' | 'both': Direction for agent deployment.

## Response `200`

Successful Response

- PhoneNumber[]
  - `phone_number` string, required
  - `organization_id` string, required
  - `trunk_id` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `created_by` string, nullable
  - `modified_by` string, nullable
  - `inbound_agent_version_id` string, nullable
  - `outbound_agent_version_id` string, nullable
  - `managed_account_id` string, nullable
  - `external_id` string, required
  - `outbound_shareable` boolean

## Other responses

- `422`: Validation Error

---

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