> For the complete documentation index, see [llms.txt](https://docs.fylr.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fylr.io/for-developers/api/endpoints/api-db.md).

# /api/v1/db

The `/db` endpoint is **datamodel-driven**. `{objecttype}` is the name of an object type defined in this instance's datamodel. For every object type, **fylr** exposes the same set of operations:

* `POST /db/{objecttype}` — create or update objects.
* `GET /db/{objecttype}/{mask}/{objectId}` — read a single object.
* `GET /db/{objecttype}/{mask}/list` — list objects.
* `DELETE /db/{objecttype}` — delete objects.

Every object is shaped by a *mask* of its object type. The mask selects which fields are present and whether each one is writable or read-only.

These operations are documented generically here. When the instance has object types defined, the sections below additionally describe each object type concretely, with its real masks and field schemas. If only this generic overview is shown, no object types have been defined yet.

From **fylr 6.35.0**, [base fields only group edits](/for-developers/api/endpoints/base-fields-only.md) can change tags or pools without a common mask.

### `POST /db/{objecttype}` — Create or update objects of any object type.

#### Base fields only group edits

From **6.35.0** the query parameter `base_fields_only=1` changes tags or pools for records that are editable through different masks in one request. Send the group-edit `_id` array without `_mask`; ordinary fields, parents, owners and record ACLs stay unchanged. Write permission, the tag-edit policy and the pool permissions still apply. Repeated tag and pool edits share unchanged value sets between record versions, so a large group edit writes far less to the database; bidirectional links are kept, and an unchanged file needs no replacement permission.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/db/{objecttype}" method="post" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `DELETE /db/{objecttype}` — Delete objects of any object type.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/db/{objecttype}" method="delete" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `GET /db/{objecttype}/{mask}/{objectId}` — Read a single object of any object type.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/db/{objecttype}/{mask}/{objectId}" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}

### `GET /db/{objecttype}/{mask}/list` — List objects of any object type.

{% openapi src="/files/kfiDjhyZfEICNBmt5f49" path="/db/{objecttype}/{mask}/list" method="get" %}
[fylr-openapi.yml](https://4100607288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAdRFzQASDY2Elfdm3wXW%2Fuploads%2Fgit-blob-c66962d021f9281075604517b7590deaf0d3f984%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}
