---
title: "Add agent to server"
method: POST
path: "/api/messaging/message-servers/{messageServerId}/agents"
tags: ["messaging"]
---

# Add agent to server

`POST /api/messaging/message-servers/{messageServerId}/agents`

## Request

- Base URL: `http://localhost:3000`
- URL: `http://localhost:3000/api/messaging/message-servers/{messageServerId}/agents`
- Auth: none declared

Add an agent to a server

## Path parameters

- `messageServerId` string, uuid, required

## Request body

- object
  - `agentId` string, uuid, required

## Response `200`

Agent added successfully

- object
  - `success` boolean

## Other responses

- `400`: Invalid request
- `404`: Server not found
- `500`: Error adding agent

---

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