---
title: "Create managed key."
method: POST
path: "/_fabric/{fabric}/_api/kms/managedkey"
tags: ["Managed Keys"]
---

# Create managed key.

`POST /_fabric/{fabric}/_api/kms/managedkey`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/kms/managedkey/post.ts> (a function with typed inputs; its response is checked against the schema)

Create managed key.

## Path parameters

- `fabric` string, required

## Request body

- CreateManagedKeyRequest
  - `name` string
  - `managedKeyType` string
  - `keyProvider` string
  - `service` string
  - `description` string
  - `masterKeyIds` object

## Response `200`

Successfully created the managed key.

- CreateManagedKeyExampleRc200
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `code` integer: The generated response code.
  - `result` object
    - `id` string
    - `name` string
    - `keyOptions` object
    - `managedKeyType` string
    - `keyProvider` string
    - `tenant` string
    - `fabric` string
    - `createdAt` number
    - `updatedAt` number
    - `status` string
    - `description` string

## Other responses

- `401`: Failed because you do not have administrator permissions.
- `403`: Failed due to credentials restrictions.
- `412`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `422`: Failed because key policy has not been added to customer's ARN.

---

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