# Tasks

Project Tasks are the core object of Aphex Plan - this endpoint will return realtime Task data for a provided query.

## Get Tasks

Use this endpoint to query Tasks on a project.

## get tasks

> Get tasks

```json
{"openapi":"3.1.1","info":{"title":"Plan API","version":"1.3.5"},"servers":[{"url":"https://app.aphex.co/"}],"paths":{"/{region}/v1/projects/{projectId}/tasks":{"get":{"description":"Get tasks","summary":"get tasks","parameters":[{"enum":["gb","au"],"type":"string","description":"gb | au","name":"region","in":"path","required":true},{"type":"string","description":"projectId","name":"projectId","in":"path","required":true},{"type":"string","description":"YYYY-MM-DD formatted date","name":"start","in":"query"},{"type":"string","description":"YYYY-MM-DD formatted date","name":"finish","in":"query"},{"enum":["day","afternoon","night","24hr"],"type":"string","description":"day | afternoon | night | 24hr","name":"shift","in":"query"},{"type":"string","description":"comma-delimited user IDs","name":"ownerIds","in":"query"},{"type":"string","description":"comma-delimited folder IDs","name":"folderIds","in":"query"},{"type":"string","description":"comma-delimited package IDs","name":"packageIds","in":"query"},{"type":"string","description":"comma-delimited location IDs","name":"locationIds","in":"query"},{"type":"string","description":"comma-delimited calendar IDs","name":"calendarIds","in":"query"},{"type":"string","description":"comma-delimited subcontractor IDs","name":"subcontractorIds","in":"query"},{"type":"string","description":"comma-delimited user IDs","name":"assignedToIds","in":"query"},{"type":"string","description":"comma-delimited additional fields (assignees,wbs,package,parent,contractor,labourResources,plantResources,materialResources,location,workArea,progress,predecessors,successors,externalId,notes)","name":"fields","in":"query"},{"type":"string","description":"access token","name":"X-API-Key","in":"header","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HttpResponse"},{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}}}]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/echo.HTTPError"}}}}}}}},"components":{"schemas":{"HttpResponse":{"type":"object","properties":{"paging":{"$ref":"#/components/schemas/HttpPaging"},"results":{}}},"HttpPaging":{"type":"object","properties":{"next":{"$ref":"#/components/schemas/HttpPage"}}},"HttpPage":{"type":"object","properties":{"after":{"type":"string"},"link":{"type":"string"}}},"Task":{"type":"object","properties":{"assignedTo":{"description":"* Optional task fields","type":"array","items":{"$ref":"#/components/schemas/User"}},"calendar":{"$ref":"#/components/schemas/TaskCalendar"},"duration":{"type":"integer"},"externalId":{"type":"string"},"finish":{"type":"string"},"folder":{"$ref":"#/components/schemas/TaskFolder"},"id":{"description":"* Default task fields","type":"string"},"keyTask":{"type":"boolean"},"labour":{"type":"array","items":{"$ref":"#/components/schemas/TaskLabour"}},"location":{"$ref":"#/components/schemas/TaskLocation"},"materials":{"type":"array","items":{"$ref":"#/components/schemas/TaskMaterial"}},"name":{"type":"string"},"notes":{"type":"string"},"owner":{"$ref":"#/components/schemas/User"},"package":{"$ref":"#/components/schemas/TaskPackage"},"parent":{"$ref":"#/components/schemas/TaskParent"},"plant":{"type":"array","items":{"$ref":"#/components/schemas/TaskPlant"}},"progress":{"type":"array","items":{"$ref":"#/components/schemas/TaskStatusEvent"}},"relatedTasks":{"type":"array","items":{"$ref":"#/components/schemas/RelatedTask"}},"shift":{"type":"string","enum":["day","afternoon","night","24hr"]},"start":{"type":"string"},"status":{"type":"string","enum":["planned","promised","done"]},"subcontractor":{"$ref":"#/components/schemas/Subcontractor"},"workArea":{"$ref":"#/components/schemas/geojson.Feature"}}},"User":{"type":"object","properties":{"displayName":{"type":"string"},"email":{"type":"string"},"id":{"type":"string"}}},"TaskCalendar":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["five-day","six-day","seven-day","two-day","custom"]}}},"TaskFolder":{"type":"object","properties":{"code":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"parentId":{"type":"string"},"path":{"type":"string"}}},"TaskLabour":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"number"}}},"TaskLocation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["map","drawing","off-site"]}}},"TaskMaterial":{"type":"object","properties":{"dailyActual":{"type":"array","items":{"$ref":"#/components/schemas/ResourceAllocation"}},"dailyPlanned":{"type":"array","items":{"$ref":"#/components/schemas/ResourceAllocation"}},"id":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string"}}},"ResourceAllocation":{"type":"object","properties":{"date":{"type":"string"},"quantity":{"type":"number"}}},"TaskPackage":{"type":"object","properties":{"code":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}}},"TaskParent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"TaskPlant":{"type":"object","properties":{"category":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"number"}}},"TaskStatusEvent":{"type":"object","properties":{"amount":{"type":"integer"},"date":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["delay","not-started","on-schedule","shortened","started-early"]}}},"RelatedTask":{"type":"object","properties":{"id":{"type":"string"},"lag":{"type":"integer"},"name":{"type":"string"},"relation":{"type":"string","enum":["predecessor","successor"]},"type":{"type":"string","enum":["start-start","start-finish","finish-start","finish-finish"]}}},"Subcontractor":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"geojson.Feature":{"type":"object","properties":{"bbox":{"type":"array","items":{"type":"number"}},"geometry":{},"id":{},"properties":{"$ref":"#/components/schemas/geojson.Properties"},"type":{"type":"string"}}},"geojson.Properties":{"type":"object","additionalProperties":true},"echo.HTTPError":{"type":"object","properties":{"message":{}}}}}}
```
