# getGoalPlan

Your goals for the month containing periodStartDate (YYYY-MM-DD): draftPlan (being edited) and activePlan (published), either null. Commission goals are targetCents per pipeline (null pipelineId = all pipelines); metric EARNED counts won deals, TOTAL adds pending ones. Personal goals are free text. Your own plan; a teammate’s is the *Teammate* op (ADMIN).

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "getGoalPlan", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `periodStartDate`: `Date!` (required)

## Response (data, an example)

```json
{
  "agentGoalsQuery": {
    "getAgentGoalPlan": {
      "draftPlan": {
        "id": "<ID>",
        "userId": "<ID>",
        "periodStartDate": "…",
        "periodEndDate": "…",
        "status": "DRAFT",
        "publishedAt": "2026-01-01T00:00:00.000Z",
        "commissionGoals": [
          {
            "id": "<ID>",
            "pipelineId": "<ID>",
            "pipelineName": "…",
            "metric": "EARNED",
            "targetCents": "…"
          }
        ],
        "personalGoals": [
          {
            "id": "<ID>",
            "title": "…",
            "description": "…",
            "status": "ACTIVE",
            "displayOrder": 0
          }
        ]
      },
      "activePlan": {
        "id": "<ID>",
        "userId": "<ID>",
        "periodStartDate": "…",
        "periodEndDate": "…",
        "status": "DRAFT",
        "publishedAt": "2026-01-01T00:00:00.000Z",
        "commissionGoals": [
          {
            "id": "<ID>",
            "pipelineId": "<ID>",
            "pipelineName": "…",
            "metric": "EARNED",
            "targetCents": "…"
          }
        ],
        "personalGoals": [
          {
            "id": "<ID>",
            "title": "…",
            "description": "…",
            "status": "ACTIVE",
            "displayOrder": 0
          }
        ]
      }
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "getGoalPlan",
    "variables": {
      "periodStartDate": "2026-01-01"
    }
  }'
```
