---
title: "Validate CLI authentication"
method: GET
path: "/cli/auth/validate"
tags: ["CLI"]
---

# Validate CLI authentication

`GET /cli/auth/validate`

## Request

- Base URL: `https://app.codethreat.com/api/v1`
- URL: `https://app.codethreat.com/api/v1/cli/auth/validate`
- Auth: API key in header `X-API-Key`

Validate authentication and return user context information

## Query parameters

- `includePermissions` boolean
- `includeOrganizations` boolean
- `includeUsage` boolean

## Response `200`

Authentication valid

- CliAuthValidationResponse
  - `success` boolean
  - `data` object
    - `valid` boolean
    - `user` object
      - `id` string
      - `email` string
      - `name` string
    - `organizations` Organization[]
      - `id` string
      - `name` string
      - `slug` string
      - `planType` 'FREE' | 'PRO'
      - `isPersonal` boolean
      - `usageBalance` number
      - `createdAt` string, date-time
      - `updatedAt` string, date-time
    - `permissions` string[]
    - `usage` object
    - `authenticatedAt` string, date-time
  - `pagination` Pagination
    - `page` integer
    - `limit` integer
    - `total` integer
    - `totalPages` integer
    - `hasNext` boolean
    - `hasPrev` boolean
  - `meta` ResponseMeta
    - `timestamp` string, date-time
    - `version` string
    - `requestId` string
    - `organizationId` string

## Other responses

- `401`: Authentication required or invalid API key

---

[API](https://skmtc.dev/codethreat/apis/codethreat-api.md) - [All operations](https://skmtc.dev/codethreat/apis/codethreat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/codethreat/apis/codethreat-api/revisions/18f11fecbb30?raw)
