What Are Employee Attributes?
The employee data model in the Lucca API is spread across several resources:employee, employment, job-position, and their respective extension resources. In practice, a single piece of information about an employee — say, their manager, or a custom “T-shirt size” field — may live in any of these resources.
Employee attributes provide a single, uniform endpoint to read any property from any of these resources, regardless of where it is stored.
An employee-attribute is the value of one specific property for one specific employee. Each attribute is described by an employee-attribute-definition, which declares what the property is, what type it carries, and which resource it targets (employee, employment, or job-position).
Employee attributes are read-only. To update an employee’s data, use the dedicated write endpoints of the underlying resources (e.g.
PATCH /lucca-api/employees/{id}).Key Concepts
Definitions vs. Values
The employee-attribute merges both the attributes of primary resources (e.g.employee.givenName, job-position.manager) and custom extension properties (e.g. employment.e_tShirtSize) into a single uniform model. To achieve this, it relies on two distinct concepts:
employee-attribute-definition
Describes a property: its
id, human-readable name, the JSON schema of its value, and the targetType (employee, employment, or job-position) it comes from. Definitions are defined by Lucca (for built-in properties) or by your organization (for custom extension properties).employee-attribute
The actual value of a definition for a given employee. Contains the
value itself, a reference to its definition, the employee it belongs to, and an applicability window indicating the date range over which this value is valid.Applicability
Because many attributes come from time-bounded resources likeemployment or job-position, each employee-attribute exposes an applicability window:
startis the inclusive lower bound.nullmeans “since the beginning of time”.endis the inclusive upper bound.nullmeans “until the end of time”.- For attributes without a temporal dimension (e.g.
employee.givenName, custom extensions), both bounds arenull, meaning the value applies indefinitely.
?applicability.asOf={date} query parameter to filter attributes to those valid on a specific date — for example, to retrieve the state of an employee on their first day.
Multiple Values
Some definitions support multiple values per primary resource (e.g. “employee’s children”, where the same employee may have several entries). ThemultipleValueHandling property on the definition describes this behavior:
null→ single-valued: at most one attribute per employee for this definition.- non-null → multi-valued: multiple attributes per employee are allowed, with a
sortingdirection and optionalsortingPropertyto order them.
Required OAuth Scopes
| Scope | Access |
|---|---|
employee-attribute-definitions.readonly | Read attribute definitions. |
employee-attribute-definitions.readwrite | Read, create, update, and delete attribute definitions. |
employee-attributes.readonly | Read attribute values. |
employee-attributes.readwrite | Read, create, update, and delete attribute values. |
Access Rights
Beyond OAuth scopes, two additional constraints apply when reading employee attributes:- Business establishments: you may only access attributes of employees whose applicable business establishment is accessible to your client application.
- Directory sections: each attribute definition is associated with an employee directory section. You may only access attributes belonging to sections that are accessible to your client application.
Common Workflows
1. Discover Available Definitions
Before reading values, you may want to discover which attribute definitions exist on the account.| Parameter | Description |
|---|---|
id | Filter by one or more definition IDs (comma-separated, max 100). |
search | Find definitions whose name starts with the given string. |
isArchived | Filter by archival status. |
sort | Sort by id, name, or createdAt (prefix with - to reverse). |
targetType tells you which underlying resource the value comes from:
targetType | Source resource |
|---|---|
employee | employee or its extensions |
employment | employment or its extensions |
job-position | job-position or its extensions |
2. Read Attributes for a Specific Employee
To fetch all current attribute values for a given employee, filter byemployee.id and supply an applicability.asOf date:
| Query parameter | Description |
|---|---|
employee.id | Filter by employee ID(s) (comma-separated, max 100). |
definition.id | Filter by definition ID(s) — useful when you only need specific fields. |
applicability.asOf | Only return attributes whose applicability window includes this date. |
value | Filter by value. Supports dot-notation for object schemas (e.g. value.e_childGivenName=John). |
sort | Sort by id, createdAt, value, or definition.id. |
3. Filtering on value
The value query parameter lets you filter attributes by their actual value. For scalar values (strings, booleans, numbers), pass the value directly:
schema.type is "object"), use dot-notation to filter on a specific sub-property of the value:
Filtering on
value performs a strict equality check. Partial matches and range filters are not supported on this parameter.4. Read a Single Attribute
When you already know the attribute’sid, retrieve it directly:
Understanding the value Property
The value type depends on the schema declared on the associated definition. Below are the most common schemas and their corresponding JSON representations:
Schema $id | JSON type of value | Example |
|---|---|---|
/lucca-api/schemas/short-text | string | null | "Software Engineer" |
/lucca-api/schemas/long-text | string | null | "Lorem ipsum..." |
/lucca-api/schemas/boolean | boolean | null | true |
/lucca-api/schemas/int32 | number | null | 42 |
/lucca-api/schemas/decimal | number | null | 1.5 |
/lucca-api/schemas/legacy-date | string | null | "2025-01-01T00:00:00" |
/lucca-api/schemas/email | string | null | "jdoe@example.org" |
/lucca-api/schemas/employee-reference | object | null | {"id": "416", "type": "employee", ...} |
/lucca-api/schemas/taxonomy-label-reference | object | null | {"id": "545", "type": "taxonomy-label", ...} |
object-typed schemas, the value is a JSON object whose properties each follow their own referenced schema. Use the definition’s propertyDescriptions to discover and label each sub-property.
Example: Multi-valued Object Attribute (Children)
This example walks through a custom attribute representing an employee’s dependent children. Because an employee may have several children, the definition usesmultipleValueHandling to allow multiple values and declare how they should be sorted.
The Definition
multipleValueHandlingis non-null — multipleemployee-attributerecords can exist for the same employee under this definition (one per child).sortingProperty: "e_childBirthDate"— clients should display children sorted by their birth date in ascending order.propertyDescriptions— provides human-readable labels and translation keys for each object property, useful when building a UI.
The Corresponding Attributes
QueryingGET /lucca-api/employee-attributes?employee.id=416&definition.id=e_children returns one item per child:
Paginating Results
Like all collection endpoints,/lucca-api/employee-attributes is paginated. Use ?include=totalCount,links to get the total count and cursor links for navigating pages. The default and maximum page size is defined in the API Reference.
Pagination
Learn how cursor-based pagination works.
Filtering
Learn more about filtering collections.