API version: 0.3.0

---

# Elements

Elements are the nodes and relations of the graph. Every element has an [id](/reference/elements/element-id.md), a
`type` (the node label or relation type) and `data`, its properties. Relations additionally have a `start` and an
`end` node. An element can have one [file](/reference/elements/file.md), which can be uploaded at once or in chunks with a
resumable [upload](/reference/elements/upload.md). The [schema](/reference/schemas.md) of its type validates the properties
of an element, and the [access model](/reference/access-model.md) decides who can read and write it.

The properties are stored in several databases internally, see [databases](/reference/databases.md). This is invisible
when using the [element endpoints](/reference/endpoints.md#element), but matters when writing search steps which target
one of the databases directly, e.g. a [Cypher path query](/reference/search/cypher-path-subset.md).

## Special fields

A handful of fields are managed by the API and always written the same way:

| Field       | Neo4j                     | MongoDB                     | Elasticsearch                       |
| ----------- | ------------------------- | --------------------------- | ----------------------------------- |
| `id`        | property                  | `_id` (document identifier) | `_id` (document identifier)         |
| `type`      | label / relation type     | collection name             | index name                          |
| `name`      | property                  | property                    | field                               |
| `createdAt` | native `DateTime`         | `UTCDateTime`               | `date` (sent as an RFC 3339 string) |
| `createdBy` | property (id of the user) | property (id of the user)   | field (id of the user)              |
| `updatedAt` | native `DateTime`         | `UTCDateTime`               | `date` (sent as an RFC 3339 string) |
| `updatedBy` | property (id of the user) | property (id of the user)   | field (id of the user)              |
| `hasFile`   | boolean                   | boolean                     | boolean                             |

The `type` of nodes (their label) and relations has to start with a letter, followed by up to 127 letters, digits or
underscores (`^[A-Za-z][A-Za-z0-9_]{0,127}$`); other values are rejected with `400 Bad Request`. New types
additionally follow a casing rule: node labels are written in UpperCamelCase (`SavedSearch`) and relation types in
SCREAMING_SNAKE_CASE (`HAS_FILE`). Types which exist already keep their names, see
[names](/reference/schemas.md#names).

`createdAt` and `updatedAt` are timestamps maintained automatically by the server. `createdBy` and `updatedBy` are the
ids of the users who created or last changed the element, also maintained by the server. In responses, these four
properties are located together at the end of `data`, in the order `createdAt`, `createdBy`, `updatedAt`,
`updatedBy`. `hasFile` is a cheap boolean mirror of whether an element
currently has a file attached, kept alongside the element data itself so collection and search listings can show it
without the more expensive [file metadata](/reference/elements/file.md#metadata) lookup. For the full list of properties
which the API reserves from direct writes, see [reserved properties](/reference/security.md#reserved-properties).

## Null values

Setting a property to `null` does not store a null value, it deletes the property. This also applies when
[replacing an element](/api/put-element.md), where any existing property not mentioned in the request body is treated as
if it had been set to `null`. See also [`PATCH /<uuid>`](/api/patch-element.md).

## Empty objects and lists

The values of properties keep their JSON shape on every level: an empty object is returned as `{}` and an empty list as
`[]`, they are never converted into each other. A property written as `{"a": {}, "b": [], "c": {"d": {}}}` is read back
exactly like that, also in collections, in search results with element hydration, in backups and in the `properties` of
the schema of a type, which are `{}` if the schema defines no properties. Where an empty object is valid, e.g. for an
[object](/reference/schemas/types/object.md) property, `[]` is accepted as well and stays a list.

## Geo values

Properties which the schema defines as one of the [geo types](/reference/schemas/types.md) are returned as
[GeoJSON](/reference/formats-and-languages/geojson.md) by default, or as WKT if the request sends `Prefer: geometry=wkt`,
see [response format](/reference/formats-and-languages/geojson.md#response-format).

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [Roles and capabilities](/reference/roles-and-capabilities.md)

Next: [Element id](/reference/elements/element-id.md)
