time-entries

List time entries

GET /v1/time-entries

Default page size 100, maximum 500. Keep filters and pass nextCursor to continue. Data can change during pagination; use full export for a backup.

Parameters

fromDate

query · Optional

Inclusive filter start date

Type: string

Complete JSON Schema
{
  "type": "string",
  "format": "date"
}

toDateExclusive

query · Optional

Exclusive filter end date

Type: string

Complete JSON Schema
{
  "type": "string",
  "format": "date"
}

from

query · Optional

Inclusive start timestamp; provide with to

Type: string

Complete JSON Schema
{
  "type": "string",
  "format": "date-time"
}

to

query · Optional

Exclusive end timestamp; provide with from

Type: string

Complete JSON Schema
{
  "type": "string",
  "format": "date-time"
}

state

query · Optional

Entry, job or operation state; meaning depends on the endpoint

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "running",
    "stopped",
    "invalid"
  ]
}

projectIds

query · Optional

Project IDs; comma-separated in GET, array in POST

Type: string

Complete JSON Schema
{
  "type": "string",
  "maxLength": 8192
}

tagIds

query · Optional

Tag IDs; comma-separated GET filter, array in bodies

Type: string

Complete JSON Schema
{
  "type": "string",
  "maxLength": 8192
}

tagMatch

query · Optional

Tag matching: any or all

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "any",
    "all"
  ]
}

noProject

query · Optional

Match entries without a project

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "true",
    "false"
  ]
}

noTags

query · Optional

Match entries without tags

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "true",
    "false"
  ]
}

includeDescendants

query · Optional

Include descendant tags when filtering

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "true",
    "false"
  ]
}

archived

query · Optional

Archive filter: active, only or all

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "active",
    "only",
    "all"
  ]
}

match

query · Optional

Time matching: overlaps or startsWithin

Type: string

Complete JSON Schema
{
  "type": "string",
  "enum": [
    "overlaps",
    "startsWithin"
  ]
}

text

query · Optional

Search text; POST avoids putting it in URLs

Type: any

Complete JSON Schema
{
  "not": {}
}

limit

query · Optional

Page size; default 100, maximum 500

Type: string

Complete JSON Schema
{
  "type": "string",
  "pattern": "^(?:[1-9][0-9]?|[1-4][0-9]{2}|500)$"
}

cursor

query · Optional

Opaque cursor; return unchanged, do not parse

Type: string

Complete JSON Schema
{
  "type": "string",
  "maxLength": 8192
}

Request example

Replace path and request parameters with actual values. For requests with a body, save it as request.json using the schema above.

curl --fail-with-body --request GET 'https://api.treering.cn/v1/time-entries' \
  --header "Authorization: Bearer $TREERING_API_TOKEN"

Responses

200

Successful response; status depends on the operation result.

application/json

Type: object

