---
title: "Create or update a Key from a raw key file"
method: POST
path: "/apiops/projects/{projectName}/keys/import-file/"
tags: ["Key"]
---

# Create or update a Key from a raw key file

`POST /apiops/projects/{projectName}/keys/import-file/`

## Request

- Base URL: `http://167.86.118.166:32080`
- URL: `http://167.86.118.166:32080/apiops/projects/{projectName}/keys/import-file/`
- Auth: none declared
- TypeScript: <https://skmtc.dev/apinizer/apis/apinizer-management-apis/docs/apiops/projects/:projectName/keys/import-file/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads the key material as a file (PEM, or Base64/DER which is normalized to PEM) instead of embedding it in a JSON body. The same file is written to every environment named in environmentList. With override=true an existing key of that name is updated; otherwise a new key is created.

## Path parameters

- `projectName` string, required

## Query parameters

- `keyName` string, required
- `keyType` string, required
- `algorithm` string
- `environmentList` string
- `keyDescription` string
- `alias` string
- `override` boolean

## Request body `multipart/form-data`

- object
  - `keyFile` string, binary, required: Raw key file (PEM or Base64/DER)
  - `environmentMapping` string: Optional JSON: environment name in the package -> environment name in this installation (example: {"UAT":"Production"}). An empty value means that environment is deliberately not transferred. Only meaningful when a ZIP is uploaded.

## Response `200`

successful operation!

- ApiOpsResponseSuccess
  - `status` 'SUCCESS' | 'FAILURE'
  - `resultMessage` string
  - `resultList` string[]
  - `resultCount` integer
  - `deploymentResult` DeploymentResult
    - `envName` string
    - `podName` string
    - `podIp` string
    - `success` boolean
    - `detail` string
    - `responseTime` integer
    - `detailList` unknown[]
      - unknown
    - `firstFromApiResultList` unknown
  - `unresolvedReferences` string[]
  - `advisories` ApiOpsAdvisoryDTO[]
    - `level` string
    - `key` string
    - `params` object

## Other responses

- `400`: bad request!
- `401`: not authorized for this operation!
- `500`: internal error!

## Changes

- **2026-08-11** `9ae232e55479`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/apinizer/apis/apinizer-management-apis/changes/apiops/projects/:projectName/keys/import-file/post.md)

---

[API](https://skmtc.dev/apinizer/apis/apinizer-management-apis.md) - [All operations](https://skmtc.dev/apinizer/apis/apinizer-management-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/apinizer/apis/apinizer-management-apis/revisions/e083046b24cd?raw)
