---
title: "Create or update context kind"
method: PUT
path: "/api/v2/projects/{projectKey}/context-kinds/{key}"
tags: ["Contexts"]
---

# Create or update context kind

`PUT /api/v2/projects/{projectKey}/context-kinds/{key}`

Create or update a context kind by key. Only the included fields will be updated.

## Path parameters

- `projectKey` string, string, required — The project key
- `key` string, string, required — The context kind key

## Request body

- UpsertContextKindPayload
  - `name` string, required — The context kind name
  - `description` string — The context kind description
  - `hideInTargeting` boolean — Alias for archived.
  - `archived` boolean — Whether the context kind is archived. Archived context kinds are unavailable for targeting.
  - `version` integer — The context kind version. If not specified when the context kind is created, defaults to 1.

## Response `200`

Context kind upsert response

- UpsertResponseRep
  - `status` string — The status of the create or update operation
  - `_links` object — The location and content type of related resources

## Other responses

- `400` — Invalid request
- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
