---
title: "Get repository context"
method: POST
path: "/api/v2/contexts/get"
tags: ["Repository Context"]
---

# Get repository context

`POST /api/v2/contexts/get`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/contexts/get`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Read one context definition and its actual assignments by contextId.

## Request body

- GetContextInput
  - `organizationId` string: Organization ID. Resolved from authentication when omitted.
  - `contextId` string, required

## Response `200`

Successful response

- RepositoryContext
  - `id` string, required
  - `title` string, nullable, required
  - `context` string, required
  - `globPattern` string, required
  - `applicableSourceTypes` string[], required: Source types to target. An empty array applies to all source types.
  - `scanPhases` string[], required: Scan phases to target. Omission preserves phases on update; creation uses the documented default phase set.
  - `allRepositories` boolean, required: True when linked to organization-wide scanner settings.
  - `repositoryIds` string[], required: Only direct repository assignments; organization scope is not expanded into this array.
  - `tags` object[], required
    - `id` string, required
    - `name` string, required
  - `mutationScope` object, required: Permission scope required to modify the entire context, independent of the repository filter.
    - `type` 'allRepositories' | 'repositories', required
    - `linkedRepositoryIds` string[], required

## Other responses

- `400`: Error Response
- `401`: Error Response
- `403`: Error Response
- `404`: Error Response
- `409`: Error Response

---

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