PUT
/v1/sftpReplaces the public keys that may log in, up to 10, each one OpenSSH line (ed25519, ECDSA, or RSA of at least 3072 bits). An empty list lets nobody in and keeps the username. The first save makes the username. Only a signed-in person may change it.
Request body
application/json, required
- publicKeysarray of stringRequired
Response
A 200 answer carries these fields.
- usernamestring or nullRequired
The login's name; null until the first key is saved.
- hoststring or nullRequired
The host to connect to
- portintegerRequired
- publicKeysarray of objectRequired
Show 3 child fields
- typestringRequired
- fingerprintstringRequired
As
ssh-keygen -lprints it,SHA256:…. - commentstring or nullRequired
- dropsarray of objectRequired
The newest 20 files, newest first.
Show 6 child fields
- filestringRequired
- folderstringRequiredOne of
outgoing,incoming. - outcomestringRequired
pendingwaits for its check,filedis answered,refusedwas not filed,duplicatewas filed before.One ofpending,filed,refused,duplicate. - receivedAtstring (date-time)Required
- answeredAtstring (date-time) or nullRequired
- errorstring or nullRequired
Why a refused file was not filed.
Status codes
| Status | Meaning |
|---|---|
200 |
The login as it now is. |
400 |
A key is not one OpenSSH public key, is weak, is listed twice, or there are more than 10 (invalid_sftp_key). Nothing was saved. |
401 |
No usable credential was sent (invalid_credentials), or it is not a signed-in person (session_required). |
503 |
This deployment runs no SFTP server or stores nothing (sftp_not_configured). Nothing was saved. |
PUT
/v1/sftpExample
curl -X PUT https://api.certinvo.com/v1/sftp \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const response = await fetch(`https://api.certinvo.com/v1/sftp`, {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
'Content-Type': 'application/json',
},
body: await readFile('body.json'),
})
console.log(response.status, await response.json())import os
import requests
response = requests.put(
"https://api.certinvo.com/v1/sftp",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text)200
application/json
{
"username": "string",
"host": "string",
"port": 0,
"publicKeys": [
{
"type": "string",
"fingerprint": "string",
"comment": "string"
}
],
"drops": [
{
"file": "string",
"folder": "outgoing",
"outcome": "pending",
"receivedAt": "2026-09-17T09:30:00Z",
"answeredAt": "2026-09-17T09:30:00Z",
"error": "string"
}
]
}Success response