RESTful API
Use the RESTful API to integrate Fairu into your application
Introduction
The Fairu RESTful API provides programmatic access to your digital assets, folders, galleries, and more. Use it to build integrations, automate workflows, or sync Fairu with your existing systems.
Interactive documentation
Explore the complete API reference with interactive examples at:
The interactive documentation allows you to:
- Browse all available endpoints
- See request and response schemas
- Test API calls directly in your browser
Authentication
The RESTful API uses Bearer token authentication. Include your API token in the Authorization header of every request.
Obtaining an API token
- Navigate to Settings → API Tokens in your Fairu dashboard
- Click Create token
- Give your token a descriptive name
- Select the required permissions (abilities)
- Copy and securely store your token
API tokens are scoped to specific abilities like file::view, file::create, folder::read, etc.
Base URL
All API requests should be made to:
Available resources
The API provides CRUD operations for all major Fairu resources:
- Files – Upload, retrieve, update, search, and delete files
- Folders – Create and manage folder structures
- Galleries – Create and share image galleries
- Copyrights – Manage copyright information
- Licenses – Track and assign licenses
- Workflows – Automate file processing
- Users & Roles – Manage team access
- Disks – Configure sync disk connections
See the interactive documentation for detailed endpoint specifications.
Response format
All responses are returned as JSON.
Pagination
List endpoints support pagination with page and per_page parameters:
Error responses
Errors return appropriate HTTP status codes with details:
| Status | Description |
|---|---|
| 400 | Bad request – Invalid parameters |
| 401 | Unauthorized – Invalid or missing token |
| 403 | Forbidden – Insufficient permissions |
| 404 | Not found – Resource doesn't exist |
| 422 | Validation error – Invalid input data |
| 500 | Server error – Something went wrong |
Best practices
- Use appropriate scopes – Only request the token abilities you need
- Handle pagination – Always paginate through large result sets
- Cache responses – Cache data that doesn't change frequently
SDKs
We provide official SDKs to make integrating with the Fairu API easier:
The SDKs handle authentication, request formatting, and error handling for you.
Need help?
- Interactive docs: fairu.app/restful/docs
- SDKs: fairu.app/sdk
- GraphQL API: For more complex queries, consider using our GraphQL API
- Support: Contact us via the support form in your dashboard