User Guide
About the REST API
The REST API provides a programmatic interface to interact with our services, allowing you to stamp files, inline data, or existing CIDs. This API is designed to be flexible and secure, supporting various data formats and authentication methods.
Getting Started with the REST API
To begin using the REST API, you need to have a valid API token for authentication. The API is accessible via standard HTTP methods and returns JSON responses.
How to Obtain an API Key
Log in to your vBase account at https://app.vbase.com
In your User Profile, navigate to "Account Settings"
Copy the API key from this screen and store it securely
Base URL
https://app.vbase.com/api/v1/About the OpenAPI Description for the REST API
Our REST API is documented using OpenAPI, providing a comprehensive description of available endpoints, parameters, and response formats. You can explore the API using the Swagger UI, which offers an interactive interface for testing API calls.
Access the Swagger UI at:
For programmatic clients (agents, SDKs), fetch the OpenAPI/Swagger JSON at:
The Swagger UI route also supports:
Authenticating to the REST API
Authentication is required for all API requests. Use the Bearer token method by including an Authorization header in your requests. The format should be:
Keeping your API credentials secure
Never share your API token publicly
Store your API token securely
Use environment variables to store your API token
Never commit API tokens to version control
API Endpoints
Verify User Collection
POST /v1/collections/verify
This endpoint verifies a stamped collection against blockchain records for the authenticated user.
Request Formats
Choose the request body format with Content-Type:
application/json: send the verify request JSON bodytext/csv: send the raw CSV string in the body
For JSON requests, top-level collection_name and user_address are optional. If they are omitted or set to null, the backend will try to infer collection metadata from the submitted records.
The context object is also optional and may be omitted or set to null. Each entry in objects may omit file_name or set it to null.
For CSV requests, the leading metadata section collection_name,user_address,collection_timezone is optional.
Legacy multipart/form-data uploads are also supported with a .csv or .json file in the file field.
Use Accept: application/json for the response.
Example Requests
JSON body:
CSV body:
Legacy multipart upload:
Example Response
Response (200):
Each entry in collections identifies the verified collection by:
name: collection namecid: collection/set CIDuser_address: resolved owner address used for verificationmatched_receipts: blockchain receipts matched to submitted objects for this collectionunmatched_objects: submitted objects with no matching blockchain receipt for this collectionunmatched_receipts: blockchain receipts with no matching submitted object for this collection
Upload Stamped File
POST /v1/stamps/upload-stamped-file
This endpoint allows you to upload a file that has been previously stamped and verified against blockchain records.
Overview
The upload stamped file endpoint performs comprehensive validation to ensure the file exists in the blockchain for the specified user and collection. It extracts the object CID from the file, verifies blockchain records, and uploads the file with proper validation.
Request Parameters
collection_name
String
Yes
Collection name (case-insensitive, must not be empty)
file
File
Yes
Previously stamped file to upload
Note: User address is automatically determined from the authenticated user's profile, so no user_address parameter is needed.
Validation Process
The endpoint performs the following validations in sequence:
Input Validation: Validates collection name is not empty
User Address Resolution: Automatically determines user address from authenticated user's profile
Collection Lookup: Finds the collection by name (case-insensitive) for the authenticated user
CID Extraction: Extracts object CID from the uploaded file
Blockchain Verification: Verifies the file exists in blockchain records for the user's address
Record Validation: Ensures exactly one matching record exists
File Upload: Uploads the file with blockchain validation
Response Codes
201
File uploaded successfully
File passes all validations and uploads successfully
400
Invalid input or validation failed
Empty collection name or missing required parameters
404
Collection not found or no blockchain records found
Collection doesn't exist or no matching blockchain records
409
Multiple blockchain records found (conflict)
Multiple records found for same user/collection combination
500
File processing, blockchain, or upload errors
CID extraction fails, blockchain errors, or upload failures
Example Requests
Successful Upload:
Response (201):
Error Responses:
Collection Not Found (404):
No Blockchain Records (404):
Multiple Records Conflict (409):
File Processing Error (500):
Error Handling
The API uses structured error responses with appropriate HTTP status codes to help you handle different error scenarios:
4xx Client Errors: Issues with your request (missing parameters, invalid data, not found)
5xx Server Errors: Internal processing issues (file processing, blockchain connectivity, upload failures)
Always check the HTTP status code first, then parse the error message for specific details about what went wrong.
Best Practices
Validate Input: Ensure collection names are not empty before sending requests
Handle Errors: Implement proper error handling for all status codes
File Validation: Only upload files that have been previously stamped
Collection Management: Ensure collections exist before attempting uploads
Retry Logic: Implement retry logic for 5xx errors (server issues)
Rate Limiting: Respect API rate limits to avoid throttling
Last updated

