curl --request POST \
--url https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop', 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.circuit.org/partner/v0.1/sessions/{session_id}/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.circuit.org/partner/v0.1/sessions/{session_id}/stop")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent": "<string>",
"name": "<string>",
"status": "running",
"started_at": "2023-11-07T05:31:56Z",
"wallet": "<string>",
"value_usd": "<string>",
"pnl_usd": "<string>",
"error": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Stop an agent
Stops a running session immediately. Its open positions stay open; the user can close them on Circuit or by asking Ask. Calling it again on a stopped session returns the session unchanged.
curl --request POST \
--url https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop', 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.circuit.org/partner/v0.1/sessions/{session_id}/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.circuit.org/partner/v0.1/sessions/{session_id}/stop")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.circuit.org/partner/v0.1/sessions/{session_id}/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"agent": "<string>",
"name": "<string>",
"status": "running",
"started_at": "2023-11-07T05:31:56Z",
"wallet": "<string>",
"value_usd": "<string>",
"pnl_usd": "<string>",
"error": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
The permit the user approved for your app.
Path Parameters
"ses_2f81c0de-5a7b-4c3d-9e1f-0a2b3c4d5e6f"
Response
OK
An agent running for the user on one wallet or on paper money.
The session's id, starting with ses_.
The agent it runs, starting with agt_.
The agent's name.
The agent is running on its own schedule.
"running"When the session started.
The wallet it trades, starting with wal_. Null when it runs on paper money.
The current value of what the session holds, in USD as a decimal string. Null until Circuit first values a new session, about a minute after it starts, or when a holding can't be priced.
Profit or loss since the session started, in USD as a decimal string. Null when unknown.
What the user needs to do when status is needs_user. Null otherwise.