# focus_sets

Source: https://developers.newjune.co/api-reference/focus-sets

> The plans you were focusing on for a period of time.

The plans you were focusing on for a period of time.

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

A focus set is the lineup of plans in use for a period: one primary plan and up to two secondary plans.

## Endpoints

- `GET /v1/focus_sets`: List focus sets
- `GET /v1/focus_sets/current`: Get the current focus set
- `GET /v1/focus_sets/{id}`: Get a focus set

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 focus set object

| Field | Type | Description |
| --- | --- | --- |
| `object` | string | Always "focus_set". |
| `id` | string | Unique id of the focus set. |
| `primary_plan_id` | string or null | The main plan to work on. Null when none was chosen. |
| `secondary_plan_ids` | array of strings | Other plans in the set, in order. Empty when there are none. |
| `source_report_id` | string or null | The report the focus set came from, when any. |
| `effective_from` | string (timestamp) | When the focus set started. |
| `effective_until` | string (timestamp) or null | When it was replaced. Null for the current set. |
| `is_current` | boolean | True for the focus set in use now. |
| `created_at` | string (timestamp) | When the focus set was created. |

Example focus set:

```json
{
  "object": "focus_set",
  "id": "bc389c05-89d8-4afb-bd9d-f3979b56236e",
  "primary_plan_id": "245f4a1a-cbd7-4444-9d09-4752871cfeb6",
  "secondary_plan_ids": [
    "f7a9731f-f737-4e63-affb-db411b42bc0a"
  ],
  "source_report_id": "03d09dc8-617f-45e0-92fd-a76822838da0",
  "effective_from": "2026-05-17T21:14:40.000Z",
  "effective_until": null,
  "is_current": true,
  "created_at": "2026-05-17T21:14:40.000Z"
}
```

### List focus sets

`GET /v1/focus_sets`

Your focus sets, newest first: ordered by effective_from descending, then id descending. Needs a key with the plans:read scope.

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

#### 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. |

#### Example request

curl:

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

TypeScript:

```ts
const response = await fetch('https://data.newjune.co/v1/focus_sets', {
  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/focus_sets",
    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 the current focus set

`GET /v1/focus_sets/current`

The focus set in use now. Returns 404 with code no_current_focus_set when there is none. Needs a key with the plans:read scope.

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

#### Example request

curl:

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

TypeScript:

```ts
const response = await fetch('https://data.newjune.co/v1/focus_sets/current', {
  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/focus_sets/current",
    headers={"Authorization": f"Bearer {os.environ['NEW_JUNE_API_KEY']}"},
    timeout=30,
)
print(response.json())
```

#### Responses

- `200`: The current focus set.
- `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`: There is no current focus set 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.

### Get a focus set

`GET /v1/focus_sets/{id}`

One focus set by id. Needs a key with the plans:read scope.

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

#### Path parameters

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

#### Example request

curl:

```bash
curl "https://data.newjune.co/v1/focus_sets/bc389c05-89d8-4afb-bd9d-f3979b56236e" \
  -H "Authorization: Bearer $NEW_JUNE_API_KEY"
```

TypeScript:

```ts
const response = await fetch('https://data.newjune.co/v1/focus_sets/bc389c05-89d8-4afb-bd9d-f3979b56236e', {
  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/focus_sets/bc389c05-89d8-4afb-bd9d-f3979b56236e",
    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.
