Skip to content

API reference

Set the SFTP keys

Other routes API

PUT/v1/sftp

Replaces 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 -l prints it, SHA256:….

    • commentstring or nullRequired
  • dropsarray of objectRequired

    The newest 20 files, newest first.

    Show 6 child fields
    • filestringRequired
    • folderstringRequired
      One of outgoing, incoming.
    • outcomestringRequired

      pending waits for its check, filed is answered, refused was not filed, duplicate was filed before.

      One of pending, 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/sftp
Example
curl -X PUT https://api.certinvo.com/v1/sftp \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { 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
PUT
/v1/sftp
Set the SFTP keys
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Headers2
›Bodyapplication/json
›Code Snippet
curl -X PUT "https://api.certinvo.com/v1/sftp" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "publicKeys": [
    "string"
  ]
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close