curl --request POST \
--url https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"host_key_fingerprint": "<string>"
}
'import requests
url = "https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect"
payload = {
"idempotency_key": "<string>",
"host_key_fingerprint": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({idempotency_key: '<string>', host_key_fingerprint: '<string>'})
};
fetch('https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'idempotency_key' => '<string>',
'host_key_fingerprint' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"host_key_fingerprint\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"host_key_fingerprint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"idempotency_key\": \"<string>\",\n \"host_key_fingerprint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"host": "<string>",
"port": 123,
"username": "<string>",
"workspace_path": "<string>",
"auth_type": "password",
"host_key_fingerprint": "<string>",
"pending_host_key_fingerprint": "<string>",
"device_id": "<string>",
"status": "saved",
"error_code": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"replayed": true,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Connect or reconnect over SSH
Returns 202, not readiness. With no pinned host key, this only probes: poll, compare the fingerprint to a trusted source, then send a fresh idempotency_key and host_key_fingerprint to install. Never blindly trust a probe. Later reconnects reuse retained credentials and valid Device identity. A repeated key replays the original operation without launching again. Poll GET with a deadline; after interruption use a fresh key explicitly. Authorization is checked at admission; revoking the initiating API key does not cancel accepted setup or revoke its Device. Non-systemd hosts need manual Reconnect after restart. REST only.
Scope:ssh:writecurl --request POST \
--url https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"host_key_fingerprint": "<string>"
}
'import requests
url = "https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect"
payload = {
"idempotency_key": "<string>",
"host_key_fingerprint": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({idempotency_key: '<string>', host_key_fingerprint: '<string>'})
};
fetch('https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'idempotency_key' => '<string>',
'host_key_fingerprint' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect"
payload := strings.NewReader("{\n \"idempotency_key\": \"<string>\",\n \"host_key_fingerprint\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"idempotency_key\": \"<string>\",\n \"host_key_fingerprint\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reasonmachines.ai/v3/organizations/{orgId}/ssh-connections/{connectionId}/connect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"idempotency_key\": \"<string>\",\n \"host_key_fingerprint\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"connection": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"host": "<string>",
"port": 123,
"username": "<string>",
"workspace_path": "<string>",
"auth_type": "password",
"host_key_fingerprint": "<string>",
"pending_host_key_fingerprint": "<string>",
"device_id": "<string>",
"status": "saved",
"error_code": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
},
"replayed": true,
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Your Reason API key from Settings > API. New keys use reason_; legacy ara_ keys remain accepted. Keys are capability-scoped: run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read, sessions:debug, knowledge:read, memory:read, memory:write, skills:read, skills:write, repos:read, repos:write, reviews:read, reviews:write, deployment:read, analytics:read, org:read, org:write, attachments:read, attachments:write, guardrails:read, guardrails:write, automations:read, automations:write, agent_auth:read. mcp:write manages MCP server configuration only; it does not authorize remote MCP-tool execution. sessions:debug is privileged: it expands diagnostic session events only for organization owners/admins.
Path Parameters
Organization id or slug. Resolve it with GET /v3/self.
The owned SSH connection id, not its eventual Device id.
Body
Persist one non-secret key per logical request. Retry the identical body/key for up to 24 hours. Expired or deleted request keys return 409; reconnect intentionally with a fresh key.
1 - 160^[A-Za-z0-9._:-]+$^SHA256:[A-Za-z0-9+/]{43}$Response
Accepted operation or replay; poll the connection.

