# plans

Source: https://developers.newjune.co/api-reference/plans

> A practice plan for one of your priorities.

A practice plan for one of your priorities.

Scope: `plans:read`. Base URL: `https://data.newjune.co`.

A plan works on one priority. Its steps are practice milestones; only its criterion decides when the plan graduates.

## Endpoints

- `GET /v1/plans`: List plans
- `GET /v1/plans/{id}`: Get a plan

Responses carry `Request-Id`, `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`, and a `429` adds `Retry-After`. See [Headers](https://developers.newjune.co/conventions#headers).

## The plan object

| Field | Type | Description |
| --- | --- | --- |
| `object` | string | Always "plan". |
| `id` | string | Unique id of the plan. |
| `priority_id` | string | The priority this plan works on. |
| `status` | string | Candidate (proposed), active (being worked on), graduated (done), or cancelled. One of: `candidate`, `active`, `graduated`, `cancelled`. |
| `criterion` | object or null | How the plan is judged complete. Null while the plan is still being drafted. |
| `criterion.rubric` | string or null | What finishing the plan looks like. |
| `criterion.measurable_signal` | string or null | What is measured from your rounds. |
| `criterion.threshold` | string or null | The level that counts as done. |
| `steps` | array of objects | Steps in order. Archived steps are not included. |
| `steps[].id` | string | Unique id of the step. |
| `steps[].title` | string | What to do. |
| `steps[].description` | string or null | More detail about the step. |
| `steps[].status` | string | Open until you mark it done. One of: `open`, `done`. |
| `steps[].position` | integer | Order within the plan, ascending. |
| `steps[].completed_at` | string (timestamp) or null | When the step was marked done. Null while open. |
| `created_from_report_id` | string or null | The report the plan came from, when any. |
| `graduated_at` | string (timestamp) or null | When the plan was completed. Null otherwise. |
| `cancelled_at` | string (timestamp) or null | When the plan was cancelled. Null otherwise. |
| `cancel_reason` | string or null | Why the plan was cancelled, when it was. |
| `created_at` | string (timestamp) | When the plan was created. |
| `updated_at` | string (timestamp) | When the plan itself was last changed. Marking a step done or open does not change it, so compare steps to catch step progress. |

Example plan:

```json
{
  "object": "plan",
  "id": "245f4a1a-cbd7-4444-9d09-4752871cfeb6",
  "priority_id": "ecbf0900-77cd-472a-b692-76faa0b4f462",
  "status": "active",
  "criterion": {
    "rubric": "Two-putt or better from outside 30 feet on most holes.",
    "measurable_signal": "Three-putts per round from outside 30 feet.",
    "threshold": "One or fewer in two straight rounds."
  },
  "steps": [
    {
      "id": "fb2f2182-69fd-432a-8625-feff4a555c7f",
      "title": "Ladder drill, 20 balls",
      "description": "Putt to 20, 30, and 40 feet, stopping each ball past the hole.",
      "status": "done",
      "position": 1,
      "completed_at": "2026-05-24T16:20:05.000Z"
    },
    {
      "id": "2f9ad778-7c24-431d-85e9-5b2e60343d86",
      "title": "Lag to a tee from 40 feet",
      "description": "Ten putts from 40 feet; count how many finish inside three feet.",
      "status": "done",
      "position": 2,
      "completed_at": "2026-06-02T17:45:10.000Z"
    },
    {
      "id": "345f8094-b1a6-4232-af1d-cfe8077c059b",
      "title": "Play nine holes counting three-putts",
      "description": "On the course, note the length of every first putt and every three-putt.",
      "status": "open",
      "position": 3,
      "completed_at": null
    }
  ],
  "created_from_report_id": "03d09dc8-617f-45e0-92fd-a76822838da0",
  "graduated_at": null,
  "cancelled_at": null,
  "cancel_reason": null,
  "created_at": "2026-05-17T21:12:03.000Z",
  "updated_at": "2026-05-17T21:14:40.000Z"
}
```

### List plans

`GET /v1/plans`

Your practice plans with their steps, newest first: ordered by created_at descending, then id descending. Needs a key with the plans:read scope.

Scope: `plans:read`. Operation id: `listPlans`.

#### Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | no | How many items to return, 1 to 100. Defaults to 25. |
| `cursor` | string | no | The next_cursor value from the previous page, passed back unchanged with the same filters. |
| `status` | string | no | Only plans with this status. One of: `candidate`, `active`, `graduated`, `cancelled`. |
| `priority_id` | string | no | Only plans for this priority. |
| `updated_after` | string (timestamp) | no | Only plans whose own updated_at is strictly after this time (ISO 8601, with Z or an offset). Use it to sync changes since your last run; the list order does not change. Marking a step done or open does not change it, so compare steps to catch step progress. |

#### Example request

curl:

```bash
curl "https://data.newjune.co/v1/plans" \
  -H "Authorization: Bearer $NEW_JUNE_API_KEY"
```

TypeScript:

```ts
const response = await fetch('https://data.newjune.co/v1/plans', {
  headers: { Authorization: `Bearer ${process.env.NEW_JUNE_API_KEY}` },
});
const body = await response.json();
console.log(body);
```

Python:

```python
import os
import requests

response = requests.get(
    "https://data.newjune.co/v1/plans",
    headers={"Authorization": f"Bearer {os.environ['NEW_JUNE_API_KEY']}"},
    timeout=30,
)
print(response.json())
```

#### Responses

- `200`: A page of results.
- `400`: A query parameter is unknown, missing, or has an invalid value.
- `401`: The API key is missing, not valid, revoked, or expired.
- `403`: The key lacks the scope this endpoint needs, or the account is suspended.
- `429`: Too many requests. See the RateLimit and Retry-After headers.
- `500`: Something went wrong on our side.
- `503`: The API is temporarily unavailable.

### Get a plan

`GET /v1/plans/{id}`

One plan by id, with its steps. Needs a key with the plans:read scope.

Scope: `plans:read`. Operation id: `getPlan`.

#### Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The plan's id. |

#### Example request

curl:

```bash
curl "https://data.newjune.co/v1/plans/245f4a1a-cbd7-4444-9d09-4752871cfeb6" \
  -H "Authorization: Bearer $NEW_JUNE_API_KEY"
```

TypeScript:

```ts
const response = await fetch('https://data.newjune.co/v1/plans/245f4a1a-cbd7-4444-9d09-4752871cfeb6', {
  headers: { Authorization: `Bearer ${process.env.NEW_JUNE_API_KEY}` },
});
const body = await response.json();
console.log(body);
```

Python:

```python
import os
import requests

response = requests.get(
    "https://data.newjune.co/v1/plans/245f4a1a-cbd7-4444-9d09-4752871cfeb6",
    headers={"Authorization": f"Bearer {os.environ['NEW_JUNE_API_KEY']}"},
    timeout=30,
)
print(response.json())
```

#### Responses

- `200`: The item.
- `401`: The API key is missing, not valid, revoked, or expired.
- `403`: The key lacks the scope this endpoint needs, or the account is suspended.
- `404`: No such resource for this account.
- `429`: Too many requests. See the RateLimit and Retry-After headers.
- `500`: Something went wrong on our side.
- `503`: The API is temporarily unavailable.
