# RPC API

* Each entity exposes a number of 'actions' that can be completed via the API
* Examples of actions are 'cancel', 'invoice', 'autocommit' etc
* RPC actions correspond, mainly, to the 'action buttons' that can be seen on entity record drilldown pages in the admin panel
* Use the admin panel to test RPC actions and observe the required payloads and response shapes
* Resource intensive operations, like report generation, can be run via a dedicated 'high resource' route that will automatically engage more CPU and RAM to complete the action

### Bulk RPCs

Many RPCs also support bulk operations, where you can perform an action on many records at once.  You can see which actions support bulk RPC operations by inspecting list views in the admin panel.  On some list views you'll notice a 'Select Bulk Action' at the top of list views.  Try executing bulk actions in the admin panel and observing the request and response to get a feel for how they work.

* Bulk RPCs use filter objects (see Generic Entity API) to specify which records on which to operate
* Parameters for the action can be applied either to all records or on a record-by-record basis (override the main parameter).
* Sometimes only record-by-record parameter arguments make sense

`POST {root}/rpc/{entityname}/{actionname}/{id}`

* Performs an update action on a single entity
* Take a JSON payload body argument (see the admin panel)
* Returns the updated record

&#x20;`POST {root}/rpc-highresource/{entityname}/{actionname}/{id}`

* Identical to regular RPC call
* Automatically directs the request to a higher CPU/RAM instance

`POST {root}/rpc/{entityname}/{actionname}`

* Performs a bulk RPC action on all records matching the `filter` argument.
* General parameters should be set in the `params` field
* Record-by-record (override) parameters should be set in the `entityParams` field (which is an array of objects containing `entityID` and `params` fields)

`POST {root}/rpc-highresource/{entityname}/{actionname}`

* Identical to regular bulk RPC call
* Automatically directs the request to a higher CPU/RAM instance


---

# Agent Instructions: 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.pakk.io/data-and-integrations/api/api-structure/rpc-api.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.
