Skip to content
Dashboard
Theme
Theme

Generate an SFTP key pair for a directory source

POST /v1/directories/{dir}/source/ssh_key: Generate an SFTP key pair for a directory source.

View Markdown

POST /v1/directories/{dir}/source/ssh_key

Generates a new Ed25519 key pair for an sftp_csv directory, replacing any earlier one; the private key is sealed and never returned. Install the public key for the SFTP user, then save the source credentials without private_key. A source saved earlier keeps the key it was saved with until its credentials are saved again.

Scope
directories:write
Auth
Secret key (sk_…)
Since
1.0
  • dir string Required

  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/directories/dir_01J9Z3K5V7W8X9Y0Z1A2B3C4D5/source/ssh_key" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY"
Response 201
{
"object": "directory_source_ssh_key",
"directory_id": "dir_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"public_key": "plan",
"fingerprint": "example_fingerprint",
"created_at": "2026-01-15T09:30:00Z"
}