Start connecting an agent
curl --request POST \
--url https://testnet.edel-api.xyz/v1/agent-connect/start \
--header 'Content-Type: application/json' \
--data '
{
"clientName": "<string>",
"scopes": [],
"lifetimeSeconds": 302550
}
'import requests
url = "https://testnet.edel-api.xyz/v1/agent-connect/start"
payload = {
"clientName": "<string>",
"scopes": [],
"lifetimeSeconds": 302550
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({clientName: '<string>', scopes: [], lifetimeSeconds: 302550})
};
fetch('https://testnet.edel-api.xyz/v1/agent-connect/start', 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://testnet.edel-api.xyz/v1/agent-connect/start",
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([
'clientName' => '<string>',
'scopes' => [
],
'lifetimeSeconds' => 302550
]),
CURLOPT_HTTPHEADER => [
"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://testnet.edel-api.xyz/v1/agent-connect/start"
payload := strings.NewReader("{\n \"clientName\": \"<string>\",\n \"scopes\": [],\n \"lifetimeSeconds\": 302550\n}")
req, _ := http.NewRequest("POST", url, payload)
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://testnet.edel-api.xyz/v1/agent-connect/start")
.header("Content-Type", "application/json")
.body("{\n \"clientName\": \"<string>\",\n \"scopes\": [],\n \"lifetimeSeconds\": 302550\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.edel-api.xyz/v1/agent-connect/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientName\": \"<string>\",\n \"scopes\": [],\n \"lifetimeSeconds\": 302550\n}"
response = http.request(request)
puts response.read_body{
"version": "agent-connect-start/v1",
"connectCode": "<string>",
"userCode": "<string>",
"verificationUrl": "<string>",
"expiresInSeconds": 123,
"intervalSeconds": 123,
"scopes": [
"read"
],
"keyLifetimeSeconds": 302550
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}Agent access
Start connecting an agent
Starts the agent connect device grant (RFC 8628 shape). Show verificationUrl and userCode to the account owner, who approves in the browser with a passkey session. Then call completeAgentConnect every intervalSeconds until it returns the API key. The grant expires after expiresInSeconds. Rate limited per source address; the response is never cacheable.
Method and path: POST /v1/agent-connect/start
Authentication: none.
Request schema: AgentConnectStartRequest.
Response schema: AgentConnectStartResponse.
Error envelope: ExternalRestError (external-rest-error/v1).
POST
/
v1
/
agent-connect
/
start
Start connecting an agent
curl --request POST \
--url https://testnet.edel-api.xyz/v1/agent-connect/start \
--header 'Content-Type: application/json' \
--data '
{
"clientName": "<string>",
"scopes": [],
"lifetimeSeconds": 302550
}
'import requests
url = "https://testnet.edel-api.xyz/v1/agent-connect/start"
payload = {
"clientName": "<string>",
"scopes": [],
"lifetimeSeconds": 302550
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({clientName: '<string>', scopes: [], lifetimeSeconds: 302550})
};
fetch('https://testnet.edel-api.xyz/v1/agent-connect/start', 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://testnet.edel-api.xyz/v1/agent-connect/start",
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([
'clientName' => '<string>',
'scopes' => [
],
'lifetimeSeconds' => 302550
]),
CURLOPT_HTTPHEADER => [
"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://testnet.edel-api.xyz/v1/agent-connect/start"
payload := strings.NewReader("{\n \"clientName\": \"<string>\",\n \"scopes\": [],\n \"lifetimeSeconds\": 302550\n}")
req, _ := http.NewRequest("POST", url, payload)
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://testnet.edel-api.xyz/v1/agent-connect/start")
.header("Content-Type", "application/json")
.body("{\n \"clientName\": \"<string>\",\n \"scopes\": [],\n \"lifetimeSeconds\": 302550\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.edel-api.xyz/v1/agent-connect/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientName\": \"<string>\",\n \"scopes\": [],\n \"lifetimeSeconds\": 302550\n}"
response = http.request(request)
puts response.read_body{
"version": "agent-connect-start/v1",
"connectCode": "<string>",
"userCode": "<string>",
"verificationUrl": "<string>",
"expiresInSeconds": 123,
"intervalSeconds": 123,
"scopes": [
"read"
],
"keyLifetimeSeconds": 302550
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}Body
application/json
Response
Created
Allowed value:
"agent-connect-start/v1"Pattern:
^[A-Za-z0-9_-]{43}$Pattern:
^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$Required array length:
1 - 2 elementsAvailable options:
read, trade Required range:
300 <= x <= 604800