# Read an agent's goal

Source: https://docs.vlayers.ai/reference/agents/get-agent-goal

`GET /v1/agents/{id}/goal` · scope `workspace:read`

The one thing the agent is for, as a sentence, and how it is decided: `outcome` when the flow records a named outcome, `judge` when a model reads the conversation, `outcome_or_judge` when both can. `knownOutcomes` lists the outcomes the published version declares, `quote` the price of scoring it. `goal` is `null` until one is set.

Requires an API key with the `workspace:read` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | The agent id. Example: `"0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78"` |

## Request

cURL:

```bash
curl "https://api.vlayers.ai/v1/agents/$AGENT_ID/goal" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY"
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { goal } = await voicelayer.agents.getGoal('<agent-id>');
console.log(goal);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.agents.get_goal("<agent-id>")
print(result.goal)
```

## Response `200`

```json
{
  "goal": {
    "agentId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",
    "evaluationId": "0192f5f7-b0cf-7a1d-9c6d-7e8f90123456",
    "goal": "The caller books a table",
    "outcomeNames": [
      "booked"
    ],
    "sampleRate": 1,
    "judgedBy": "outcome_or_judge",
    "knownOutcomes": [
      {
        "name": "booked",
        "description": "A table was booked"
      }
    ],
    "quote": {
      "maxUsd": 0.0123,
      "typicalUsd": 0.0031,
      "maxScoresPerConversation": 3,
      "sampleRate": 1,
      "outcomeIsFree": true
    },
    "enabled": true
  }
}
```
