// First-party cookie auth: this runs in a signed-in trdrs session, not under an API key.
const res = await fetch('https://app.trdrs.co/api/challenges/enroll', {
method: 'POST',
headers: {
'content-type': 'application/json',
},
credentials: 'include',
body: JSON.stringify({
"challengeId": "3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84",
"size": 50000
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/challenges/enroll' \
-b "session=$TRDRS_SESSION" \
-H 'content-type: application/json' \
-d '{"challengeId":"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84","size":50000}'import requests
url = "https://app.trdrs.co/api/challenges/enroll"
payload = {
"challengeId": "3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84",
"size": 50000
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/challenges/enroll",
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([
'challengeId' => '3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84',
'size' => 50000
]),
CURLOPT_COOKIE => "session=",
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://app.trdrs.co/api/challenges/enroll"
payload := strings.NewReader("{\n \"challengeId\": \"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84\",\n \"size\": 50000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "session=")
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://app.trdrs.co/api/challenges/enroll")
.header("cookie", "session=")
.header("Content-Type", "application/json")
.body("{\n \"challengeId\": \"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84\",\n \"size\": 50000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/challenges/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"challengeId\": \"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84\",\n \"size\": 50000\n}"
response = http.request(request)
puts response.read_body{
"enrollment": {
"id": "e5c90b1a-7d34-4f6b-8a2e-91c8f0d47a53",
"challengeId": "3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84",
"challengeName": "50K Evaluation",
"stage": 1,
"accountNumber": "EVAL-50K-0042",
"type": "standard",
"status": "registered",
"startingBalance": 50000,
"ddMode": "trailing_max_equity_eod",
"startsAt": null,
"endsAt": null,
"failReason": null,
"createdAt": 1787058000,
"progress": {
"equity": 50000,
"balance": 50000,
"dayAnchorEquity": 50000,
"hwmEquity": 50000,
"dailyFloor": 48000,
"totalFloor": 46000,
"profitTargetLevel": 54000,
"tradingDays": 0,
"minTradingDays": 5,
"openPositions": 0
}
}
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Create an enrollment
Preview: outside the additive-only guarantee. These shapes are the pre-contract v1 scaffold; the Phase-1 rebuild will change them. Read them, do not pin to them.
Served only when the engine runs with CHALLENGES_ENABLED. The route bundle is not merely disabled without it. It is never constructed, so every path here answers 404.
Enrols the calling user in a challenge: issues the evaluation account, creates the enrollment, and records the opening balance-ledger entry. size must be one of the program’s accountSizes. A program with a non-zero priceCents answers 402: this engine collects no fee, so only a 0-priced program enrols here. Atomic: the account, the enrollment, and the ledger entry are created as one unit.
// First-party cookie auth: this runs in a signed-in trdrs session, not under an API key.
const res = await fetch('https://app.trdrs.co/api/challenges/enroll', {
method: 'POST',
headers: {
'content-type': 'application/json',
},
credentials: 'include',
body: JSON.stringify({
"challengeId": "3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84",
"size": 50000
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/challenges/enroll' \
-b "session=$TRDRS_SESSION" \
-H 'content-type: application/json' \
-d '{"challengeId":"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84","size":50000}'import requests
url = "https://app.trdrs.co/api/challenges/enroll"
payload = {
"challengeId": "3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84",
"size": 50000
}
headers = {
"cookie": "session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/challenges/enroll",
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([
'challengeId' => '3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84',
'size' => 50000
]),
CURLOPT_COOKIE => "session=",
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://app.trdrs.co/api/challenges/enroll"
payload := strings.NewReader("{\n \"challengeId\": \"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84\",\n \"size\": 50000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "session=")
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://app.trdrs.co/api/challenges/enroll")
.header("cookie", "session=")
.header("Content-Type", "application/json")
.body("{\n \"challengeId\": \"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84\",\n \"size\": 50000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/challenges/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"challengeId\": \"3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84\",\n \"size\": 50000\n}"
response = http.request(request)
puts response.read_body{
"enrollment": {
"id": "e5c90b1a-7d34-4f6b-8a2e-91c8f0d47a53",
"challengeId": "3f8a1c2e-9b47-4d10-a3fe-2c61b7c90d84",
"challengeName": "50K Evaluation",
"stage": 1,
"accountNumber": "EVAL-50K-0042",
"type": "standard",
"status": "registered",
"startingBalance": 50000,
"ddMode": "trailing_max_equity_eod",
"startsAt": null,
"endsAt": null,
"failReason": null,
"createdAt": 1787058000,
"progress": {
"equity": 50000,
"balance": 50000,
"dayAnchorEquity": 50000,
"hwmEquity": 50000,
"dailyFloor": 48000,
"totalFloor": 46000,
"profitTargetLevel": 54000,
"tradingDays": 0,
"minTradingDays": 5,
"openPositions": 0
}
}
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Authorizations
The signed session cookie of a logged-in trdrs user. First-party/browser only; a firm API key cannot reach a route secured this way.
Body
Response
Enrolled
Show child attributes
Show child attributes