# Resolve a run target (/en/docs/api/native/automation/resolveTarget)





Resolve ns/name@tag, an exact version or a version range to a runnable exact version. Omitting @ selects latest; archived targets are rejected and no match returns NO_MATCHING_VERSION.

`GET /automation/v1/resolve`

## Authentication [#authentication]

`Authorization: Bearer $PRAXIS_API_KEY`

## Request fields [#request-fields]

| Parameter | Type | Description |
| --- | --- | --- |
| query: target | `string` | required; ns/name@tag, ns/name@version or ns/name@range; omitting @ selects latest. |

## Examples [#examples]

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

Set these environment variables to your own resources:

| Variable | Source |
| --- | --- |
| TARGET | [Published docs-samples/name@1.0.0](/en/docs/api/native/automation/publishScriptVersion) |

```bash
: "${TARGET:?Set TARGET}"
curl --fail-with-body -X GET "https://api.deepraxis.ai/automation/v1/resolve" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  --get \
  --data-urlencode "target=${TARGET}"
```

```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.resolve.retrieve({
  "query": {
    "target": env("TARGET")
  }
});
console.log(result);
```

## Response [#response]

### HTTP 200 [#http-200]

Success

`application/json`

| Field | Type | Description |
| --- | --- | --- |
| kind | `"script"` / `"workflow"` | required; Orchestration kind. script is a TypeScript script that executes once; workflow is a YAML workflow made of steps that can wait for events, timers or child runs and can be suspended. |
| namespace | `string` | required; Namespace of the resolved script or workflow. |
| name | `string` | required; Name of the resolved script or workflow. |
| version | `string` | required; Exact version number the target resolved to. |
| version_id | `string` | required; Id of that version (scv_ or wfv_ prefix). |
| deprecated | `null` / `string` | required; Deprecation message when the resolved version is deprecated; null otherwise. |

### Measured response [#measured-response]

HTTP 200

```json
{
  "kind": "script",
  "namespace": "docs-samples",
  "name": "sample-scripts-1791867412840-b05e8a",
  "version": "1.0.0",
  "version_id": "scv_00mv67lza679fc5498438040079f0c5684208c4915",
  "deprecated": null
}
```

## Errors [#errors]

| HTTP | Codes and description |
| --- | --- |
| 400 | INVALID_PARAMS: Invalid request parameters, path, cursor, or body format. |
| 404 | TARGET_NOT_FOUND: The target does not exist or has an incompatible type. |
| 409 | TARGET_ARCHIVED: The target is archived and cannot be used for this operation; action execution error detail includes ns/name. |
| 422 | NO_MATCHING_VERSION: No published version matches the requested tag, version, or range. |
| 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.