FieldTypeRequiredDescription and constraints
itemsarray<object>YesResources, events or operation results
items[]objectNo{"additionalProperties":false}
items[].idstringYesResource, job or operation identifier
items[].versionstringYesVersion as a decimal string; do not convert to a floating-point number {"pattern":"^(0|[1-9][0-9]*)$"}
items[].etagstringYesConcurrency tag; preserve quotes when sending If-Match
items[].updatedAtstringYesLast server update timestamp
items[].operationIdstringNoRequest receipt identifier; no status polling is needed
items[].deletedAtstringNoDeletion timestamp
items[].startTimestring | nullNoStart timestamp in ISO 8601 with a time zone
items[].startTime (anyOf 1)stringNo
items[].startTime (anyOf 2)nullNo
items[].stopTimestring | nullNoStop timestamp; null means running
items[].stopTime (anyOf 1)stringNo
items[].stopTime (anyOf 2)nullNo
items[].detailstring | nullNoEntry description
items[].detail (anyOf 1)stringNo
items[].detail (anyOf 2)nullNo
items[].notestring | nullNoNote
items[].note (anyOf 1)stringNo
items[].note (anyOf 2)nullNo
items[].projectIdstring | nullNoProject ID, or null
items[].projectId (anyOf 1)stringNo
items[].projectId (anyOf 2)nullNo
items[].tagIdsarray<string>NoTag IDs; comma-separated GET filter, array in bodies
items[].tagIds[]stringNo
items[].sourcestring | nullNoSource label
items[].source (anyOf 1)stringNo
items[].source (anyOf 2)nullNo
items[].statestringNoEntry, job or operation state; meaning depends on the endpoint
items[].durationSecondsnumber | nullNoDuration in seconds; may be fractional
items[].durationSeconds (anyOf 1)numberNo
items[].durationSeconds (anyOf 2)nullNo
hasMorebooleanYesWhether another page is available
nextCursorstring | nullYesNext-page cursor, or null on the final page
nextCursor (anyOf 1)stringNo
nextCursor (anyOf 2)nullNo
evaluatedAtstringYesServer evaluation timestamp
effectiveRangeobject | nullYesFixed effective range for this query
effectiveRange (anyOf 1)objectNo
effectiveRange (anyOf 1).fromstringYesInclusive start timestamp; provide with to
effectiveRange (anyOf 1).tostringYesExclusive end timestamp; provide with from
effectiveRange (anyOf 2)nullNo
Complete JSON Schema
{
  "type": "object",
  "required": [
    "items",
    "hasMore",
    "nextCursor",
    "evaluatedAt",
    "effectiveRange"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "version",
          "etag",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Resource, job or operation identifier"
          },
          "version": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Version as a decimal string; do not convert to a floating-point number"
          },
          "etag": {
            "type": "string",
            "description": "Concurrency tag; preserve quotes when sending If-Match"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last server update timestamp"
          },
          "operationId": {
            "type": "string",
            "description": "Request receipt identifier; no status polling is needed"
          },
          "deletedAt": {
            "type": "string",
            "description": "Deletion timestamp"
          },
          "startTime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Start timestamp in ISO 8601 with a time zone"
          },
          "stopTime": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Stop timestamp; null means running"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Entry description"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Note"
          },
          "projectId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID, or null"
          },
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tag IDs; comma-separated GET filter, array in bodies"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source label"
          },
          "state": {
            "type": "string",
            "description": "Entry, job or operation state; meaning depends on the endpoint"
          },
          "durationSeconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Duration in seconds; may be fractional"
          }
        },
        "additionalProperties": false
      },
      "description": "Resources, events or operation results"
    },
    "hasMore": {
      "type": "boolean",
      "description": "Whether another page is available"
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Next-page cursor, or null on the final page"
    },
    "evaluatedAt": {
      "type": "string",
      "description": "Server evaluation timestamp"
    },
    "effectiveRange": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "from",
            "to"
          ],
          "properties": {
            "from": {
              "type": "string",
              "description": "Inclusive start timestamp; provide with to"
            },
            "to": {
              "type": "string",
              "description": "Exclusive end timestamp; provide with from"
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Fixed effective range for this query"
    }
  }
}

400, 401, 403, 404, 410, 413, 422, 429, 500, 503

Error response; branch on code.

application/json

Type: object

FieldTypeRequiredDescription and constraints
codestringYesMachine-readable error code
messagestringNoError message; use code for program logic
requestIdstringNoRequest trace identifier
operationIdstringNoRequest receipt identifier; no status polling is needed
Complete JSON Schema
{
  "type": "object",
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "description": "Machine-readable error code"
    },
    "message": {
      "type": "string",
      "description": "Error message; use code for program logic"
    },
    "requestId": {
      "type": "string",
      "description": "Request trace identifier"
    },
    "operationId": {
      "type": "string",
      "description": "Request receipt identifier; no status polling is needed"
    }
  },
  "additionalProperties": true
}

On this page