API V2
Contents
API V2#
For: developers
The official OpenSPP REST API (V2) provides a modern, secure, and standards-compliant interface for integrating with OpenSPP. Built on FastAPI, it replaces the legacy XML-RPC API with OAuth 2.0 authentication, consent-based access control, external identifier references, and RFC 9457 error responses.
How to use this section#
Read API V2 Overview for the design philosophy and core concepts
Read the reference pages for the features you need:
Authentication for OAuth 2.0 and scopes
External Identifiers, Consent Management, Error Handling for cross-cutting concerns
API Resources, Search and Filtering, Batch Operations for core operations
Follow the Tutorial: build a Python API client to tie everything together in a working Python client
Consult Studio API Integration and the extension APIs as you need them
Prerequisites#
Familiarity with REST APIs and HTTP
Ability to issue HTTP requests from your integration environment (Python, JavaScript, curl, etc.)
An OpenSPP deployment with
spp_api_v2installedAn API client registered in OpenSPP with the scopes you need (see Authentication)
When do you need API V2?#
The API is the primary integration surface between OpenSPP and external systems. Use it when you need to:
Requirement |
API V2 |
Alternative |
|---|---|---|
Read/write registrants from an external system |
Yes |
|
Trigger operations from a portal or mobile app |
Yes |
|
Bulk-import beneficiary data |
Yes ( |
|
Integrate with DCI-compliant systems |
Yes |
DCI client module |
Automate change requests across systems |
Yes |
|
Extend OpenSPP with internal Python code |
||
Add custom program logic |
||
Build no-code CR types |
Core topics#
Topic |
Description |
|---|---|
Design philosophy, base URL, core principles, FHIR-inspired patterns |
|
OAuth 2.0, JWT tokens, scopes, and rate limiting |
|
Namespaced external IDs instead of database IDs |
|
Privacy-first consent mechanisms and field-level access |
|
Individual, Group, Program, and ProgramMembership resources |
|
Query parameters, pagination, sorting, and advanced filters |
|
Transaction bundles, batch operations, and bulk export |
|
Error responses (RFC 9457) and status codes |
|
Build a working Python API client end-to-end |
|
Studio custom fields and CEL variables via API |
Extension APIs#
These modules add domain-specific endpoints when installed alongside the core spp_api_v2 module:
Topic |
Module |
Description |
|---|---|---|
|
Cash/in-kind entitlements and distribution cycles |
|
|
Product catalog and distribution locations |
Note
API V2 completely replaces the legacy XML-RPC API. New integrations should use API V2.
openspp.org