---
title: "Create Workspace Key"
method: POST
path: "/auth/api/v1/key/create"
tags: ["keys"]
---

# Create Workspace Key

`POST /auth/api/v1/key/create`

Creates workspace key for the defined role with the defined name in the workspace.

## Request body

- GithubComOpengovernOpengovernancePkgAuthApiCreateAPIKeyRequest
  - `name` string — Name of the key
  - `role` 'admin' | 'editor' | 'viewer'

## Response `200`

OK

- GithubComOpengovernOpengovernancePkgAuthApiCreateAPIKeyResponse
  - `active` boolean — Activity state of the key
  - `created_at` string — Creation timestamp in UTC
  - `id` integer — Unique identifier for the key
  - `name` string — Name of the key
  - `roleName` 'admin' | 'editor' | 'viewer'
  - `token` string — Token of the key

## Other responses

- `406` — Not Acceptable

---

[API](https://skmtc.net/opengovern/apis/opengovernance-service-api.md) · [All operations](https://skmtc.net/opengovern/apis/opengovernance-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opengovern/opengovernance-service-api/revisions/ab05295c4094/schema)
