---
title: "Get authentication context"
method: GET
path: "/auth/context"
tags: ["Authentication"]
---

# Get authentication context

`GET /auth/context`

## Request

- Base URL: `https://api.onkernel.com`
- URL: `https://api.onkernel.com/auth/context`
- Auth: HTTP bearer

Returns the authenticated principal, organization, credential scope, and effective request scope. The response is derived from the verified request context and does not expose credential secrets.

## Response `200`

Authentication context for the current request

- AuthContext: The identity and authorization context resolved for the current request.
  - `authentication` AuthContextAuthentication, required
    - `credential_id` string, nullable, required: The API key ID when authenticated with an API key; null for session credentials.
    - `method` 'api_key' | 'jwt', required: The credential format used to authenticate the request.
    - `source` 'api_key' | 'oauth' | 'dashboard', required: The source classification resolved by authentication middleware.
  - `authorization` AuthContextAuthorization, required: The credential's maximum scope and the effective scope selected for this request. Future permission data can be added without changing scope semantics.
    - `credential_scope` AuthContextScope, required: A scope within the authenticated organization. A null project_id represents organization-wide scope.
      - `project_id` string, nullable, required: The Kernel project ID, or null when the scope is organization-wide.
    - `effective_scope` AuthContextScope, required: A scope within the authenticated organization. A null project_id represents organization-wide scope.
      - `project_id` string, nullable, required: The Kernel project ID, or null when the scope is organization-wide.
  - `organization` AuthContextOrganization, required
    - `id` string, required: The authenticated Kernel organization ID.
  - `principal` AuthContextPrincipal, required
    - `id` string, required: The API key ID for API-key principals or user ID for user principals.
    - `type` 'api_key' | 'user', required: The kind of principal authenticated for the request.

## Other responses

- `401`: Unauthorized – missing or invalid authorization token
- `500`: Internal Server Error

## Changes

- **2026-10-16** `03b369edee49`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kernel/apis/kernel-api/changes/auth/context/get.md)

---

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