PocketBase API

SkillSecurity

Operate PocketBase via its REST API. Use for CRUD operations on collections, authentication, querying records with filters, and managing PocketBase data.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the PocketBase API skill

What this skill tells your AI

The instructions your AI receives, as published by spinspire/pocketbase-sveltekit-starter in .agents/skills/pb-api/SKILL.md and read by ahel’s review.

Reference: https://pocketbase.io/docs/

Operate PocketBase via its REST API.

Credentials

Create .env from .env.example (never commit .env):

PB_URL=http://localhost:8090
PB_SUPERUSER_EMAIL=admin@example.com
PB_SUPERUSER_PASSWORD=your-password

If credentials aren't available via env vars, ask user explicitly before proceeding.

Quick Start

# Auth
curl -X POST http://localhost:8090/api/collections/_superusers/auth \
  -H 'Content-Type: application/json' \
  -d '{"identity":"admin@example.com","password":"secret"}'

# List records
curl http://localhost:8090/api/collections/posts/records \
  -H 'Authorization: Bearer TOKEN'

# Filter records
curl "http://localhost:8090/api/collections/posts/records?filter=status='published'&sort=-created&expand=author"

Key Endpoints

MethodEndpointPurpose
POST/api/collections/:collection/authAuth with password
POST/api/collections/:collection/auth-with-passwordLogin
GET/api/collections/:collection/recordsList records
POST/api/collections/:collection/recordsCreate record
PATCH/api/collections/:collection/records/:idUpdate record
DELETE/api/collections/:collection/records/:idDelete record

Filter Syntax

status = 'published'
author.id = 'abc123'
created >= '2024-01-01'
user.name ~ 'john*'

Use @collection.name.field for cross-collection filters.

SDK Usage

import PocketBase from 'pocketbase'

const pb = new PocketBase('http://localhost:8090')
await pb.collection('posts').authWithPassword('user@test.com', 'secret')

// List with filter
const records = await pb.collection('posts').getList(1, 50, {
  filter: "status = 'published'",
  sort: '-created',
  expand: 'author,tags'
})

API Rules

  • null → superuser only
  • "" → public access
  • Start locked, open selectively
  • Use @request.auth, @collection, @now in rules

Signals

GitHub stars
507
Forks
76
Last commit
Aug 2026
Advanced
Catalog kind
skill
Gateway key
pb-api
Source
github.com/spinspire/pocketbase-sveltekit-starter