What’s included
| File | Description |
|---|---|
Collection (keystone-api.postman_collection.json) | All platform API endpoints organized by resource, with example bodies and test scripts |
Environment (keystone-api.postman_environment.json) | Variables for base URL, Auth0 config, and resource IDs |
- Instructions - Submit, list, get, and cancel settlement instructions
- Settlements - Create, list, get, view events, and submit compliance decisions
- Templates - List and view settlement templates
- Webhooks - Full CRUD, test delivery, rotate secrets, view delivery history
- Environments - Create, list, get, update, and deactivate platform environments
- Sessions - Create and revoke frontend session tokens
Setup
1. Download the files
Download both files from the repository:2. Import into Postman
- Open Postman and click Import (top-left)
- Drag both JSON files into the import dialog, or click Upload Files and select them
- Click Import to confirm
3. Select the environment
- In the top-right corner of Postman, click the environment dropdown
- Select KeyStone API - Production
4. Set your credentials
- Click the eye icon next to the environment dropdown to open the environment editor
- Set the Current Value for:
client_id- Your Auth0 M2M client ID (from the KeyStone dashboard)client_secret- Your Auth0 M2M client secret
- If you have a specific environment ID, set
environment_idas well
How authentication works
The collection uses a pre-request script at the collection level that automatically handles Auth0 M2M token management:- Before every request, the script checks if a valid
access_tokenexists - If the token is missing or expired, it calls the Auth0
/oauth/tokenendpoint using yourclient_idandclient_secret - The token is cached in the environment with a
token_expirytimestamp - The token refreshes automatically 60 seconds before expiry
Using the collection
Typical workflow
A common exploration flow follows this order:- List templates - See what settlement templates are available
- Create an environment (if you don’t have one) - Set up an isolated environment
- Submit an instruction - Submit the seller side of a bilateral settlement
- Submit the counter-instruction - Submit the buyer side (change
roletobuyer,directiontoreceive) - List settlements - The matched instructions create a settlement automatically
- Get settlement by ID - View the settlement details and current state
- Get settlement events - Watch the settlement progress through the state machine
Environment variables auto-populate
Several requests automatically save resource IDs to environment variables after a successful response:| Request | Saves variable |
|---|---|
| Submit instruction | instruction_id |
| Create settlement | settlement_id |
| Create webhook endpoint | webhook_endpoint_id |
| Create environment | environment_id |
| Create session token | session_token_id |
Customizing for staging
To point the collection at the staging API, update the environment variables:| Variable | Production | Staging |
|---|---|---|
base_url | https://api.keystoneos.xyz | https://api-staging.keystoneos.xyz |
auth0_domain | auth.keystoneos.xyz | auth-staging.keystoneos.xyz |
auth0_audience | https://api.keystoneos.xyz | https://api-staging.keystoneos.xyz |
Response tests
Every request includes Postman test scripts that validate:- Status codes - Each request checks for the expected HTTP status (201 for creates, 200 for reads, 204 for deletes)
- Response structure - List endpoints verify
itemsandtotalpagination fields - Resource fields - Detail endpoints check for expected properties like
id,state,parties
Tips
Use Collection Runner
Run the entire collection in sequence to test a full settlement lifecycle from instruction to settlement events.
Duplicate for environments
Duplicate the Postman environment to maintain separate configs for production, staging, and local development.
Check the console
Open the Postman Console (View > Show Postman Console) to inspect the Auth0 token request and debug authentication issues.
Fork the collection
Fork the collection in your Postman workspace so you can customize requests while still pulling updates from the source.