Run saved query

Runs a saved query and returns its rows.

GET https://cotlet.dev/api/v1/peoplehr/queries/run

read

Returns the columns of the query and its rows as PeopleHR shows them, the same data the Export to CSV button gives. Dates keep the format PeopleHR uses in the result. It reads only and changes nothing.

Parameters

Parameters: run_query
NameTypeDescription
name string required string Exact name from list_queries.
cursor string string Next page cursor from the previous call.

Request

cURL
curl "https://cotlet.dev/api/v1/peoplehr/queries/run?name=Jane+Doe" \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("peoplehr", "run_query", {"name":"Jane Doe"})
Node.js
const result = await cotlet.call('peoplehr', 'run_query', {"name":"Jane Doe"});
CLI
cotlet call peoplehr run_query --data '{"name":"Jane Doe"}'

Example response

JSON

{
  "name": "Probation ending soon",
  "columns": [
    "Employee",
    "Probation End Date",
    "Probation Status"
  ],
  "rows": [
    [
      "Ana Lopez",
      "2027-02-16",
      "In probation"
    ],
    [
      "Jake Ortiz",
      "2026-12-04",
      "In probation"
    ]
  ],
  "next_cursor": null
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.