---
title: "Hand a conversation between the AI agent and a person"
method: POST
path: "/conversations/{conversationId}/assign"
tags: ["Conversations"]
---

# Hand a conversation between the AI agent and a person

`POST /conversations/{conversationId}/assign`

## Request

- Base URL: `https://api.spurnow.com`
- URL: `https://api.spurnow.com/conversations/{conversationId}/assign`
- Auth: HTTP bearer

`{ "to": "user", "userId": 318 }` assigns a person and stops the AI agent on this conversation. `{ "to": "ai" }` clears the person; the AI agent replies to the next inbound message. Assigning the current assignee again returns the current state. Assignment doesn’t change the conversation status, except that assigning a person to a closed conversation reopens it. Call with your workspace API key.

## Path parameters

- `conversationId` number, required

## Request body

- AssignConversationDto
  - `to` 'user' | 'ai', required: `user`: hand the conversation to a person; the AI agent stops on it. `ai`: clear the person assigned; the AI agent replies to the next inbound message.
  - `userId` number: Required with `to: "user"`. Must be an active member of the workspace.

## Response `200`

- AssignConversationResponseDto
  - `conversationId` number, required: The conversation (inboxId).
  - `assignedUserId` number, nullable, required: The person assigned (assignedAgentId), or null.
  - `aiAgentActive` boolean, required: True when no person is assigned and the number has an AI agent connected: the AI agent answers the next inbound message.
  - `conversationStatus` 'OPEN' | 'CLOSED', required

## Other responses

- `400`: Missing or invalid `to` or `userId`, or the user is not in the workspace
- `401`: Invalid API key
- `404`: Conversation not found in this workspace
- `409`: The user hasn't accepted their invite

---

[API](https://skmtc.dev/spurnow/apis/spur-apis.md) - [All operations](https://skmtc.dev/spurnow/apis/spur-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/spurnow/apis/spur-apis/revisions/27ca7bf002cb?raw)
