Skip to content

Xero: Retrieves all project tasks

Xero projects.getTasks: arguments, response, policy and SDK examples.

← Projects operations · Get started

Operation xero.projects_gettasks

Provider route: GET /projects.xro/2.0/Projects/{projectId}/Tasks. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/xero with npm, or alter-sdk-xero with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { XeroIntegration } from "@alter-ai/xero";
async function execute(input: Parameters<XeroIntegration["projects"]["getTasks"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new XeroIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.projects.getTasks(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_xero import XeroIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = XeroIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.projects.get_tasks(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.projectIdstringRequired within parentFormat: uuid
queryobjectOptionalAdditional keys: not allowed
query.pageintegerOptional
query.pageSizeintegerOptional
query.taskIdsstringOptional
query.chargeTypestringOptionalCan be `TIME`, `FIXED` or `NON_CHARGEABLE`, defines how the task will be charged. Use `TIME` when you want to charge per hour and `FIXED` to charge as a fixed amount. If the task will not be charged use `NON_CHARGEABLE`.
One of: TIME, FIXED, NON_CHARGEABLE
headersobjectRequired within parentAdditional keys: not allowed
headers.xero-tenant-idstringRequired within parent

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Retrieves all project tasks — response body

Referenced models: Retrieves all project tasks — response body

Retrieves all project tasks — response body
FieldTypePresenceDescription and constraints
$objectRoot
itemsarrayOptional
items[]ModelEach itemExpand Allows you to create a task — response body
paginationModelOptionalExpand Retrieves all projects — response body — pagination

Referenced models: Retrieves all projects — response body — pagination, Allows you to create a task — response body

Retrieves all projects — response body — pagination
FieldTypePresenceDescription and constraints
$JSONRoot
itemCountJSONOptional
itemCount (anyOf 1)integerAlternativeNumber of items returned
itemCount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pageJSONOptional
page (anyOf 1)integerAlternativeSet to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
page (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pageCountJSONOptional
pageCount (anyOf 1)integerAlternativeNumber of pages available
pageCount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pageSizeJSONOptional
pageSize (anyOf 1)integerAlternativeOptional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
pageSize (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Allows you to create a task — response body
FieldTypePresenceDescription and constraints
$objectRoot
amountInvoicedModelOptionalExpand Allows you to create a task — response body — rate
amountToBeInvoicedModelOptionalExpand Allows you to create a task — response body — rate
chargeTypestringOptionalCan be `TIME`, `FIXED` or `NON_CHARGEABLE`, defines how the task will be charged. Use `TIME` when you want to charge per hour and `FIXED` to charge as a fixed amount. If the task will not be charged use `NON_CHARGEABLE`.
Known values: TIME, FIXED, NON_CHARGEABLE
estimateMinutesJSONOptional
estimateMinutes (anyOf 1)integerAlternativeAn estimated time to perform the task
estimateMinutes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
fixedMinutesJSONOptional
fixedMinutes (anyOf 1)integerAlternativeMinutes logged against this task if its charge type is `FIXED`.
fixedMinutes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
minutesInvoicedJSONOptional
minutesInvoiced (anyOf 1)integerAlternativeMinutes on this task which have been invoiced.
minutesInvoiced (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
minutesToBeInvoicedJSONOptional
minutesToBeInvoiced (anyOf 1)integerAlternativeMinutes on this task which have not been invoiced.
minutesToBeInvoiced (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringOptionalName of the task.
nonChargeableMinutesJSONOptional
nonChargeableMinutes (anyOf 1)integerAlternativeMinutes logged against this task if its charge type is `NON_CHARGEABLE`.
nonChargeableMinutes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
projectIdstringOptionalIdentifier of the project task belongs to.
Format: uuid
rateModelOptionalExpand Allows you to create a task — response body — rate
statusstringOptionalStatus of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified.
Known values: ACTIVE, INVOICED, LOCKED
taskIdstringOptionalIdentifier of the task.
Format: uuid
totalAmountModelOptionalExpand Allows you to create a task — response body — rate
totalMinutesJSONOptional
totalMinutes (anyOf 1)integerAlternativeTotal minutes which have been logged against the task. Logged by assigning a time entry to a task
totalMinutes (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Allows you to create a task — response body — rate

Allows you to create a task — response body — rate
FieldTypePresenceDescription and constraints
$objectRoot
currencyModelOptionalExpand Retrieves a single project — response body — currency Code
valueJSONOptional
value (anyOf 1)numberAlternativeFormat: double
value (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Retrieves a single project — response body — currency Code

Retrieves a single project — response body — currency Code
FieldTypePresenceDescription and constraints
$stringRoot3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD.
Known values: AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BTN, BWP, BYN, BZD, CAD, CDF, CHF, CLP, CNY, COP, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GGP, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, IMP, INR, IQD, IRR, ISK, JEP, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SPL, SRD, STN, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TVD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VND, VUV, WST, XAF, XCD, XDR, XOF, XPF, YER, ZAR, ZMW, ZMK, ZWD

SDK function policy ID: xero.projects_gettasks. Catalog operation: projects.getTasks. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.