v1

latestOpenAPI 3.0.3AGPL-3.0-only2026-07-17120116247.0 KB
API keys

Add API key

Adds a new API key

post/apikeys

Request body

idstring

unique key identifier

namestring

User friendly key name

keystring 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

scope1 | 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_atinteger

creation time as unix timestamp in milliseconds

updated_atinteger

last update time as unix timestamp in milliseconds

last_use_atinteger

last use time as unix timestamp in milliseconds. It is saved at most once every 10 minutes

expires_atinteger

expiration time as unix timestamp in milliseconds

descriptionstring

optional description

userstring

username associated with this API key. If empty and the scope is "user scope" the key can impersonate any user

adminstring

admin associated with this API key. If empty and the scope is "admin scope" the key can impersonate any admin

Response

successful operation

mesagestring
keystring

generated API key

Example response

{
  "mesage": "API key created. This is the only time the API key is visible, please save it."
}