---
title: "POST /v2/ImportKey"
method: POST
path: "/v2/ImportKey"
tags: ["Access key"]
---

# POST /v2/ImportKey

`POST /v2/ImportKey`

Imports an existing API key. This feature must only be used for migrations and backup restore.

**Do not use it to generate custom key identifiers or you will break your Garage cluster.**

## Request body

- ImportKeyRequest
  - `accessKeyId` string, required
  - `name` string, nullable
  - `secretAccessKey` string, required

## Response `200`

Access key has been imported

- ImportKeyResponse
  - `accessKeyId` string, required
  - `buckets` KeyInfoBucketResponse[], required
    - `globalAliases` string[], required
    - `id` string, required
    - `localAliases` string[], required
    - `permissions` ApiBucketKeyPerm, required
      - `owner` boolean
      - `read` boolean
      - `write` boolean
  - `created` string, date-time, nullable
  - `expiration` string, date-time, nullable
  - `expired` boolean, required
  - `name` string, required
  - `permissions` KeyPerm, required
    - `createBucket` boolean
  - `secretAccessKey` string, nullable

## Other responses

- `500` — Internal server error

---

[API](https://skmtc.dev/deuxfleurs/apis/garage-administration-api.md) · [All operations](https://skmtc.dev/deuxfleurs/apis/garage-administration-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/deuxfleurs/garage-administration-api/revisions/07ffb2d0febb/schema)
