---
title: "Get context restrictions"
method: GET
path: "/context/{context_id}/restrictions"
tags: ["Context"]
---

# Get context restrictions

`GET /context/{context_id}/restrictions`

## Request

- Base URL: `https://circleci.com/api/v2`
- URL: `https://circleci.com/api/v2/context/{context_id}/restrictions`
- Auth: one of:
  - API key in header `Circle-Token`
  - HTTP bearer
  - HTTP basic
  - API key in query parameter `circle-token`

Gets a list of project and expression restrictions associated with a context.

## Response `200`

Successful response.

- ContextProjectRestrictionsList
  - `items` object[]
    - `context_id` string, uuid: UUID of the context
    - `id` string, uuid: UUID of the restriction
    - `project_id` string, uuid: Deprecated - For "project" restrictions read the project ID from "restriction_value" instead. UUID of the project used in a project restriction.
    - `name` string: Contains a human-readable reference for the restriction. For "project" restrictions this is the name of the project. May be null.
    - `restriction_type` 'project' | 'expression' | 'group': Type of the restriction
    - `restriction_value` string: Value used to evaluate the restriction
  - `next_page_token` string, nullable: Token that can be used to retrieve next page of results

## Other responses

- `400`: Context ID provided is invalid.
- `401`: Credentials provided are invalid.
- `404`: Entity not found.
- `429`: API rate limits exceeded.
- `500`: Internal server error.

---

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