Skip to main content
POST
/
private-api
/
v1
/
{workspace_id}
/
agents
/
search
Search Agents
curl --request POST \
  --url https://api.nonce.app/private-api/v1/{workspace_id}/agents/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "farm_id": {
    "in": [
      "online",
      "offline"
    ]
  },
  "status": {
    "in": [
      "online",
      "offline"
    ]
  },
  "page": 4503599627370496,
  "limit": 5000
}
'
import requests

url = "https://api.nonce.app/private-api/v1/{workspace_id}/agents/search"

payload = {
"farm_id": { "in": ["online", "offline"] },
"status": { "in": ["online", "offline"] },
"page": 4503599627370496,
"limit": 5000
}
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({
farm_id: {in: ['online', 'offline']},
status: {in: ['online', 'offline']},
page: 4503599627370496,
limit: 5000
})
};

fetch('https://api.nonce.app/private-api/v1/{workspace_id}/agents/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.nonce.app/private-api/v1/{workspace_id}/agents/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([
'farm_id' => [
'in' => [
'online',
'offline'
]
],
'status' => [
'in' => [
'online',
'offline'
]
],
'page' => 4503599627370496,
'limit' => 5000
]),
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.nonce.app/private-api/v1/{workspace_id}/agents/search"

payload := strings.NewReader("{\n \"farm_id\": {\n \"in\": [\n \"online\",\n \"offline\"\n ]\n },\n \"status\": {\n \"in\": [\n \"online\",\n \"offline\"\n ]\n },\n \"page\": 4503599627370496,\n \"limit\": 5000\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.nonce.app/private-api/v1/{workspace_id}/agents/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"farm_id\": {\n \"in\": [\n \"online\",\n \"offline\"\n ]\n },\n \"status\": {\n \"in\": [\n \"online\",\n \"offline\"\n ]\n },\n \"page\": 4503599627370496,\n \"limit\": 5000\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.nonce.app/private-api/v1/{workspace_id}/agents/search")

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 \"farm_id\": {\n \"in\": [\n \"online\",\n \"offline\"\n ]\n },\n \"status\": {\n \"in\": [\n \"online\",\n \"offline\"\n ]\n },\n \"page\": 4503599627370496,\n \"limit\": 5000\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": [
    {
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "farm_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "farm": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "name": "Farm Name"
      },
      "workspace_id": "org_xxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "status": "online/offline",
      "last_updated_at": "2025-08-27T00:00:00Z",
      "last_online_at": "<string>",
      "version": "v0.4.9-1-fdb7d5f",
      "uptime": 6235631,
      "host": {
        "platform": "Darwin",
        "os": "macOS-15.6-arm64-arm-64bit",
        "cpu_count": 12,
        "uptime": 6235631,
        "timestamp": 1761292878,
        "load_average": [
          2.0478515625,
          2.177734375,
          2.046875
        ],
        "memory": {
          "total": 34359738368,
          "free": 64126976,
          "used": 14793719808,
          "swap_total": 2147483648,
          "swap_free": 1095696384,
          "swap_used": 1051787264
        },
        "ip": "192.168.9.109",
        "hostname": "localhost"
      }
    }
  ],
  "pagination": {
    "total": 50,
    "limit": 10,
    "offset": 0,
    "hasNext": true,
    "hasPrevious": false
  },
  "error": null
}
{
"statusCode": 400,
"message": "Invalid request parameters",
"error": "Bad Request"
}
{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}
{
"statusCode": 403,
"message": "Access denied to workspace",
"error": "Forbidden"
}

Authorizations

Authorization
string
header
required

Clerk Machine API Key for authentication

Path Parameters

workspace_id
string
required

Body

application/json
farm_id
object

Enum or ID filter operators. Provide at least one operator.

Example:
{ "in": ["online", "offline"] }
status
object

Enum or ID filter operators. Provide at least one operator.

Example:
{ "in": ["online", "offline"] }
page
integer
Required range: 1 <= x <= 9007199254740991
limit
integer
Required range: 1 <= x <= 10000

Response

Successfully retrieved agents

success
boolean
required

Indicates if the request was successful

Example:

true

data
Agent · object[]
required

Array of items

pagination
object
required

Pagination metadata

error
null
required

Error object (null on success)

Example:

null