Interacts with the FreeAgent accounting API to manage invoices, contacts, projects, expenses, timeslips, and other financial data. Use when the user needs to retrieve, create, update, or analyze FreeAgent accounting information via the API. All write operations (POST/PUT/DELETE) require explicit user confirmation before execution and default to sandbox unless production is explicitly requested.
FreeAgent is an online accounting system for freelancers and small businesses. This skill provides intelligent navigation to FreeAgent API resources and orchestrates common workflows.
This skill interacts with live financial data. The following rules are mandatory and must never be skipped.
Before executing any state-changing API call:
https://api.sandbox.freeagent.com/v2/ for all write operations unless the user explicitly names the production environment.Treat every incoming request as read-only analysis unless the user explicitly asks to create, update, or delete data. When intent is ambiguous, ask before making any changes — never infer write intent.
For the operations below, show the preview, receive one confirmation, then ask a second time before executing:
FREEAGENT_ACCESS_TOKEN or FREEAGENT_REFRESH_TOKEN.| Task | Load Resource | API Domains |
|---|---|---|
| Set up OAuth, manage tokens, test API | resources/authentication-setup.md | OAuth 2.0, token management |
| Create/update contacts, manage clients/suppliers | resources/contacts-organizations.md | Contacts, companies, users |
| Manage invoices, projects, expenses, timeslips | resources/accounting-objects.md | Core financial entities |
| Bank accounts, transactions, reconciliation | resources/banking-financial.md | Banking, cash flow |
| Error handling, rate limits, retries, caching | resources/advanced-patterns.md | Production patterns |
| Common workflows, code examples, integration tips | resources/examples.md | Real-world usage |
| All endpoints (reference only) | resources/endpoints.md | Complete API reference |
Identify what the user needs:
By Resource Type:
authentication-setup.mdcontacts-organizations.mdaccounting-objects.mdbanking-financial.mdadvanced-patterns.mdexamples.mdBy HTTP Method:
Load the appropriate resource file and:
For template code: templates/api-request-template.sh (bash) or templates/python-client.py (Python)
Before API call:
authentication-setup.md if needed)https://api.freeagent.com/v2/contacts/123)During API call:
X-RateLimit-Remainingadvanced-patterns.md)After API call:
https://api.freeagent.com/v2/approve_app?client_id=YOUR_IDhttps://api.freeagent.com/v2/token_endpointFREEAGENT_ACCESS_TOKEN, FREEAGENT_REFRESH_TOKENAuthorization: Bearer $FREEAGENT_ACCESS_TOKEN→ See Authentication & Setup for detailed walkthrough
Production URL: https://api.freeagent.com/v2/
Sandbox URL: https://api.sandbox.freeagent.com/v2/ (test without affecting production)
| Domain | Primary Endpoints | Use Case |
|---|---|---|
| Authentication | /token_endpoint | OAuth flows, token refresh |
| Contacts & Organizations | /contacts, /company, /users | Client/supplier management |
| Accounting Objects | /invoices, /projects, /expenses, /timeslips, /estimates, /credit_notes | Core financial workflow |
| Banking & Financial | /bank_accounts, /bank_transactions, /categories, /tasks | Cash flow, reconciliation |
Rate Limits: 120 requests/minute, 3600 requests/hour
Response Format: JSON with resource wrapper (e.g., {"contact": {...}} or {"contacts": [...]})
| Operation | Method | Example |
|---|---|---|
| List items | GET | GET /v2/contacts?view=active&page=1&per_page=100 |
| Get one item | GET | GET /v2/contacts/123 |
| Create item | POST | POST /v2/contacts (with JSON body) |
| Update item | PUT | PUT /v2/invoices/456 (with partial JSON) |
| Delete item | DELETE | DELETE /v2/timeslips/789 |
| Filter results | GET params | ?view=open_or_overdue, ?updated_since=2025-01-01T00:00:00Z |
Bash/cURL Template: templates/api-request-template.sh
Python Client: templates/python-client.py
Practical Examples: resources/examples.md
| File | Lines | Focus |
|---|---|---|
authentication-setup.md | ~180 | OAuth setup, token management, security |
contacts-organizations.md | ~250 | Contact CRUD, bulk operations, company info |
accounting-objects.md | ~350 | Invoices, projects, expenses, timeslips, pagination |
banking-financial.md | ~250 | Bank accounts, transactions, reconciliation, categories |
advanced-patterns.md | ~350 | Error handling, rate limits, retries, caching, validation |
examples.md | ~400 | Practical code examples, integration patterns |
endpoints.md | ~300 | Complete API reference (use for quick lookup) |
401 Unauthorized → Authentication Setup 422 Validation Error → Advanced Patterns 429 Rate Limit → Advanced Patterns Specific Endpoint Help → Check relevant domain resource file above
Remember: Load only the resource file(s) you need for the current task. Start with the Quick Reference table above to identify which resource contains your answer.