PocketBase

List and manage records in PocketBase collections.

Data and storageAPI key6 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (6)
  4. createRecord
  5. deleteRecord
  6. getFullList
  7. getList
  8. getRecord
  9. updateRecord
  10. Details

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.

Workflow
// 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);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "pocketbase",
    "piece_action": "createRecord",
    "input": {
      "collection": "<collection name>",
      "recordData": {}
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
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

InputTypeDescription
collectionrequiredtextThe name of the PocketBase collection
recordDatarequiredJSONJSON object with the fields to create. E.g.: { "title": "test", "score": 123 }
expandoptionaltextAuto expand relations. E.g.: relField1,relField2.subRelField
fieldsoptionaltextComma separated fields to return. E.g.: *,expand.relField.name

deleteRecord

Delete Record. Deletes a single record from a collection

InputTypeDescription
collectionrequiredtextThe name of the PocketBase collection
recordIdrequiredtextID of the record to delete

getFullList

Get Full List. Gets all the data for a given collection

InputTypeDescription
collectionrequiredtextThe name of the PocketBase collection
sortoptionaltextOrder attribute(s). Use - for DESC, + for ASC. E.g.: -created,id
filteroptionaltextFilter expression. E.g.: (id='abc' && created>'2022-01-01')
expandoptionaltextAuto expand relations. E.g.: relField1,relField2.subRelField
fieldsoptionaltextComma separated fields to return. E.g.: *,expand.relField.name

getList

Get List. Gets a paginated list of records from a collection

InputTypeDescription
collectionrequiredtextThe name of the PocketBase collection
pageoptionalnumberThe page (offset) of the paginated list (default: 1)
perPageoptionalnumberMax returned records per page (default: 30)
sortoptionaltextOrder attribute(s). Use - for DESC, + for ASC. E.g.: -created,id
filteroptionaltextFilter expression. E.g.: (id='abc' && created>'2022-01-01')
expandoptionaltextAuto expand relations. E.g.: relField1,relField2.subRelField
fieldsoptionaltextComma separated fields to return. E.g.: *,expand.relField.name
skipTotaloptionalbooleanSkip total counts query for faster results (totalItems and totalPages will be -1)

getRecord

Get Record. Gets a single record by ID from a collection

InputTypeDescription
collectionrequiredtextThe name of the PocketBase collection
recordIdrequiredtextID of the record to view
expandoptionaltextAuto expand relations. E.g.: relField1,relField2.subRelField
fieldsoptionaltextComma separated fields to return. E.g.: *,expand.relField.name

updateRecord

Update Record. Updates a single record in a collection

InputTypeDescription
collectionrequiredtextThe name of the PocketBase collection
recordIdrequiredtextID of the record to update
recordDatarequiredJSONJSON object with the fields to update. E.g.: { "title": "test", "score": 123 }
expandoptionaltextAuto expand relations. E.g.: relField1,relField2.subRelField
fieldsoptionaltextComma 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