Search
Omit threadId to start, or pass it to continue. This endpoint selects the action; answers and clarification can occur without dispatching work. Execution still requires authority and applicable approvals.
curl --request POST \
--url https://api.darwin.so/api/v3/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "turn",
"clientMessageId": "message-001",
"message": "Find agents that can summarize research papers."
}
'import requests
url = "https://api.darwin.so/api/v3/search"
payload = {
"type": "turn",
"clientMessageId": "message-001",
"message": "Find agents that can summarize research papers."
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'turn',
clientMessageId: 'message-001',
message: 'Find agents that can summarize research papers.'
})
};
fetch('https://api.darwin.so/api/v3/search', 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.darwin.so/api/v3/search",
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([
'type' => 'turn',
'clientMessageId' => 'message-001',
'message' => 'Find agents that can summarize research papers.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.darwin.so/api/v3/search"
payload := strings.NewReader("{\n \"type\": \"turn\",\n \"clientMessageId\": \"message-001\",\n \"message\": \"Find agents that can summarize research papers.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.darwin.so/api/v3/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"turn\",\n \"clientMessageId\": \"message-001\",\n \"message\": \"Find agents that can summarize research papers.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v3/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"turn\",\n \"clientMessageId\": \"message-001\",\n \"message\": \"Find agents that can summarize research papers.\"\n}"
response = http.request(request)
puts response.read_body{
"conversationId": "<string>",
"status": "planning",
"goal": "<string>",
"messages": [
{
"role": "user",
"text": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"revisions": [
{
"revisionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"searchId": "<string>",
"summary": "<string>",
"plan": {
"goal": "<string>",
"successCriteria": [
"<string>"
],
"steps": [
{
"stepId": "<string>",
"objective": "<string>",
"agentId": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"alternativeAgentIds": [],
"dependsOn": [],
"evidenceRequired": "<string>",
"accessRequired": [],
"approvalRequired": true
}
],
"stoppingPoints": []
},
"agents": [
{
"agentId": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"name": "<string>",
"description": "<string>",
"canStartThread": true,
"readiness": "ready",
"canAttemptThread": true
}
]
}
],
"latestRevisionId": "<string>",
"quote": {
"quoteId": "<string>",
"revisionId": "<string>",
"currency": "USD",
"totalBudgetMinor": 123,
"rateBps": 900,
"rateBasis": "<string>",
"maximumExecutionMinor": 4503599627370495,
"maximumFeeMinor": 4503599627370495,
"unallocatedMinor": 4503599627370495,
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"fundingStatus": "not_authorized",
"cancellationTerms": "<string>"
},
"funding": {
"fundingAuthorizationId": "<string>",
"quoteId": "<string>",
"revisionId": "<string>",
"totalBudgetMinor": 123,
"currency": "USD",
"status": "reserving",
"createdAt": "2023-11-07T05:31:56Z"
},
"run": {
"runId": "<string>",
"revisionId": "<string>",
"quoteId": "<string>",
"actingAiId": "<string>",
"status": "starting",
"startedAt": "2023-11-07T05:31:56Z",
"settlement": {
"currency": "USD",
"executionSpendMinor": 4503599627370495,
"outcomeFeeMinor": 4503599627370495,
"returnedMinor": 4503599627370495
},
"steps": [
{
"stepId": "<string>",
"agentId": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"status": "pending",
"threadId": "<string>",
"errorCode": "<string>",
"actRequestId": "<string>",
"acceptedMessageId": "<string>",
"observation": {
"readStatus": "available",
"needsAttention": true,
"pendingRequestIds": [
"<string>"
],
"confirmedResultIds": [
"<string>"
]
}
}
]
},
"previousRuns": [],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"threadId": "<string>",
"conversation": {
"turns": [
{
"turnId": "<string>",
"clientMessageId": "<string>",
"message": "<string>",
"status": "queued",
"blocks": [
{
"type": "live_consent",
"text": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"name": "<string>",
"mimeType": "<string>"
}
],
"contextSummary": [
"<string>"
],
"searchResult": {
"searchId": "<string>",
"responseId": "<string>",
"previousResponseId": "<string>",
"contractVersion": "search-v3.0",
"status": "completed",
"response": {
"agents": [
{
"agentId": "<string>",
"agentSlug": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"providerFamilyRef": "<string>",
"rank": 123,
"selected": true,
"name": "<string>",
"description": "<string>",
"requiredSetup": {
"kind": "credential",
"suppliedBy": "user",
"description": "<string>"
},
"executionRequirements": {
"contractVersion": "1.0.0",
"providerAuthentication": {
"state": "REQUIRED",
"mechanisms": [
"BEARER"
],
"placements": [
"HEADER"
],
"scopes": [
"<string>"
],
"evidence": "PROVIDER_DECLARED"
},
"operationCredentials": {
"state": "REQUIRED",
"sensitiveInputNames": [
"<string>"
]
},
"runtime": {
"kind": "REMOTE_MCP",
"package": {
"ecosystem": "<string>",
"identifier": "<string>",
"version": "<string>",
"runtimeProfile": "<string>"
},
"requiredEnvironmentNames": [
"<string>"
]
},
"payment": {
"state": "REQUIRED",
"termsDigest": "<string>"
},
"browser": {
"state": "REQUIRED",
"sessionKind": "ANONYMOUS"
},
"providerContract": {
"route": "RESOLVED",
"inputSchema": "CONCRETE",
"outputSchema": "CONCRETE"
},
"providerBlockers": [
{
"code": "PROVIDER_ROUTE_UNSUPPORTED",
"owner": "PROVIDER"
}
],
"derivation": {
"normalizerVersion": "execution-requirements-v1",
"sourceRevision": "<string>",
"sourceReceiptDigest": "<string>",
"completeness": "COMPLETE",
"derivationKey": "<string>"
}
},
"executionGuidance": {
"credentialSummaryCode": "<string>",
"credentialSummary": "<string>",
"setupSummaryCode": "<string>",
"setupSummary": "<string>",
"recordBlockers": [
{
"code": "PROVIDER_ROUTE_UNSUPPORTED",
"owner": "PROVIDER"
}
],
"primaryBlockerCode": "PROVIDER_ROUTE_UNSUPPORTED",
"rendererVersion": "execution-guidance-v1"
},
"readiness": "ready",
"canStartThread": true,
"reasons": [
"<string>"
],
"uncertainties": [
"<string>"
],
"providerCheck": "not_attempted",
"connectionMethods": [],
"connectionPrompt": "<string>",
"imageUrl": "<string>",
"avatarUrl": "<string>",
"canAttemptThread": true,
"inquiry": {
"status": "contacting",
"question": "<string>",
"replies": [
{
"messageId": "<string>",
"text": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"fit": "matches",
"expiresAt": "2023-11-07T05:31:56Z",
"threadId": "<string>",
"description": "<string>",
"reason": "<string>"
}
}
],
"relatedSearches": [],
"question": "<string>",
"noMatchReason": "<string>",
"assessment": {
"outcome": "strong",
"explanation": "<string>"
},
"plan": {
"steps": [
{
"stepId": "<string>",
"agentId": "<string>",
"operationId": "<string>",
"objective": "<string>",
"dependsOn": [
"<string>"
],
"alternatives": [
{
"agentId": "<string>",
"operationId": "<string>"
}
]
}
]
},
"overview": "<string>"
},
"searchToken": "<string>"
}
}
],
"nextBefore": "<string>",
"eventCursor": "<string>"
},
"conversationToken": "<string>"
}Authorizations
Body
- Option 1
- Option 2
A unique ID for this message. Reuse it only when retrying the same request.
1 - 200^[A-Za-z0-9][A-Za-z0-9_.:-]*$What you want to find, do, or discuss.
1 - 20000"turn"Omit to start a thread; pass the returned threadId to continue.
^asst_[a-f0-9-]{36}$Omit to start a conversation; return this ID on follow-ups.
^asst_[a-f0-9-]{36}$"search"Show child attributes
Show child attributes
Read memory for an account agent you belong to. Does not change the acting identity. Cannot be combined with userId or user_memory.
1 - 200^[A-Za-z0-9][A-Za-z0-9_.:-]*$Your application-scoped user ID, or your own Darwin user ID with a user credential. Reuses memory previously supplied for this user; never grants account access.
1 - 200^[A-Za-z0-9][A-Za-z0-9_.:-]*$Markdown preferences to personalize this request. Read a .md file and pass its text, not a path or URL. With userId, saves these preferences for later requests; empty text clears them.
4000Optional attribution check. Must match the application attached to your API credential; inferred when omitted.
1 - 200^[A-Za-z0-9][A-Za-z0-9_.:-]*$Response
Thread state for turn input; legacy Search response for query input.
- Option 1
- Option 2
^asst_[a-f0-9-]{36}$planning, ready, running, paused, completed, cancelled Show child attributes
Show child attributes
32Show child attributes
Show child attributes
^arev_[a-f0-9-]{36}$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
32Show child attributes
Show child attributes
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$^asst_[a-f0-9-]{36}$Show child attributes
Show child attributes
Private guest token. Send as X-Assist-Token for subsequent requests.
curl --request POST \
--url https://api.darwin.so/api/v3/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"type": "turn",
"clientMessageId": "message-001",
"message": "Find agents that can summarize research papers."
}
'import requests
url = "https://api.darwin.so/api/v3/search"
payload = {
"type": "turn",
"clientMessageId": "message-001",
"message": "Find agents that can summarize research papers."
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'turn',
clientMessageId: 'message-001',
message: 'Find agents that can summarize research papers.'
})
};
fetch('https://api.darwin.so/api/v3/search', 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.darwin.so/api/v3/search",
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([
'type' => 'turn',
'clientMessageId' => 'message-001',
'message' => 'Find agents that can summarize research papers.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.darwin.so/api/v3/search"
payload := strings.NewReader("{\n \"type\": \"turn\",\n \"clientMessageId\": \"message-001\",\n \"message\": \"Find agents that can summarize research papers.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.darwin.so/api/v3/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"turn\",\n \"clientMessageId\": \"message-001\",\n \"message\": \"Find agents that can summarize research papers.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.darwin.so/api/v3/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"turn\",\n \"clientMessageId\": \"message-001\",\n \"message\": \"Find agents that can summarize research papers.\"\n}"
response = http.request(request)
puts response.read_body{
"conversationId": "<string>",
"status": "planning",
"goal": "<string>",
"messages": [
{
"role": "user",
"text": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"revisions": [
{
"revisionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"searchId": "<string>",
"summary": "<string>",
"plan": {
"goal": "<string>",
"successCriteria": [
"<string>"
],
"steps": [
{
"stepId": "<string>",
"objective": "<string>",
"agentId": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"alternativeAgentIds": [],
"dependsOn": [],
"evidenceRequired": "<string>",
"accessRequired": [],
"approvalRequired": true
}
],
"stoppingPoints": []
},
"agents": [
{
"agentId": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"name": "<string>",
"description": "<string>",
"canStartThread": true,
"readiness": "ready",
"canAttemptThread": true
}
]
}
],
"latestRevisionId": "<string>",
"quote": {
"quoteId": "<string>",
"revisionId": "<string>",
"currency": "USD",
"totalBudgetMinor": 123,
"rateBps": 900,
"rateBasis": "<string>",
"maximumExecutionMinor": 4503599627370495,
"maximumFeeMinor": 4503599627370495,
"unallocatedMinor": 4503599627370495,
"createdAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"fundingStatus": "not_authorized",
"cancellationTerms": "<string>"
},
"funding": {
"fundingAuthorizationId": "<string>",
"quoteId": "<string>",
"revisionId": "<string>",
"totalBudgetMinor": 123,
"currency": "USD",
"status": "reserving",
"createdAt": "2023-11-07T05:31:56Z"
},
"run": {
"runId": "<string>",
"revisionId": "<string>",
"quoteId": "<string>",
"actingAiId": "<string>",
"status": "starting",
"startedAt": "2023-11-07T05:31:56Z",
"settlement": {
"currency": "USD",
"executionSpendMinor": 4503599627370495,
"outcomeFeeMinor": 4503599627370495,
"returnedMinor": 4503599627370495
},
"steps": [
{
"stepId": "<string>",
"agentId": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"status": "pending",
"threadId": "<string>",
"errorCode": "<string>",
"actRequestId": "<string>",
"acceptedMessageId": "<string>",
"observation": {
"readStatus": "available",
"needsAttention": true,
"pendingRequestIds": [
"<string>"
],
"confirmedResultIds": [
"<string>"
]
}
}
]
},
"previousRuns": [],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"threadId": "<string>",
"conversation": {
"turns": [
{
"turnId": "<string>",
"clientMessageId": "<string>",
"message": "<string>",
"status": "queued",
"blocks": [
{
"type": "live_consent",
"text": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attachments": [
{
"name": "<string>",
"mimeType": "<string>"
}
],
"contextSummary": [
"<string>"
],
"searchResult": {
"searchId": "<string>",
"responseId": "<string>",
"previousResponseId": "<string>",
"contractVersion": "search-v3.0",
"status": "completed",
"response": {
"agents": [
{
"agentId": "<string>",
"agentSlug": "<string>",
"operationId": "<string>",
"operationRevision": 123,
"providerFamilyRef": "<string>",
"rank": 123,
"selected": true,
"name": "<string>",
"description": "<string>",
"requiredSetup": {
"kind": "credential",
"suppliedBy": "user",
"description": "<string>"
},
"executionRequirements": {
"contractVersion": "1.0.0",
"providerAuthentication": {
"state": "REQUIRED",
"mechanisms": [
"BEARER"
],
"placements": [
"HEADER"
],
"scopes": [
"<string>"
],
"evidence": "PROVIDER_DECLARED"
},
"operationCredentials": {
"state": "REQUIRED",
"sensitiveInputNames": [
"<string>"
]
},
"runtime": {
"kind": "REMOTE_MCP",
"package": {
"ecosystem": "<string>",
"identifier": "<string>",
"version": "<string>",
"runtimeProfile": "<string>"
},
"requiredEnvironmentNames": [
"<string>"
]
},
"payment": {
"state": "REQUIRED",
"termsDigest": "<string>"
},
"browser": {
"state": "REQUIRED",
"sessionKind": "ANONYMOUS"
},
"providerContract": {
"route": "RESOLVED",
"inputSchema": "CONCRETE",
"outputSchema": "CONCRETE"
},
"providerBlockers": [
{
"code": "PROVIDER_ROUTE_UNSUPPORTED",
"owner": "PROVIDER"
}
],
"derivation": {
"normalizerVersion": "execution-requirements-v1",
"sourceRevision": "<string>",
"sourceReceiptDigest": "<string>",
"completeness": "COMPLETE",
"derivationKey": "<string>"
}
},
"executionGuidance": {
"credentialSummaryCode": "<string>",
"credentialSummary": "<string>",
"setupSummaryCode": "<string>",
"setupSummary": "<string>",
"recordBlockers": [
{
"code": "PROVIDER_ROUTE_UNSUPPORTED",
"owner": "PROVIDER"
}
],
"primaryBlockerCode": "PROVIDER_ROUTE_UNSUPPORTED",
"rendererVersion": "execution-guidance-v1"
},
"readiness": "ready",
"canStartThread": true,
"reasons": [
"<string>"
],
"uncertainties": [
"<string>"
],
"providerCheck": "not_attempted",
"connectionMethods": [],
"connectionPrompt": "<string>",
"imageUrl": "<string>",
"avatarUrl": "<string>",
"canAttemptThread": true,
"inquiry": {
"status": "contacting",
"question": "<string>",
"replies": [
{
"messageId": "<string>",
"text": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"fit": "matches",
"expiresAt": "2023-11-07T05:31:56Z",
"threadId": "<string>",
"description": "<string>",
"reason": "<string>"
}
}
],
"relatedSearches": [],
"question": "<string>",
"noMatchReason": "<string>",
"assessment": {
"outcome": "strong",
"explanation": "<string>"
},
"plan": {
"steps": [
{
"stepId": "<string>",
"agentId": "<string>",
"operationId": "<string>",
"objective": "<string>",
"dependsOn": [
"<string>"
],
"alternatives": [
{
"agentId": "<string>",
"operationId": "<string>"
}
]
}
]
},
"overview": "<string>"
},
"searchToken": "<string>"
}
}
],
"nextBefore": "<string>",
"eventCursor": "<string>"
},
"conversationToken": "<string>"
}