---
title: "Get API keys"
method: GET
path: "/apikeys"
tags: ["API keys"]
---

# Get API keys

`GET /apikeys`

Returns an array with one or more API keys. For security reasons hashed keys are omitted in the response

## Query parameters

- `offset` integer
- `limit` integer
- `order` 'ASC' | 'DESC'

## Response `200`

successful operation

- APIKey[]
  - `id` string — unique key identifier
  - `name` string — User friendly key name
  - `key` string, password — We store the hash of the key. This is just like a password. For security reasons this field is omitted when you search/get API keys
  - `scope` 1 | 2 — Options: * `1` - admin scope. The API key will be used to impersonate an SFTPGo admin * `2` - user scope. The API key will be used to impersonate an SFTPGo user
  - `created_at` integer — creation time as unix timestamp in milliseconds
  - `updated_at` integer — last update time as unix timestamp in milliseconds
  - `last_use_at` integer — last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes
  - `expires_at` integer — expiration time as unix timestamp in milliseconds
  - `description` string — optional description
  - `user` string — username associated with this API key. If empty and the scope is "user scope" the key can impersonate any user
  - `admin` string — admin associated with this API key. If empty and the scope is "admin scope" the key can impersonate any admin

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error
- `default` — Unexpected Error

---

[API](https://skmtc.net/kanton-bern/apis/sftpgo.md) · [All operations](https://skmtc.net/kanton-bern/apis/sftpgo/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kanton-bern/sftpgo/revisions/d8d616a479b0/schema)
