> For the complete documentation index, see [llms.txt](https://docs.pakk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pakk.io/data-and-integrations/api/api-structure/generic-entity-api.md).

# Generic Entity API

* The Pakk API can be thought of as following a 'generic' architecture. There is a set of 4 endpoints for most *entities*: get a list, get a single record, create a new record, update an existing record
* A few entities do not allow writes, so have only 2 endpoints
* Entity names can be obtained easily by observing URL structure in the admin panel
* For requesting a list, you must send a *filter* - the shape of the filter request is the same regardless of which entity you are requesting
* Lists can return a **maximum of 1000 records**
* The fields available on both requests and responses are essentially the full set of fields exposed by that entity.  You can get full details of each field, along with more in-depth help by turning on `Show API Field Paths` in your account and clicking on each field name on each entity screen to view its 'in-field help'
* Alternatively observe the requests made by the admin panel to understand what fields are available and/or required

`POST {root}/get/{entityname}`

* Retrieves a list of entities
* Takes a 'filter' object as an argument.  The easiest way to build filter requests is to use the GUI tools in the admin panel to build up the filter you require and then copy-paste the JSON body request.
* Returns the complete JSON content for each entity found that matches the filter, as an array

`GET {root}/{entityname}/{id}`

* Retrieves a single entity by ID
* Returns the complete JSON content for the entity

`POST {root}/{entityname}`

* Creates a new entity record
* Refer to new record creation in the admin panel to understand which fields are required when creating a new record

`PATCH {root}/{entityname}/{id}`

* Update a single entity by ID
* Only the fields sent in the request will be updated - all others will be left untouched. Note that for fields that are lists or maps (dictionaries), you need to **send the whole field** when editing or updating the list/map, otherwise existing members will be lost (doesn't apply to writing to the Key-Value store)


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.pakk.io/data-and-integrations/api/api-structure/generic-entity-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
