> 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.

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

{% 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-d5aceac1c99d5aa0b623bea061400efbac147a8d%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-d5aceac1c99d5aa0b623bea061400efbac147a8d%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-d5aceac1c99d5aa0b623bea061400efbac147a8d%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-d5aceac1c99d5aa0b623bea061400efbac147a8d%2Ffylr-openapi.yml?alt=media)
{% endopenapi %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fylr.io/for-developers/api/endpoints/api-db.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
