Xero: Retrieves a single project task
Xero projects.getTask: arguments, response, policy and SDK examples.
← Projects operations · Get started
Operation xero.projects_gettask
Provider route: GET /projects.xro/2.0/Projects/{projectId}/Tasks/{taskId}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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"]["getTask"]>[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.getTask(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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_task(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.projectId | string | Required within parent | Format: uuid |
path.taskId | string | Required within parent | Format: uuid |
headers | object | Required within parent | Additional keys: not allowed |
headers.xero-tenant-id | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Allows you to create a task — response body |
Referenced models: Allows you to create a task — response body
Schemas
Section titled “Schemas”Allows you to create a task — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
amountInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
amountToBeInvoiced | Model | Optional | Expand Allows you to create a task — response body — rate |
chargeType | string | Optional | Can 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 |
estimateMinutes | JSON | Optional | |
estimateMinutes (anyOf 1) | integer | Alternative | An estimated time to perform the task |
estimateMinutes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
fixedMinutes | JSON | Optional | |
fixedMinutes (anyOf 1) | integer | Alternative | Minutes logged against this task if its charge type is `FIXED`. |
fixedMinutes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
minutesInvoiced | JSON | Optional | |
minutesInvoiced (anyOf 1) | integer | Alternative | Minutes on this task which have been invoiced. |
minutesInvoiced (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
minutesToBeInvoiced | JSON | Optional | |
minutesToBeInvoiced (anyOf 1) | integer | Alternative | Minutes on this task which have not been invoiced. |
minutesToBeInvoiced (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
name | string | Optional | Name of the task. |
nonChargeableMinutes | JSON | Optional | |
nonChargeableMinutes (anyOf 1) | integer | Alternative | Minutes logged against this task if its charge type is `NON_CHARGEABLE`. |
nonChargeableMinutes (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
projectId | string | Optional | Identifier of the project task belongs to. Format: uuid |
rate | Model | Optional | Expand Allows you to create a task — response body — rate |
status | string | Optional | Status 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 |
taskId | string | Optional | Identifier of the task. Format: uuid |
totalAmount | Model | Optional | Expand Allows you to create a task — response body — rate |
totalMinutes | JSON | Optional | |
totalMinutes (anyOf 1) | integer | Alternative | Total minutes which have been logged against the task. Logged by assigning a time entry to a task |
totalMinutes (anyOf 2) | string | Alternative | Pattern: ^-?[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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
currency | Model | Optional | Expand Retrieves a single project — response body — currency Code |
value | JSON | Optional | |
value (anyOf 1) | number | Alternative | Format: double |
value (anyOf 2) | string | Alternative | Pattern: ^-?[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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | 3 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 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: xero.projects_gettask. Catalog operation: projects.getTask. 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.