The axis-sections are API resources that represent individual elements within a list. They serve as analytical dimensions, used to label time-entries or expenses. These are fully customizable objects, which means they can represent various concepts such as projects, clients, cost centers, or components of an organization’s structure.

Each axis-section belongs to an axis, which represents the list to which the sections belong. For instance, an axis named “Projects” would contain axis-sections representing each of the company’s projects.

You then usually will retrieve axis-sections while filtering on their axis:

GET /api/v3/axissections?axisId={AXIS_ID} HTTPS/2
Host: example.ilucca.net
Authorization: lucca application={API_KEY}

Axes can also define parent-child relationships with other axes. For example, the “Projects” axis might be a child of a “Clients” axis. In this setup, each axis-section within the “Projects” axis can reference an axis-section from the “Clients” axis as its parent.

These relationships can be:

  • One-to-many (1-N): each child has a single parent, or
  • Many-to-many (N-N): a child can have multiple parents.

As a result, you may want to only retrieve “projects” axis-sections that belong to a given “client” axis-section:

GET /api/v3/axissections?axisId={AXIS_ID}&parentAxisSections.id=containsall,{PARENT_IDS...} HTTPS/2
Host: example.ilucca.net
Authorization: lucca application={API_KEY}

The containsall keyword above gives you a way of filtering axis-sections whose N parents list contains all of the given axis-section Ids (“AND”). Otherwise, ?parentAxisSections.id=1,2,3 would function as a “OR” (i.e. contains at least one of them).

The relationship type is defined by the isNNRelation property on the axis object.

For example, a many-to-many relationship would apply if there is an extra axis called “Tasks” that is a child of the “Projects” axis—assuming that a task can be associated with multiple projects.

// GET /api/v3/axes HTTP/1.1
{
    "data": {
        "items": [
            {
                "id": 1,
                "name": "Clients",
                "parentAxisId": null,
                "isNNRelation": false
            },
            {
                "id": 2,
                "name": "Projects",
                "parentAxisId": 1,
                "isNNRelation": false
            },
            {
                "id": 3,
                "name": "Tasks",
                "parentAxisId": 2,
                "isNNRelation": true
            }
        ]
    }
}

Given that this relationship can be “many-to-many”, objects that reference axis-sections (e.g. expenses and time-entries) usually do the whole tree branch (i.e. the client, project and task axis-sections) rather than just the lowest level leaf.

Was this page helpful?