---
title: "Get connection logs"
method: GET
path: "/api/v2/connectionlog"
tags: ["Enterprise"]
---

# Get connection logs

`GET /api/v2/connectionlog`

## Query parameters

- `q` string
- `limit` integer, required
- `offset` integer

## Response `200`

OK

- CodersdkConnectionLogResponse
  - `connection_logs` CodersdkConnectionLog[]
    - `agent_name` string
    - `connect_time` string, date-time
    - `id` string, uuid
    - `ip` string
    - `organization` CodersdkMinimalOrganization
      - `display_name` string
      - `icon` string
      - `id` string, uuid, required
      - `name` string
    - `ssh_info` CodersdkConnectionLogSSHInfo
      - `connection_id` string, uuid
      - `disconnect_reason` string — DisconnectReason is omitted if a disconnect event with the same connection ID has not yet been seen.
      - `disconnect_time` string, date-time — DisconnectTime is omitted if a disconnect event with the same connection ID has not yet been seen.
      - `exit_code` integer — ExitCode is the exit code of the SSH session. It is omitted if a disconnect event with the same connection ID has not yet been seen.
    - `type` 'ssh' | 'vscode' | 'jetbrains' | 'reconnecting_pty' | 'workspace_app' | 'port_forwarding' | 'tunnel'
    - `web_info` CodersdkConnectionLogWebInfo
      - `slug_or_port` string
      - `status_code` integer — StatusCode is the HTTP status code of the request.
      - `user` CodersdkUser
        - `avatar_url` string, uri
        - `created_at` string, date-time, required
        - `email` string, email, required
        - `has_ai_seat` boolean — HasAISeat intentionally omits omitempty so the API always includes the field, even when false.
        - `id` string, uuid, required
        - `is_service_account` boolean
        - `last_seen_at` string, date-time
        - `login_type` '' | 'password' | 'github' | 'oidc' | 'token' | 'none'
        - `name` string
        - `organization_ids` string[]
        - `roles` CodersdkSlimRole[]
          - `display_name` string
          - `name` string
          - `organization_id` string
        - `status` 'active' | 'dormant' | 'suspended'
        - `theme_preference` string — Deprecated: this value should be retrieved from `codersdk.UserPreferenceSettings` instead.
        - `updated_at` string, date-time
        - `username` string, required
      - `user_agent` string
    - `workspace_id` string, uuid
    - `workspace_name` string
    - `workspace_owner_id` string, uuid
    - `workspace_owner_username` string
  - `count` integer
  - `count_cap` integer

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
