> This page is for Omni Channel.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.hams.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.hams.ai/_mcp/server.

# Change conversation status

POST https://omni-channel.hams.ai/api/v1/accounts/{account_id}/developer/conversations/{conversation_id}/toggle_status
Content-Type: application/json

Sets the status of the conversation. If you send no `status`, an open conversation becomes `resolved`, and any other conversation becomes `open`.


Reference: https://docs.hams.ai/omni-channel/reference/conversations/toggle-conversation-status

## Authentication

- `api_access_token` header (required) — An API key that an administrator creates in **Settings** > **Developer**. The personal access token of a user does not work. A key reaches every inbox, conversation, and contact in the account that created it, and nothing in other accounts.

## Request

### Path parameters

- `account_id` (integer, required) — The id of your account. It is the number after `/accounts/` in the dashboard URL.
- `conversation_id` (integer, required) — The conversation number in the dashboard URL (`display_id`). It is not the internal `id` of the conversation.

### Body (application/json)

This endpoint expects an object.

- `status` (enum, optional)
  - Allowed values: `open`, `resolved`, `pending`, `snoozed`
- `snoozed_until` (integer, optional) — For `snoozed`: the time when the conversation opens again, as a Unix timestamp in seconds. Do not send a date string.

## Response

### 200

The new status.

- `meta` (ToggleStatusResponseMeta, optional)
- `payload` (ToggleStatusResponsePayload, optional)

## Errors

### 401 Unauthorized Error

The token does not exist, is not an API key, or belongs to another account. The token can also be the token of a user who is not a member of the account, or the account can be suspended. The body has only the `error` field.

- `error` (string, required) — `Invalid Access Token`, `Key is not authorized to access this account`, `Access to this endpoint is not authorized for this token`, `You are not authorized to access this account`, or `Account is suspended`.

### 404 Not Found Error

The conversation or contact is not in this account. The body is `{"error": "Resource could not be found"}`.

- `error` (string, required)

### 422 Unprocessable Entity Error

A field is not valid, for example an email address that another contact has.

- `message` (string, required) — The problems, with a comma between them. For example `Email has already been taken`.
- `attributes` (list of string, required) — The names of the fields that are not valid.

## Types

### ToggleStatusResponseMeta

### ToggleStatusResponsePayload

- `success` (boolean, optional, nullable)
- `conversation_id` (integer, optional) — The conversation number in the dashboard URL (`display_id`).
- `current_status` (enum, optional)
  - Allowed values: `open`, `resolved`, `pending`, `snoozed`
- `snoozed_until` (string, optional, nullable)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "meta": {},
  "payload": {
    "success": true,
    "conversation_id": 1,
    "current_status": "open",
    "snoozed_until": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status"

payload = {}
headers = {
    "api_access_token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status';
const options = {
  method: 'POST',
  headers: {api_access_token: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api_access_token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status")
  .header("api_access_token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api_access_token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status");
var request = new RestRequest(Method.POST);
request.AddHeader("api_access_token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api_access_token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://omni-channel.hams.ai/api/v1/accounts/1/developer/conversations/1/toggle_status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```