| name | planfix-api-client |
| description | Use this Planfix client to write a Planfix script, query Planfix tasks/contacts/objects, or update a Planfix custom field with this autogenerated TypeScript API client (planfix-api-client). Triggers when a task involves the Planfix REST API in this repo: instantiating the generated *Api classes via loadConfig(), reading data (getTaskList, getContactList, getObjectById), mutating data (postTaskById, postContactById, postContact), or scaffolding a new example script under examples/. |
planfix-api-client
Entry point for using this autogenerated TypeScript client for the Planfix REST API.
The client wraps the Planfix API as 17 *Api classes (100+ endpoints) generated from
swagger.json; this skill maps that surface and the repo's conventions so you can read
and mutate Planfix data and write new automation scripts.
When to use
Use this skill when a task involves the Planfix client in this repo, for example:
- "write a Planfix script to bulk-update a contact custom field"
- "query Planfix tasks/contacts" or "export Planfix contacts"
- "update a Planfix custom field" or any mutation of Planfix data
- understanding which
*Api class / method to call for a Planfix entity
Do not edit src/generated/** — it is regenerated from swagger.json (see AGENTS.md).
Quick start
examples/skill-quickstart.ts is the runnable, compile-checked reference. It loads config,
instantiates TaskApi, and performs a harmless read (getTaskList, pageSize: 1):
import { TaskApi } from '../src/generated';
import { loadConfig } from '../src/config';
const taskApi = new TaskApi(loadConfig());
const res = await taskApi.getTaskList({ getTaskListRequest: { pageSize: 1, fields: 'id,name' } });
Config comes from .env (PLANFIX_ACCOUNT, PLANFIX_TOKEN) via loadConfig() in
src/config.ts.
Workflow: goal → reference
Start from your goal and open the one matching reference:
| Your goal | Open |
|---|
Find which *Api class / endpoint covers a Planfix entity | references/api-surface.md |
| Read data — list, get-by-id, pagination, complex filters | references/querying.md |
| Write data — mass-update, custom fields, safe mutation | references/mutations.md |
| Scaffold a new example script — config, dryRun, CSV log, fieldId lookup | references/writing-scripts.md |
| Copy a runnable, compile-checked starting point | examples/example-template.ts |
| Import shared helpers (parseArgs, CSV, fieldId lookup, pagination) | examples/lib/ |
examples/example-template.ts is the canonical template to copy for a new script; it
imports its helpers from examples/lib (import, don't copy). examples/skill-quickstart.ts
remains the docs compile-check harness only.
Verification gate
Examples are outside npm run build (which compiles src/** only). Typecheck the
quickstart, the shared lib and the template — and thereby every API symbol the docs
cite — with:
npx tsc --noEmit -p tsconfig.skill.json