---
title: "List repository contexts"
method: POST
path: "/api/v2/contexts/list"
tags: ["Repository Context"]
---

# List repository contexts

`POST /api/v2/contexts/list`

## Request

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

List context definitions, optionally including every scope applicable to a repository. Entries are ordered by ID and cursor-paginated.

## Request body

- ListContextsInput
  - `organizationId` string: Organization ID. Resolved from authentication when omitted.
  - `repositoryId` string: Return direct, organization-wide, and matching tag contexts applicable to this repository, without duplicates.
  - `cursor` string: Opaque nextCursor from the preceding page.
  - `limit` integer

## Response `200`

Successful response

- ContextListResponse
  - `items` RepositoryContext[], required
    - `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
  - `nextCursor` string, nullable, required
  - `hasMore` boolean, 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)
