PocketBase
List and manage records in PocketBase collections.
On this page
Connect
Auth type: API key (secret_text). Pass the provider's API key or token as the connection's credential. It is sealed at rest and only opened on the server when an action runs.
- From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
- Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
- Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.
Call it from a workflow
step.ctx.integrations.invoke("pocketbase", action, input) resolves with the provider's answer and rejects when PocketBase isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "pocketbase"} says whether yours can call it.
// workflows/notify.ts: call PocketBase when a booking is confirmed
import { on } from "@appbricx/workflows";
export const tellPocketbase = on.transition("booking", "status", "confirmed", async (_event, step) => {
// Recorded once: a retry doesn't send it twice. Rejects when PocketBase isn't connected.
const output = await step.run("PocketBase", () =>
step.ctx.integrations.invoke("pocketbase", "createRecord", {
"collection": "<collection name>",
"recordData": {}
}),
);
step.ctx.log("PocketBase answered", output);
});{
"name": "integrations",
"arguments": {
"project_id": "<project-id>",
"action": "call",
"piece": "pocketbase",
"piece_action": "createRecord",
"input": {
"collection": "<collection name>",
"recordData": {}
},
"env": "dev"
}
}curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/pocketbase/createRecord" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"collection":"<collection name>","recordData":{}}}'Actions
createRecord
Create Record. Creates a new record in a collection
| Input | Type | Description |
|---|---|---|
collectionrequired | text | The name of the PocketBase collection |
recordDatarequired | JSON | JSON object with the fields to create. E.g.: { "title": "test", "score": 123 } |
expandoptional | text | Auto expand relations. E.g.: relField1,relField2.subRelField |
fieldsoptional | text | Comma separated fields to return. E.g.: *,expand.relField.name |
deleteRecord
Delete Record. Deletes a single record from a collection
| Input | Type | Description |
|---|---|---|
collectionrequired | text | The name of the PocketBase collection |
recordIdrequired | text | ID of the record to delete |
getFullList
Get Full List. Gets all the data for a given collection
| Input | Type | Description |
|---|---|---|
collectionrequired | text | The name of the PocketBase collection |
sortoptional | text | Order attribute(s). Use - for DESC, + for ASC. E.g.: -created,id |
filteroptional | text | Filter expression. E.g.: (id='abc' && created>'2022-01-01') |
expandoptional | text | Auto expand relations. E.g.: relField1,relField2.subRelField |
fieldsoptional | text | Comma separated fields to return. E.g.: *,expand.relField.name |
getList
Get List. Gets a paginated list of records from a collection
| Input | Type | Description |
|---|---|---|
collectionrequired | text | The name of the PocketBase collection |
pageoptional | number | The page (offset) of the paginated list (default: 1) |
perPageoptional | number | Max returned records per page (default: 30) |
sortoptional | text | Order attribute(s). Use - for DESC, + for ASC. E.g.: -created,id |
filteroptional | text | Filter expression. E.g.: (id='abc' && created>'2022-01-01') |
expandoptional | text | Auto expand relations. E.g.: relField1,relField2.subRelField |
fieldsoptional | text | Comma separated fields to return. E.g.: *,expand.relField.name |
skipTotaloptional | boolean | Skip total counts query for faster results (totalItems and totalPages will be -1) |
getRecord
Get Record. Gets a single record by ID from a collection
| Input | Type | Description |
|---|---|---|
collectionrequired | text | The name of the PocketBase collection |
recordIdrequired | text | ID of the record to view |
expandoptional | text | Auto expand relations. E.g.: relField1,relField2.subRelField |
fieldsoptional | text | Comma separated fields to return. E.g.: *,expand.relField.name |
updateRecord
Update Record. Updates a single record in a collection
| Input | Type | Description |
|---|---|---|
collectionrequired | text | The name of the PocketBase collection |
recordIdrequired | text | ID of the record to update |
recordDatarequired | JSON | JSON object with the fields to update. E.g.: { "title": "test", "score": 123 } |
expandoptional | text | Auto expand relations. E.g.: relField1,relField2.subRelField |
fieldsoptional | text | Comma separated fields to return. E.g.: *,expand.relField.name |
Details
- Id
pocketbase- Category
- Data and storage
- Tags
- database, backend-as-a-service, open-source, self-hosted
- Package
@activepieces/piece-pocketbase@0.0.2- Runs
- Through the integration runner