> For the complete documentation index, see [llms.txt](https://adaptix-framework.gitbook.io/adaptix-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adaptix-framework.gitbook.io/adaptix-framework/development/teamserver-interface/web-api.md).

# Web API

{% hint style="info" %}
If authentication fails, the web server will respond with a 404 page by default.
{% endhint %}

## Auth

<details>

<summary><strong>POST         {endpoint}/login</strong> </summary>

Authenticate and receive a JWT

**Request (JSON)**

* `username` <sub>string</sub> - operator login
* `password` <sub>string</sub> - operator password

**Response (JSON)**

* `access_token` <sub>string</sub>   - JWT access token
* `refresh_token` <sub>string</sub> - JWT refresh token
* `version` <sub>string</sub>             - Teamserver version

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>refresh </summary>

Update JWT access token

**Request (JSON)**

Header `Authorization: Bearer <refresh_token>`

**Response (JSON)**

* `access_token` <sub>string</sub> - JWT access token

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>sync </summary>

Start synchronizing data with the client via WebSocket

**Request (JSON)**

Header `Authorization: Bearer <access_token>`

**Response**

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>otp/generate </summary>

Generate OTP

**Request (JSON)**

Header `Authorization: Bearer <access_token>`

* `type` <sub>string</sub> - object type: "connect", "download", "tmp\_upload", "channel\_tunnel", "channel\_terminal", "channel\_agent\_build"
* `id` <sub>string</sub>     - object ID

**Response (JSON)**

* `ok` <sub>bool</sub>            - status
* `message` <sub>string</sub> - OTP or error text

</details>

## Chat

<details>

<summary><strong>POST         {endpoint}/</strong>chat/send </summary>

Send message to chat

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `message` <sub>string</sub>

**Response**

</details>

## Agent

<details>

<summary><strong>GET            {endpoint}/agent</strong>/list </summary>

Get a list of agents with full information

**Request**

Header `Authorization: Bearer <access_token>`

**Response (JSON)**

List of agents with parameters

* `a_crc` <sub>string</sub>                  - agent type hash
* `a_id` <sub>string</sub>                    - agent id
* `a_name` <sub>string</sub>                - agent type
* `a_session_key` <sub>string</sub> - session encrypt key (base64)
* `a_listener` <sub>string</sub>        - listener name
* `a_async` <sub>bool</sub>                 - is async mode
* `a_external_ip` <sub>string</sub>  - external IP
* `a_internal_ip` <sub>string</sub>  - internal IP
* `a_gmt_offset` <sub>int</sub>         - GMT offset
* `a_sleep` <sub>int</sub>                    - session sleep time
* `a_jitter` <sub>int</sub>                  - session sleep jitter
* `a_pid` <sub>int</sub>                         - PID
* `a_tid` <sub>int</sub>                         - TID
* `a_arch` <sub>string</sub>                  - process arch
* `a_elevated` <sub>bool</sub>            - is elevated session
* `a_process` <sub>string</sub>            - process name
* `a_os` <sub>int</sub>                            - OS type (0 - unknown, 1- windows, 2 - Linux, 3 - MacOS )
* `a_os_desc` <sub>string</sub>             - OS description
* `a_domain` <sub>string</sub>               - domain name
* `a_computer` <sub>string</sub>           - computer name
* `a_username` string         - username
* `a_impersonated` <sub>string</sub>  - impersonated username
* `a_oemcp` <sub>int</sub>                      - OemCP
* `acp` <sub>int</sub>                               - ACP
* `a_create_time` <sub>int</sub>          - creation time in UNIX timestamp format
* `a_last_tick` <sub>int</sub>              - last tick in UNIX timestamp format
* `a_killdate` <sub>int</sub>                - packed kill date
* `a_workingtime` <sub>int</sub>          - packed working time
* `a_tags` <sub>string</sub>                    - tag
* `a_mark` <sub>string</sub>                    - mark
* `a_color` <sub>string</sub>                  - backgroud and line color
* `a_target` <sub>string</sub>                - target ID

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/generate </summary>

Build and download agent

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `listener_name` <sub>string</sub> - listener name
* `listener_type` <sub>string</sub> - listener registration name
* `agent` <sub>string</sub>                  - agent registration name
* `config` <sub>string</sub>                - agent configuration

**Response**

Payload content

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/remove</summary>

Remove agent data

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id_array` <sub>\[strings]</sub> - list of agent IDs&#x20;

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/update/data</summary>

Update agent data

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

Possible parameters in JSON

* `agent_id` <sub>string</sub>        - agent id
* `external_ip` <sub>string</sub>  - external IP
* `internal_ip` <sub>string</sub>  - internal IP
* `gmt_offset` <sub>int</sub>         - GMT offset
* `oemcp` <sub>int</sub>                  - OemCP
* `acp` <sub>int</sub>                      - ACP
* `pid` <sub>string</sub>                 - PID
* `tid` <sub>string</sub>                 - TID
* `arch` <sub>string</sub>               - process arch
* `elevated` <sub>bool</sub>          - is elevated session
* `process` <sub>string</sub>          - process name
* `os` <sub>int</sub>                        - OS type (0 - unknown, 1- windows, 2 - Linux, 3 - MacOS )
* `os_desc` <sub>string</sub>          - OS description
* `domain` <sub>string</sub>            - domain name
* `computer` <sub>string</sub>        - computer name
* `username` string       - username
* `impersonated` <sub>string</sub>  - impersonated username
* `tags` <sub>string</sub>                    - tag
* `mark` <sub>string</sub>                    - mark
* `color` <sub>string</sub>                  - backgroud and line color

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/set/tag</summary>

Set a tag for an agent

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id_array` <sub>\[strings]</sub> - list of agent IDs
* `tag` <sub>string</sub> - agent tag

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/set/mark</summary>

Set a mark for an agent

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id_array` <sub>\[strings]</sub> - list of agent IDs
* `bc` <sub>string</sub> - background color
* `fc` <sub>string</sub> - foreground color
* `reset` <sub>bool</sub> - if true, set default color

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/set/tag</summary>

Set a tag for an agent

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id_array` <sub>\[strings]</sub> - list of agent IDs
* `tag` <sub>string</sub> - agent tag

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/command/execute</summary>

Create a task for the agent

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `id` <sub>string</sub>                   - agent ID
* `ui` <sub>bool</sub>                     - UI mode (the task is not saved and does not have a callback)
* `cmdline` <sub>string</sub>          - full command
* `data` <sub>string</sub>               - parsed command data
* `ax_hook_id` <sub>string</sub>    - AxHook ID
* `wait_answer` <sub>bool</sub>    - Wait for a response from the HTTP server, otherwise the response will come to the web socket channel

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/command/raw</summary>

Executing a raw command on an agent via the server-side AxScript engine. The command is parsed and executed server-side without the use of client-side hooks.

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `id` <sub>string</sub>                   - agent ID
* `cmdline` <sub>string</sub>          - full command

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/console/remove</summary>

Remove agent console data

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id_array` <sub>\[strings]</sub> - list of agent IDs&#x20;

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>GET           {endpoint}/</strong>agent/task/list</summary>

Get a list of tasks with full information

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

URI  ?`agent_id=<a1b2c3d4>&limit=<100>&offset=<0>`

* `agent_id` <sub>string</sub>    - Agent ID
* `limit` <sub>int</sub>              - Max records (default: 200, max: 1000)
* `offset` <sub>int</sub>            - Records offset (default: 0)

**Response (JSON)**

* `t_type` <sub>int</sub>                     - Task type (1=task, 2=browser, 3=job, 4=tunnel, 5=proxy\_data)
* `t_task_id` <sub>string</sub>           - Unique task ID
* `t_agent_id` <sub>string</sub>         - Agent ID
* `t_client` <sub>string</sub>             - Operator name who created task
* `t_user` <sub>string</sub>                 - Target machine username
* `t_computer` <sub>string</sub>         - Target machine computer name
* `t_start_date` <sub>int</sub>          - Start timestamp (Unix)
* `t_finish_date` <sub>int</sub>        - Finish timestamp (Unix)
* `t_command_line` <sub>string</sub>  - Command line
* `t_message_type` <sub>int</sub>       - Message type (5=info, 6=error, 7=success)
* `t_message` <sub>string</sub>           - Message header
* `t_clear_text` <sub>string</sub>      - Message body/output
* `t_completed` <sub>bool</sub>          - Task completed flag
* `t_sync` <sub>bool</sub>                   - Sync with GUI flag

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/task/save</summary>

Save data to Task Manager

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id` <sub>strings</sub>        - agent ID
* `command_line` <sub>string</sub> - full command line&#x20;
* `message_type` <sub>int</sub>      - result message type (6 - error, 7 - success)
* `message` <sub>string</sub>            - task message
* `clear_text` <sub>string</sub>      - task output

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/task/cancel</summary>

Cancel hosted tasks

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id` <sub>strings</sub> - agent ID
* `tasks_array` <sub>\[strings]</sub> - list of task IDs

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>agent/task/delete</summary>

Remove task from Task Manager

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id` <sub>strings</sub> - agent ID
* `tasks_array` <sub>\[strings]</sub> - list of task IDs

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

## Listener

<details>

<summary><strong>GET            {endpoint}/listener</strong>/list </summary>

Get a list of listeners with full information

**Request**

Header `Authorization: Bearer <access_token>`

**Response (JSON)**

List of listeners with parameters

* `l_name` <sub>string</sub>              - listener name
* `l_reg_name` <sub>string</sub>     - listener registration name
* `l_protocol` <sub>string</sub>     - protocol
* `l_type` <sub>string</sub>              - listener type
* `l_bind_host` <sub>string</sub>    - bind host
* `l_bind_port` <sub>string</sub>    - bind port
* `l_agent_addr` <sub>string</sub>  - callback hosts & ports
* `l_status` <sub>string</sub>           - running status
* `l_data` <sub>string</sub>               - listener config data
* `l_watermark` <sub>string</sub>    - process name

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>listener/create </summary>

Create and start listener

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `name` <sub>string</sub>     - listener name
* `type` <sub>string</sub>     - listener registration name
* `config` <sub>string</sub> - listener config data

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>listener/edit </summary>

Edit listener config

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `name` <sub>string</sub>     - listener name
* `type` <sub>string</sub>     - listener registration name
* `config` <sub>string</sub> - listener config data

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>listener/stop </summary>

Stop and delete listener

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `name` <sub>string</sub>     - listener name
* `type` <sub>string</sub>     - listener registration name

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

## Download

<details>

<summary><strong>GET            {endpoint}/download</strong>/list </summary>

Get a list of downloads with full information

**Request**

Header `Authorization: Bearer <access_token>`

**Response (JSON)**

List of downloads with parameters

* `d_file_id` <sub>string</sub>         - file ID
* `d_agent_id` <sub>string</sub>       - agent ID
* `d_agent_name` <sub>string</sub>   - agent registration name
* `d_user` <sub>string</sub>                - session username
* `d_computer` <sub>string</sub>       - session computer
* `d_remote_path` <sub>string</sub> - remote file path
* `d_total_size` <sub>int</sub>        - total file size
* `d_recv_size` <sub>int</sub>          - receive file size
* `d_date` <sub>int</sub>                     - date in UNIX timestamp format
* `d_state` <sub>int</sub>                   - download status (1 - running, 2 - stopped, 3 - finished)

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>download/sync</summary>

Download file content

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `file_id` <sub>string</sub> - file ID&#x20;

**Response (JSON) success**

* `ok` <sub>bool</sub>              - status
* `filename` <sub>string</sub> - file basename
* `content` <sub>string</sub> - file content in base64

**Response (JSON) error**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>download/delete</summary>

Delete file

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `file_id` <sub>string</sub> - file ID&#x20;

**Response (JSON) error**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

## Screen

<details>

<summary><strong>GET            {endpoint}/screen</strong>/list </summary>

Get a list of screenshots with full information

**Request**

Header `Authorization: Bearer <access_token>`

**Response (JSON)**

List of screenshots with parameters

* `s_screen_id` <sub>string</sub> - screen ID
* `s_user` <sub>string</sub>            - session username
* `s_computer` <sub>string</sub>   - session computer
* `s_note` <sub>string</sub>            - screenshot note
* `d_date` <sub>int</sub>                 - date in UNIX timestamp format
* `d_content` <sub>string</sub>      - screenshot content in base64

</details>

<details>

<summary><strong>GET            {endpoint}/screen/image</strong> </summary>

Download a screenshot by Screen ID

**Request**

Header `Authorization: Bearer <access_token>`&#x20;

URI  `?screen_id=<a1b2c3d4>`&#x20;

* `screen_id` <sub>string</sub>    - Screen ID

**Response (image/png)**

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>screen/setnote</summary>

Set a note for a screenshot

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `screen_id_array` <sub>\[strings]</sub> - list of screen IDs
* `note` <sub>string</sub>                            - screenshot note

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>screen/remove</summary>

Remove a screenshot

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `screen_id_array` <sub>\[strings]</sub> - list of screen IDs

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - empty string or error text

</details>

## Creds

<details>

<summary><strong>GET            {endpoint}/creds</strong>/list </summary>

Get a list of credentials with full information

**Request**

Header `Authorization: Bearer <access_token>`

**Response (JSON)**

List of credentials with parameters

* `c_creds_id` <sub>string</sub> - creds ID
* `c_username` <sub>string</sub> - login
* `c_password` <sub>string</sub> - password
* `c_realm` <sub>string</sub>       - domain
* `c_type` <sub>string</sub>         - creds type
* `c_tag` <sub>string</sub>           - creds tag
* `d_date` <sub>int</sub>              - date in UNIX timestamp format
* `d_storage` <sub>string</sub>   - creds storage
* `c_agent_id` <sub>string</sub> - agent ID
* `c_host` <sub>string</sub>          - session computer

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>creds/add </summary>

Store credentials to Creds Manager

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `creds` - List of credentials with parameters
  * `username` <sub>string</sub> - login
  * `password` <sub>string</sub> - password
  * `realm` <sub>string</sub>       - domain
  * `type` <sub>string</sub>         - creds type
  * `tag` <sub>string</sub>           - creds tag
  * `storage` <sub>string</sub>   - creds storage
  * `host` <sub>string</sub>         - session computer

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>creds/edit </summary>

Edit stored credentials

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `cred_id` <sub>string</sub>   - creds ID
* `username` <sub>string</sub> - login
* `password` <sub>string</sub> - password
* `realm` <sub>string</sub>       - domain
* `type` <sub>string</sub>         - creds type
* `tag` <sub>string</sub>           - creds tag
* `storage` <sub>string</sub>   - creds storage
* `host` <sub>string</sub>         - session computer

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>creds/set/tag </summary>

Set creds tag

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `id_array` <sub>\[string]</sub> - list of creds IDs
* `tag` <sub>string</sub>              - tag for the creds

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>creds/remove </summary>

Remove stored credentials

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `cred_id_array` <sub>\[string]</sub> - list of creds IDs

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

## Targets

<details>

<summary><strong>GET            {endpoint}/</strong>targets/list </summary>

Get a list of targets with full information

**Request**

Header `Authorization: Bearer <access_token>`

**Response (JSON)**

List of targets with parameters

* `t_target_id` <sub>string</sub> - target ID
* `t_computer` <sub>string</sub>   - hostname
* `t_domain` <sub>string</sub>       - domain name
* `t_address` <sub>string</sub>     - host IP address
* `t_os` <sub>int</sub>                     - OS type (0 - unknown, 1- windows, 2 - Linux, 3 - MacOS )
* `t_os_desc` <sub>string</sub>     - OS description
* `t_tag` <sub>string</sub>              - target tag
* `t_info` <sub>string</sub>            - target info
* `d_date` <sub>int</sub>                 - date in UNIX timestamp format
* `t_alive` <sub>bool</sub>            - is alive target
* `t_agents` <sub>\[string]</sub>     - list of agents ID

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>targets/add </summary>

Store credentials to Creds Manager

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `targets` - List of targets with parameters
  * `computer` <sub>string</sub>  - hostname
  * `domain` <sub>string</sub>      - domain name
  * `address` <sub>string</sub>    - host IP address
  * `os` <sub>int</sub>                    - OS type (0 - unknown, 1- windows, 2 - Linux, 3 - MacOS )
  * `os_desc` <sub>string</sub>    - OS description
  * `tag` <sub>string</sub>             - target tag
  * `info` <sub>string</sub>           - target info
  * `alive` <sub>bool</sub>           - is alive target

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>targets/edit </summary>

Edit stored target

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `t_target_id` <sub>string</sub> - target ID
* `t_computer` <sub>string</sub>   - hostname
* `t_domain` <sub>string</sub>       - domain name
* `t_address` <sub>string</sub>     - host IP address
* `t_os` <sub>int</sub>                     - OS type (0 - unknown, 1- windows, 2 - Linux, 3 - MacOS )
* `t_os_desc` <sub>string</sub>     - OS description
* `t_tag` <sub>string</sub>              - target tag
* `t_info` <sub>string</sub>            - target info
* `t_alive` <sub>bool</sub>            - is alive target

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>targets/set/tag </summary>

Set target tag

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `id_array` <sub>\[string]</sub> - list of target IDs
* `tag` <sub>string</sub>              - tag for the target

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>targets/remove </summary>

Remove stored targets

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `target_id_array` <sub>\[string]</sub> - list of target IDs

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - status string or error text

</details>

## Tunnel

<details>

<summary><strong>GET            {endpoint}/</strong>tunnel/list </summary>

Get a list of tunnels with full information

**Request**

Header `Authorization: Bearer <access_token>`

**Response (JSON)**

List of tunnels with parameters

* `p_tunnel_id` <sub>string</sub> - tunnel ID
* `p_agent_id` <sub>string</sub>   - agent ID
* `p_computer` <sub>string</sub>   - session computer
* `p_username` <sub>string</sub>   - session user
* `p_process` <sub>string</sub>     - session process
* `p_type` <sub>string</sub>            - tunnel type
* `p_info` <sub>string</sub>            - tunnel info
* `p_interface` <sub>string</sub> - listen address
* `p_port` <sub>string</sub>            - listen port
* `p_client` <sub>string</sub>        - listen client
* `p_fhost` <sub>string</sub>          - forward address
* `p_fport` <sub>string</sub>          - forward port
* `p_auth_user` <sub>string</sub> - proxy login
* `p_auth_pass` <sub>string</sub> - proxy password

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>start/socks5 </summary>

Start socks5 proxy

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id` <sub>string</sub> - agent ID
* `listen` <sub>bool</sub>       - is listen port on teamserver
* `desc` <sub>string</sub>         - tunnel info
* `l_host` <sub>string</sub>     - listen address
* `l_port` <sub>int</sub>          - listen port
* `use_auth` <sub>bool</sub>   - use authentication
* `username` <sub>string</sub> - proxy login
* `password` <sub>string</sub> - proxy password

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - tunnel ID or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>start/socks4 </summary>

Start socks4 proxy

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id` <sub>string</sub> - agent ID
* `listen` <sub>bool</sub>       - is listen port on teamserver
* `desc` <sub>string</sub>         - tunnel info
* `l_host` <sub>string</sub>     - listen address
* `l_port` <sub>int</sub>          - listen port

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - tunnel ID or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>start/lportfwd </summary>

Start local port forwarding

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id` <sub>string</sub> - agent ID
* `listen` <sub>bool</sub>       - is listen port on teamserver
* `desc` <sub>string</sub>         - tunnel info
* `l_host` <sub>string</sub>     - listen address
* `l_port` <sub>int</sub>          - listen port
* `t_host` <sub>string</sub>     - target address
* `t_port` <sub>int</sub>          - target port

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - tunnel ID or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>start/rportfwd </summary>

Start reverse port forwarding

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `agent_id` <sub>string</sub> - agent ID
* `listen` <sub>bool</sub>       - is listen port on teamserver
* `desc` <sub>string</sub>         - tunnel info
* `port` <sub>int</sub>              - listen port
* `t_host` <sub>string</sub>     - target address
* `t_port` <sub>int</sub>          - target port

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - tunnel ID or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>set/info </summary>

Set tunnel info

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `p_tunnel_id` <sub>string</sub> - tunnel ID
* `p_info` <sub>string</sub>            - tunnel info

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - tunnel ID or error text

</details>

<details>

<summary><strong>POST         {endpoint}/</strong>stop </summary>

Stop tunnel

**Request (JSON)**

Header `Authorization: Bearer <access_token>`&#x20;

* `p_tunnel_id` <sub>string</sub> - tunnel ID

**Response (JSON)**

* `ok` <sub>bool</sub>              - status
* `message` <sub>string</sub> - tunnel ID or error text

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://adaptix-framework.gitbook.io/adaptix-framework/development/teamserver-interface/web-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
