# List tasks scheduled within a date range

`GET /api/project/{projectId}/task/upcoming`

URL: https://repsona.com/api/get-project-projectid-task-upcoming

## Parameters

| name | in | type | required | description |
| --- | --- | --- | --- | --- |
| `projectId` | path | "@all" \| integer | required | A project ID, or `@all` for every open project you belong to. |
| `start` | query | integer | required | Start of the range, in epoch milliseconds. Tasks whose due date is on or after this time are returned. |
| `end` | query | integer | required | End of the range, in epoch milliseconds. Tasks whose start date is on or before this time are returned. |
| `page` | query | integer |  | Page number, starting at 1. Each page has up to 30 tasks. |

## Request

```sh
curl -X GET "https://<space>.repsona.com/api/project/{projectId}/task/upcoming" \
  -H "Authorization: Bearer $REPSONA_API_KEY"
```

## Responses

- 200: Tasks whose start/due range overlaps the given range
- 400: Invalid range
- 401: Authentication is required
- 403: Not a project member
- 404: Project not found

## Example response

```json
{
  "tasks": [
    {
      "id": 100388,
      "name": "Design the new top page",
      "projectName": "Website renewal",
      "project": {
        "id": 253,
        "name": "WEB",
        "avatarUrl": ""
      },
      "ancestorNames": [],
      "status": {
        "id": 166,
        "name": "To do",
        "color": "#64748b",
        "isClosed": false
      },
      "owner": {
        "id": 988,
        "name": "reon.walls",
        "fullName": "Reon Walls",
        "avatarUrl": null,
        "color": null
      },
      "tags": [
        {
          "id": 75,
          "name": "Design",
          "color": "#3b82f6"
        }
      ],
      "dueDate": 1794009600000,
      "priority": null
    },
    {
      "id": 100390,
      "name": "Fix broken links on the pricing page",
      "projectName": "Website renewal",
      "project": {
        "id": 253,
        "name": "WEB",
        "avatarUrl": ""
      },
      "ancestorNames": [],
      "status": {
        "id": 172,
        "name": "In review",
        "color": "#f59e0b",
        "isClosed": false
      },
      "owner": {
        "id": 988,
        "name": "reon.walls",
        "fullName": "Reon Walls",
        "avatarUrl": null,
        "color": null
      },
      "tags": [
        {
          "id": 76,
          "name": "Bug",
          "color": "#dc2626"
        }
      ],
      "dueDate": 1793750400000,
      "priority": null
    }
  ],
  "hasMore": false
}
```
