# Get the agent on a TikTok account

> GET https://api.nabrah.ai/api/ext/omni_v2/tiktok/get_chatbot

Group: TikTok. Page: https://www.nabrah.ai/en/docs/api-reference/tiktok/get-the-agent-on-a-tiktok-account

Retrieve the agent currently answering on one of the project's TikTok accounts. The response returns the agent's full configuration under `agent` and that account's chatbot settings under `text_chatbot_settings`. Use this to confirm which agent is auto-replying on a account before updating or removing the assignment.

## Reading the response

- **agent**: The complete configuration of the agent handling TikTok direct messages, including `agent_id`, `name`, languages, voice, tools, and callbacks.
- **text_chatbot_settings**: The settings of this account. `name` is shared by every account the agent answers on; `inbox_ids` lists those accounts. `webhook_url` is the event webhook set on assign; the signing secret is never returned, only `has_webhook_hmac_secret`. Fields: `can_refer_to_human`, `human_emails`, `auto_resolve_hours`, `webhook_url`, `has_webhook_hmac_secret`, `name`, `inbox_ids`, `created_at`.

Assign with POST /api/ext/omni_v2/tiktok/assign_chatbot and remove with DELETE /api/ext/omni_v2/tiktok/unassign_chatbot.

## Reading human_emails

`text_chatbot_settings.human_emails` comes back in whichever shape it was stored: a list of addresses, a list of objects with `hours`, or a category map.

- **Null fields in the response**: Responses are not stripped of nulls, so an `hours` object can come back carrying `start: null` or `end: null`, and a destination that has no window at all can appear as `hours: null`. Treat all three as `always available`. Fields: `human_emails`.

## Choosing the TikTok account

A project can connect more than one TikTok account. `inbox_id` selects the account this call works on.

- **One account**: `inbox_id` is optional; the project's only TikTok account is used.
- **More than one account**: `inbox_id` is required and the call returns 400 without it. An id that is not one of the project's TikTok accounts returns 404. Fields: `inbox_id`.

List the accounts and their ids with GET /api/ext/omni_v2/tiktok/inboxes.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Query parameters

- `inbox_id` (string, optional): The `id` of the TikTok account to use, from GET /api/ext/omni_v2/tiktok/inboxes. Use `inboxes[].id` (a UUID), not the numeric `inboxes[].inbox_id`. Optional while the project has one TikTok account; required once it has more than one.

## Response

### 200 Successful Response

Content type: `application/json`

```json
{
  "agent": {
    "agent_id": "00000000-0000-4000-8000-000000000000",
    "project_id": "00000000-0000-4000-8000-000000000000",
    "created_by_email": "string",
    "created_at": "2026-01-15T12:00:00.000Z",
    "last_update": "2026-01-15T12:00:00.000Z",
    "name": "string",
    "start_first": false,
    "first_sentence": "string",
    "agent_type": "basic",
    "who_are_you": "string",
    "goal": "string",
    "steps": "string",
    "allow_interruptions": false,
    "voice": "dania",
    "support_data": "string",
    "languages": [
      "ar"
    ],
    "stack": "latest",
    "speech_speed": 0.7,
    "variables": [
      {
        "name": "string",
        "type": "string",
        "default_value": "string"
      }
    ],
    "pre_call_callback": {
      "url": "string",
      "parameters": [
        {
          "name": null,
          "location": null,
          "data_type": null,
          "value": null
        }
      ]
    },
    "post_call_callback": {
      "url": "string",
      "parameters": [
        {
          "name": null,
          "location": null,
          "data_type": null,
          "value": null
        }
      ]
    },
    "post_analysis_callback": {
      "url": "string",
      "parameters": [
        {
          "name": null,
          "location": null,
          "data_type": null,
          "value": null
        }
      ]
    },
    "tools": [
      {
        "id": "00000000-0000-4000-8000-000000000000",
        "name": "string"
      }
    ],
    "knowledge_bases": [
      {
        "id": "00000000-0000-4000-8000-000000000000",
        "project_id": "00000000-0000-4000-8000-000000000000",
        "name": "string",
        "key": "string",
        "desc": "string",
        "kind": "unstructured",
        "document_count": 0,
        "created_at": "2026-01-15T12:00:00.000Z",
        "updated_at": "2026-01-15T12:00:00.000Z"
      }
    ],
    "system_tools": [
      {
        "id": "00000000-0000-4000-8000-000000000000",
        "name": "string",
        "config": {},
        "created_at": "2026-01-15T12:00:00.000Z",
        "updated_at": "2026-01-15T12:00:00.000Z",
        "when_to_use": "string"
      }
    ],
    "analysis_groups": [
      {
        "id": "00000000-0000-4000-8000-000000000000",
        "name": "string"
      }
    ],
    "background_ambient": false,
    "background_ambient_volume": 0,
    "thinking_sound": false,
    "thinking_sound_volume": 0
  },
  "text_chatbot_settings": {
    "can_refer_to_human": false,
    "human_emails": [
      "string"
    ],
    "name": "string",
    "created_at": "2026-01-15T12:00:00.000Z",
    "auto_resolve_hours": 0,
    "webhook_url": "string",
    "has_webhook_hmac_secret": false,
    "inbox_ids": [
      "00000000-0000-4000-8000-000000000000"
    ]
  }
}
```

### 422 Validation Error

Content type: `application/json`

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

## Request examples

### cURL

```bash
curl --request GET \
  --url 'https://api.nabrah.ai/api/ext/omni_v2/tiktok/get_chatbot' \
  --header 'X-API-Key: <your-api-key>'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/omni_v2/tiktok/get_chatbot"
headers = {"X-API-Key": "<your-api-key>"}

response = requests.get(url, headers=headers)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.nabrah.ai/api/ext/omni_v2/tiktok/get_chatbot", {
  method: "GET",
  headers: { "X-API-Key": "<your-api-key>" },
});

const data = await response.json();
console.log(data);
```

### Go

```go
package main

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

func main() {
	req, _ := http.NewRequest("GET", "https://api.nabrah.ai/api/ext/omni_v2/tiktok/get_chatbot", nil)
	req.Header.Set("X-API-Key", "<your-api-key>")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
