---
title: "Create a new context"
method: POST
path: "/context"
tags: ["Context"]
---

# Create a new context

`POST /context`

## Request

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

Creates a new context in the specified organization.

## Request body

- ContextCreated
  - `name` string, required: The user defined name of the context.
  - `owner` union, required
    - object
      - `id` string, uuid, required: The unique ID of the owner of the context. This is the organization ID. Specify either owner/organization ID or the owner/organization slug. Find the organization ID and slug in the CircleCI web app (Organization Settings > Overview). Owner/organization slug is not supported for CircleCI server.
      - `type` 'account' | 'organization': The type of the owner. Defaults to "organization". Use "account" if you are using CircleCI server.
    - object
      - `slug` string, required: A string that represents an organization. This is the organization slug. Specify either this or organization/owner ID. Find the organization ID and slug in the CircleCI web app (Organization Settings > Overview). Owner/organization slug is not supported for CircleCI server.
      - `type` 'organization': The type of owner. Defaults to "organization". Accounts are only used as context owners in server and must be specified by an id instead of a slug.

## Response `200`

The new context

- object
  - `id` string, uuid, required: The unique ID of the context.
  - `name` string, required: The user-defined name of the context.
  - `created_at` string, date-time, required: The date and time the context was created.

## Other responses

- `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)
