---
title: Stop a conversational AI agent
description: Stop the specified conversational agent instance.
sidebar_position: 2
platform: android
exported_from: https://docs.agora.io/en/conversational-ai/rest-api/agent/leave
exported_on: '2026-06-05T05:02:51.187979Z'
exported_file: leave.md
---

> For a complete site index fetch https://docs.agora.io/llms.txt. For all pages in this product fetch https://docs.agora.io/en/conversational-ai/overview/product-overview.md

[HTML Version](https://docs.agora.io/en/conversational-ai/rest-api/agent/leave)

# Stop a conversational AI agent


**Method:** POST
**Endpoint:** `https://api.agora.io/api/conversational-ai-agent/v2/projects/{appid}/agents/{agentId}/leave`

Use this endpoint to stop the specified Conversational AI agent instance.

## Request

### Path parameters

- **appid** (string, required): The App ID of the project.
- **agentId** (string, required): The agent instance ID you obtained after successfully calling `join` to [Start a conversational AI agent](https://docs-md.agora.io/en/conversational-ai/rest-api/agent/join.md).

## Response

- If the returned status code is `200`, the request was successful. The response body is empty.

- If the returned status code is not `200`, the request failed. The response body includes the error code and description. Refer to [status codes](https://docs-md.agora.io/en/conversational-ai/rest-api/reference.md) to understand the possible reasons for failure.

## Authorization

This endpoint requires [authentication](https://docs-md.agora.io/en/conversational-ai/rest-api/restful-authentication.md).

## Request example

**curl**
```bash
      curl --request post \
        --url https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/agents/:agentid/leave \
        --header 'Authorization: Basic'
```

**Python**
```python
    import requests

    url = "https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/agents/:agentId/leave"

    headers = {
        "Authorization": "Basic",
        "Content-Type": "application/json"
    }

    response = requests.post(url, headers=headers)
    print(response.text)
```

**Node.js**
```js
    const url = 'https://api.agora.io/api/conversational-ai-agent/v2/projects/:appid/agents/:agentId/leave';

    const options = {
      method: 'POST',
      headers: {
        'Authorization': 'Basic',
        'Content-Type': 'application/json'
      }
    };

    fetch(url, options)
      .then(res => res.json())
      .then(json => console.log(json))
      .catch(err => console.error(err));
```