# Search automation definitions (/en/docs/api/native/automation/searchTargets)





Search visible targets and page in ascending name order. Archived targets are excluded by default; optionally select published scripts and workflows.

`GET /automation/v1/targets`

## Authentication [#authentication]

`Authorization: Bearer $PRAXIS_API_KEY`

## Request fields [#request-fields]

| Parameter | Type | Description |
| --- | --- | --- |
| query: q | `string` | optional; Case-insensitive literal substring of ns/name or description. |
| query: kind | `"action"` / `"script"` / `"workflow"[]` | optional; action, script or workflow; omit for all. Separate multiple values with commas to match any value. minItems: 1 |
| query: limit | `integer` | optional; Page size: integer 1–100, default 25. minimum: 1; maximum: 100 |
| query: labels | `object` | optional; Filter using labels[k]=v; comma-separated values for one key match any, and different keys match together. |
| query: created_at[gte] | `string` | optional; Inclusive creation-time lower bound, as an ISO 8601 timestamp with timezone. format: "date-time" |
| query: created_at[lte] | `string` | optional; Inclusive creation-time upper bound, as an ISO 8601 timestamp with timezone. format: "date-time" |
| query: cursor | `string` | optional; Use next_cursor from the previous page and keep the same filters. |
| query: archived | `boolean` | optional; Defaults to false for active targets; true selects archived targets only. default: false |
| query: published | `boolean` | optional; When true, select definitions with at least one published version; actions are always available. |

## Examples [#examples]

[SDK installation and example environment](/en/docs/api/native/automation)

```bash
curl --fail-with-body -X GET "https://api.deepraxis.ai/automation/v1/targets" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  --get \
  --data-urlencode "q=sample-" \
  --data-urlencode "limit=1"
```

```typescript
import { createAutomationClient } from '@deepraxis/sdk/automation';

function env(name: string): string {
  const value = process.env[name];
  if (!value) throw new Error(`Set ${name}`);
  return value;
}
const automation = createAutomationClient({
  apiKey: env('PRAXIS_API_KEY'),
  baseUrl: 'https://api.deepraxis.ai',
  maxRetries: 0,
  timeoutMs: 90_000,
});
const result = await automation.targets.list({
  "query": {
    "q": "sample-",
    "limit": 1
  }
});
console.log(result);
```

## Response [#response]

### HTTP 200 [#http-200]

Success

`application/json`

| Field | Type | Description |
| --- | --- | --- |
| data | `object[]` | required; Target hits across actions, scripts and workflows on this page, in search order. |
| data[].kind | `"action"` / `"script"` / `"workflow"` | required; Target kind. action is an action; script is a script; workflow is a workflow. |
| data[].namespace | `string` | required; Namespace of the target. |
| data[].name | `string` | required; Name of the target. |
| data[].description | `string` | required; Description of the target. |
| data[].latest_version | `null` / `string` | required; Version the latest tag points to; null for actions or when nothing is published. |
| data[].archived | `boolean` | required; true when the target is archived and can no longer be run. |
| next_cursor | `string` / `null` | required; Cursor for the next page: pass it unchanged as cursor with the same filters; null when there are no more pages. No total is returned. |

### Measured response [#measured-response]

HTTP 200

```json
{
  "data": [
    {
      "kind": "action",
      "namespace": "docs-samples",
      "name": "sample-action-1791867412840-b05e8a",
      "description": "",
      "latest_version": null,
      "archived": false
    }
  ],
  "next_cursor": "WyJbXCJ0YXJnZXRzXCIsXCJ0bnRfM2E5NzU5ODY0Y2NiNGUwMFwiLHtcInFcIjpcInNhbXBsZS1cIn1dIiwiZG9jcy1zYW1wbGVzL3NhbXBsZS1hY3Rpb24tMTc5MTg2NzQxMjg0MC1iMDVlOGEiLCJmdW5jdGlvbjphY3RfMDBtdjY3bG96NGZlNGYyN2JkZjg5MzQ2Yzg4NWIzYTI4YjIwMzhjMDkxIl0="
}
```

## Errors [#errors]

| HTTP | Codes and description |
| --- | --- |
| 400 | INVALID_PARAMS: Invalid request parameters, path, cursor, or body format. |
| default | RFC 9457 automation problem. 429 includes Retry-After. |

[Authentication and common errors](/en/docs/api/errors) · Retain the `X-Request-Id` response header for troubleshooting.
