> ## Documentation Index
> Fetch the complete documentation index at: https://developers.lucca.fr/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Started With Axis-Sections

> Learn more about axes & axis-sections.

### Definition

The `axis-sections` are API resources that represent individual elements within a list. They serve as analytical dimensions, used to label [`time-entries`](../../timmi-timesheet/time-entries/time-entry) or [`expenses`](../../cleemy-expenses/expenses/expense-temp-item). 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:

<CodeGroup>
  ```http GET axis-sections theme={null}
  GET /api/v3/axissections?axisId={AXIS_ID} HTTPS/2
  Host: example.ilucca.net
  Authorization: lucca application={API_KEY}
  ```
</CodeGroup>

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`:

<CodeGroup>
  ```http GET axis-sections theme={null}
  GET /api/v3/axissections?axisId={AXIS_ID}&parentAxisSections.id=containsall,{PARENT_IDS...} HTTPS/2
  Host: example.ilucca.net
  Authorization: lucca application={API_KEY}
  ```
</CodeGroup>

<Tip>
  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).
</Tip>

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.

<CodeGroup>
  ```json Axes theme={null}
  // 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
              }
          ]
      }
  }
  ```

  ```json Axis-sections theme={null}
  // GET /api/v3/axisSections HTTP/1.1
  {
      "data": {
          "items": [
              {
                  "id": 1,
                  "name": "Acme Corporation",
                  "axis": {
                      "id": 1,
                      "name": "Clients",
                      "parentAxisId": null,
                      "isNNRelation": false
                  },
                  "parentAxisSections": []
              },
              {
                  "id": 2,
                  "name": "My awesome project",
                  "axis": {
                      "id": 2,
                      "name": "Projects",
                      "parentAxisId": 1,
                      "isNNRelation": false
                  },
                  "parentAxisSections": [
                      {
                          "id": 1,
                          "axisId": 1
                      }
                  ]
              },
              {
                  "id": 3,
                  "name": "My #2 project",
                  "axis": {
                      "id": 2,
                      "name": "Projects",
                      "parentAxisId": 1,
                      "isNNRelation": false
                  },
                  "parentAxisSections": [
                      {
                          "id": 1,
                          "axisId": 1
                      }
                  ]
              },
              {
                  "id": 4,
                  "name": "User tests",
                  "axis": {
                      "id": 3,
                      "name": "Tasks",
                      "parentAxisId": 2,
                      "isNNRelation": true
                  },
                  "parentAxisSections": [
                      {
                          "id": 2,
                          "axisId": 2
                      },
                      {
                          "id": 3,
                          "axisId": 2
                      }
                  ]
              }
          ]
      }
  }
  ```
</CodeGroup>

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.

### Setting an Axis-Section Name

When creating a new axis-section (POST) or updating its name (PUT), you should set the `multilingualName` field, which allows you to specify it in multiple languages.

The multilingualName may be formatted either as:

* A JSON object,
* A string with `"[]"` or `"|"` delimiters.

<CodeGroup>
  ```json Object theme={null}
  {
      "multilingualName": {
          "fr-FR": "Nom en Français",
          "en-US": "Name in English"
      }
  }
  ```

  ```json String [] theme={null}
  {
      "multilingualName": "[fr-FR][Nom en Français][en-US][Name in English]"
  }
  ```

  ```json String | theme={null}
  {
      "multilingualName": "fr-FR|Nom en Français||en-US|Name in English"
  }
  ```
</CodeGroup>

<Warning>As a result, the following characters should be avoided in the actual name of the axis-sections: `"["`, `"]"` and `"|"`. Besides, slashes `"/"` and backslashes `"\"` might also cause problems.</Warning>
