curl --request POST \
--url https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"approval": {
"install_id": "<string>",
"code_challenge": "<string>",
"roots": [
{
"path_fingerprint": "<string>",
"permissions": {
"read": true,
"write": true,
"execute": true,
"discover_environment": true,
"expose_mcp": false
},
"execution_mode": "confined"
}
],
"ttl_seconds": 61,
"folder_lane_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"code_verifier": "<string>",
"registration": {}
}
'import requests
url = "https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments"
payload = {
"approval": {
"install_id": "<string>",
"code_challenge": "<string>",
"roots": [
{
"path_fingerprint": "<string>",
"permissions": {
"read": True,
"write": True,
"execute": True,
"discover_environment": True,
"expose_mcp": False
},
"execution_mode": "confined"
}
],
"ttl_seconds": 61,
"folder_lane_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"code_verifier": "<string>",
"registration": {}
}
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({
approval: {
install_id: '<string>',
code_challenge: '<string>',
roots: [
{
path_fingerprint: '<string>',
permissions: {
read: true,
write: true,
execute: true,
discover_environment: true,
expose_mcp: false
},
execution_mode: 'confined'
}
],
ttl_seconds: 61,
folder_lane_of: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
code_verifier: '<string>',
registration: {}
})
};
fetch('https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments', 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.com/v3/organizations/{orgId}/devices/enrollments",
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([
'approval' => [
'install_id' => '<string>',
'code_challenge' => '<string>',
'roots' => [
[
'path_fingerprint' => '<string>',
'permissions' => [
'read' => true,
'write' => true,
'execute' => true,
'discover_environment' => true,
'expose_mcp' => false
],
'execution_mode' => 'confined'
]
],
'ttl_seconds' => 61,
'folder_lane_of' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'code_verifier' => '<string>',
'registration' => [
]
]),
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.com/v3/organizations/{orgId}/devices/enrollments"
payload := strings.NewReader("{\n \"approval\": {\n \"install_id\": \"<string>\",\n \"code_challenge\": \"<string>\",\n \"roots\": [\n {\n \"path_fingerprint\": \"<string>\",\n \"permissions\": {\n \"read\": true,\n \"write\": true,\n \"execute\": true,\n \"discover_environment\": true,\n \"expose_mcp\": false\n },\n \"execution_mode\": \"confined\"\n }\n ],\n \"ttl_seconds\": 61,\n \"folder_lane_of\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"code_verifier\": \"<string>\",\n \"registration\": {}\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.com/v3/organizations/{orgId}/devices/enrollments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"approval\": {\n \"install_id\": \"<string>\",\n \"code_challenge\": \"<string>\",\n \"roots\": [\n {\n \"path_fingerprint\": \"<string>\",\n \"permissions\": {\n \"read\": true,\n \"write\": true,\n \"execute\": true,\n \"discover_environment\": true,\n \"expose_mcp\": false\n },\n \"execution_mode\": \"confined\"\n }\n ],\n \"ttl_seconds\": 61,\n \"folder_lane_of\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"code_verifier\": \"<string>\",\n \"registration\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments")
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 \"approval\": {\n \"install_id\": \"<string>\",\n \"code_challenge\": \"<string>\",\n \"roots\": [\n {\n \"path_fingerprint\": \"<string>\",\n \"permissions\": {\n \"read\": true,\n \"write\": true,\n \"execute\": true,\n \"discover_environment\": true,\n \"expose_mcp\": false\n },\n \"execution_mode\": \"confined\"\n }\n ],\n \"ttl_seconds\": 61,\n \"folder_lane_of\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"code_verifier\": \"<string>\",\n \"registration\": {}\n}"
response = http.request(request)
puts response.read_body{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"auth_scheme": "p256",
"protocol_version": 123,
"roots": [
{
"id": "<string>",
"label": "<string>",
"path_fingerprint": "<string>"
}
],
"headless": {
"lifecycle": "persistent",
"expires_at": "<string>"
},
"first_heartbeat": {
"challenge": "<string>",
"expires_at": "<string>"
}
}{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"auth_scheme": "p256",
"protocol_version": 123,
"roots": [
{
"id": "<string>",
"label": "<string>",
"path_fingerprint": "<string>"
}
],
"headless": {
"lifecycle": "persistent",
"expires_at": "<string>"
},
"first_heartbeat": {
"challenge": "<string>",
"expires_at": "<string>"
}
}{
"error": {
"type": "rate_limited",
"message": "This API key exceeded its request-rate limit"
}
}Enroll a headless installation
Approves and redeems a headless enrollment in one request for an API-key or OAuth principal: the same approval as POST …/devices/enrollment-tickets, redeemed at once with its PKCE verifier and the Device’s registration and P-256 public key. The Device then authenticates on the signed Device transport. Execution feature gates can return 503.
Scope:devices:writecurl --request POST \
--url https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"approval": {
"install_id": "<string>",
"code_challenge": "<string>",
"roots": [
{
"path_fingerprint": "<string>",
"permissions": {
"read": true,
"write": true,
"execute": true,
"discover_environment": true,
"expose_mcp": false
},
"execution_mode": "confined"
}
],
"ttl_seconds": 61,
"folder_lane_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"code_verifier": "<string>",
"registration": {}
}
'import requests
url = "https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments"
payload = {
"approval": {
"install_id": "<string>",
"code_challenge": "<string>",
"roots": [
{
"path_fingerprint": "<string>",
"permissions": {
"read": True,
"write": True,
"execute": True,
"discover_environment": True,
"expose_mcp": False
},
"execution_mode": "confined"
}
],
"ttl_seconds": 61,
"folder_lane_of": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"code_verifier": "<string>",
"registration": {}
}
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({
approval: {
install_id: '<string>',
code_challenge: '<string>',
roots: [
{
path_fingerprint: '<string>',
permissions: {
read: true,
write: true,
execute: true,
discover_environment: true,
expose_mcp: false
},
execution_mode: 'confined'
}
],
ttl_seconds: 61,
folder_lane_of: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
code_verifier: '<string>',
registration: {}
})
};
fetch('https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments', 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.com/v3/organizations/{orgId}/devices/enrollments",
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([
'approval' => [
'install_id' => '<string>',
'code_challenge' => '<string>',
'roots' => [
[
'path_fingerprint' => '<string>',
'permissions' => [
'read' => true,
'write' => true,
'execute' => true,
'discover_environment' => true,
'expose_mcp' => false
],
'execution_mode' => 'confined'
]
],
'ttl_seconds' => 61,
'folder_lane_of' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'code_verifier' => '<string>',
'registration' => [
]
]),
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.com/v3/organizations/{orgId}/devices/enrollments"
payload := strings.NewReader("{\n \"approval\": {\n \"install_id\": \"<string>\",\n \"code_challenge\": \"<string>\",\n \"roots\": [\n {\n \"path_fingerprint\": \"<string>\",\n \"permissions\": {\n \"read\": true,\n \"write\": true,\n \"execute\": true,\n \"discover_environment\": true,\n \"expose_mcp\": false\n },\n \"execution_mode\": \"confined\"\n }\n ],\n \"ttl_seconds\": 61,\n \"folder_lane_of\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"code_verifier\": \"<string>\",\n \"registration\": {}\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.com/v3/organizations/{orgId}/devices/enrollments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"approval\": {\n \"install_id\": \"<string>\",\n \"code_challenge\": \"<string>\",\n \"roots\": [\n {\n \"path_fingerprint\": \"<string>\",\n \"permissions\": {\n \"read\": true,\n \"write\": true,\n \"execute\": true,\n \"discover_environment\": true,\n \"expose_mcp\": false\n },\n \"execution_mode\": \"confined\"\n }\n ],\n \"ttl_seconds\": 61,\n \"folder_lane_of\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"code_verifier\": \"<string>\",\n \"registration\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reasonmachines.com/v3/organizations/{orgId}/devices/enrollments")
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 \"approval\": {\n \"install_id\": \"<string>\",\n \"code_challenge\": \"<string>\",\n \"roots\": [\n {\n \"path_fingerprint\": \"<string>\",\n \"permissions\": {\n \"read\": true,\n \"write\": true,\n \"execute\": true,\n \"discover_environment\": true,\n \"expose_mcp\": false\n },\n \"execution_mode\": \"confined\"\n }\n ],\n \"ttl_seconds\": 61,\n \"folder_lane_of\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"code_verifier\": \"<string>\",\n \"registration\": {}\n}"
response = http.request(request)
puts response.read_body{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"auth_scheme": "p256",
"protocol_version": 123,
"roots": [
{
"id": "<string>",
"label": "<string>",
"path_fingerprint": "<string>"
}
],
"headless": {
"lifecycle": "persistent",
"expires_at": "<string>"
},
"first_heartbeat": {
"challenge": "<string>",
"expires_at": "<string>"
}
}{
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organization_id": "<string>",
"auth_scheme": "p256",
"protocol_version": 123,
"roots": [
{
"id": "<string>",
"label": "<string>",
"path_fingerprint": "<string>"
}
],
"headless": {
"lifecycle": "persistent",
"expires_at": "<string>"
},
"first_heartbeat": {
"challenge": "<string>",
"expires_at": "<string>"
}
}{
"error": {
"type": "rate_limited",
"message": "This API key exceeded its request-rate limit"
}
}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:read reads sessions, including the assistant, reasoning and tool activity in their events. sessions:debug is privileged: only for organization owners/admins, it expands session events to the full diagnostic projection (diagnostic event kinds, status text and raw event metadata).
Path Parameters
Organization id or slug. Resolve it with GET /v3/self.
Body
Single-use P-256/PKCE headless enrollment. Persistent TTL defaults to 30 days (maximum 90 days); ephemeral defaults to 1 hour (maximum 24 hours). Minimum TTL is 60 seconds. Root fingerprints and permissions are the approval ceiling; unknown fields, including device_kind and bound_run_id, are rejected.
Show child attributes
Show child attributes
PKCE verifier of the approval's code_challenge.
^[A-Za-z0-9_-]{43,128}$The Device's registration as the signed Device transport's enroll takes it (name, os, architecture, versions, protocol_version, capabilities, roots, device_public_key), without enrollment_ticket and code_verifier. device_public_key is required.
Response
The installation's existing Device enrolled again.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"p256"Show child attributes
Show child attributes
Show child attributes
Show child attributes
A single-use proof challenge for the Device's first heartbeat, and what that heartbeat may carry.
Show child attributes
Show child attributes

