Skip to content

Xero: Retrieves all time entries associated with a specific project

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

← Projects operations · Get started

Operation xero.projects_gettimeentries

Provider route: GET /projects.xro/2.0/Projects/{projectId}/Time. 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"]["getTimeEntries"]>[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.getTimeEntries(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_time_entries(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.userIdstringOptionalFormat: uuid
query.taskIdstringOptionalFormat: uuid
query.invoiceIdstringOptionalFormat: uuid
query.contactIdstringOptionalFormat: uuid
query.pageintegerOptional
query.pageSizeintegerOptional
query.statesarrayOptional
query.states[]stringEach item
query.isChargeablebooleanOptional
query.dateAfterUtcstringOptionalFormat: date-time
query.dateBeforeUtcstringOptionalFormat: date-time
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 time entries associated with a specific project — response body

Referenced models: Retrieves all time entries associated with a specific project — response body

Retrieves all time entries associated with a specific project — response body
FieldTypePresenceDescription and constraints
$objectRoot
itemsarrayOptional
items[]ModelEach itemExpand Creates a time entry for a specific project — response body
paginationModelOptionalExpand Retrieves all projects — response body — pagination

Referenced models: Retrieves all projects — response body — pagination, Creates a time entry for a specific project — 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]+)?$
Creates a time entry for a specific project — response body
FieldTypePresenceDescription and constraints
$objectRoot
dateEnteredUtcstringOptionalThe date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time.
Format: date-time
dateUtcstringOptionalThe date time that time entry is logged on. UTC Date Time in ISO-8601 format.
Format: date-time
descriptionstringOptionalA description of the time entry.
durationJSONOptional
duration (anyOf 1)integerAlternativeThe duration of logged minutes.
duration (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
projectIdstringOptionalIdentifier of the project, that the task (which the time entry is logged against) belongs to.
Format: uuid
statusstringOptionalStatus of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced.
Known values: ACTIVE, LOCKED, INVOICED
taskIdstringOptionalIdentifier of the task that time entry is logged against.
Format: uuid
timeEntryIdstringOptionalIdentifier of the time entry.
Format: uuid
userIdstringOptionalThe xero user identifier of the person who logged time.
Format: uuid

SDK function policy ID: xero.projects_gettimeentries. Catalog operation: projects.getTimeEntries. 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.