Authentication
Ralph uses token-based authentication for API access. Each user has an auto-generated personal token.Obtaining Your Token
You can obtain your token either by visiting your profile page or by sending a request to theapi-token-auth endpoint:
If you don’t have an API token assigned, the above request will generate one automatically.
Using Your Token
Include your API token in theAuthorization header for each request:
API Versioning
The API requires clients to specify the version in theAccept header:
Output Formats
Ralph API supports:- JSON (default) - For programmatic access
- HTML preview - Browse to
https://<YOUR-RALPH-URL>/api/in your browser for an interactive preview
HTTP Methods
The following methods are available in the API:| Method | On a Collection | On a Single Resource |
|---|---|---|
| GET | Get full list of resources | Get resource details |
| POST | Add a new resource | - |
| PUT | - | Edit the resource (all data required) |
| PATCH | - | Edit the resource (only changed data required) |
| DELETE | - | Remove the resource |
Getting Resources
Get a Single Resource
Use HTTP GET to retrieve details of a specific resource:Get a List of Resources
Saving Resources
Update a Resource (PATCH)
Use PATCH to update specific fields without providing all data:Important points when saving resources:
- To set a related object (foreign key), pass its ID (e.g.,
"service_env": 12) - To set many-to-many relations, pass an array of IDs (e.g.,
"licences": [1, 2, 3]) - You can use text values for choice fields (e.g.,
"status": "damaged"), even if stored as numbers
Create a Resource (POST)
Filtering
Ralph API supports multiple query filters to help you find the exact resources you need.Check Available Filters
Send an OPTIONS request to see which fields support filtering:filtering field in the response.
Filter Types
Exact Match Filter
Filter by exact field value:Lookup Filters
Use Django’s__ convention for advanced lookups:
__startswith- Starts with__endswith- Ends with__contains- Contains (case-sensitive)__icontains- Contains (case-insensitive)__lte- Less than or equal__gte- Greater than or equal__in- In a list of values
Extended Filters
Extended filters work across multiple fields in polymorphic models likeBaseObject:
Tag Filters
Filter by one or more tags. Multiple tags are combined with AND logic:Transitions API
The Transitions API allows you to execute workflow transitions on assets.List Available Transitions
Get all available transitions for a specific asset:Get Transition Parameters
Use OPTIONS to see what parameters a transition requires:Execute a Transition
Run a transition by POSTing to the transition endpoint:Available Resources
Ralph exposes the following resource endpoints:Assets & Inventory
/api/data-center-assets/- Data center assets/api/back-office-assets/- Back office assets/api/base-objects/- All assets (polymorphic)/api/asset-models/- Hardware models/api/manufacturers/- Hardware manufacturers/api/categories/- Asset categories/api/warehouses/- Warehouses
Data Center Infrastructure
/api/racks/- Server racks/api/server-rooms/- Server rooms/api/data-centers/- Data centers/api/accessories/- Rack accessories/api/access-cards/- Physical access cards/api/access-zones/- Access control zones
Services & Environments
/api/services/- Business services/api/service-environments/- Service environments/api/environments/- Environments (prod, test, etc.)/api/configuration-modules/- Configuration modules/api/configuration-classes/- Configuration classes
Virtual & Cloud
/api/virtual-servers/- Virtual machines/api/cloud-hosts/- Cloud instances/api/clusters/- Virtualization clusters
Networking
/api/networks/- IP networks/api/ip-addresses/- IP addresses/api/network-environments/- Network environments
Licenses & Support
/api/licences/- Software licenses/api/software/- Software catalog/api/supports/- Support contracts/api/base-object-licences/- Asset-license assignments
Telephony
/api/sim-cards/- SIM cards
Security
/api/ssl-certificates/- SSL/TLS certificates
Domains
/api/domains/- Domain registrations/api/domain-contracts/- Domain contracts
User Management
/api/users/- Users/api/groups/- Groups/api/regions/- Regional divisions/api/teams/- Support teams
Visit
https://<YOUR-RALPH-URL>/api/ in your browser for an interactive list of all available endpoints and to explore the API.Error Handling
The API uses standard HTTP status codes:200 OK- Request succeeded201 Created- Resource created successfully204 No Content- Resource deleted successfully400 Bad Request- Invalid request data401 Unauthorized- Missing or invalid authentication token403 Forbidden- User lacks permission for this resource404 Not Found- Resource not found500 Internal Server Error- Server error