Skip to main content
Ralph exposes many resources and operations through a RESTful web API that can be used for both querying the database and populating it with data. The API is built on Django REST Framework.

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 the api-token-auth endpoint:
Response:
If you don’t have an API token assigned, the above request will generate one automatically.

Using Your Token

Include your API token in the Authorization header for each request:

API Versioning

The API requires clients to specify the version in the Accept 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:

Getting Resources

Get a Single Resource

Use HTTP GET to retrieve details of a specific resource:
Response:

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:
Look for the filtering field in the response.

Filter Types

Exact Match Filter

Filter by exact field value:

Lookup Filters

Use Django’s __ convention for advanced lookups:
Common lookup operators:
  • __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
See Django Field lookups documentation for more operators.

Extended Filters

Extended filters work across multiple fields in polymorphic models like BaseObject:

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:
Response:

Get Transition Parameters

Use OPTIONS to see what parameters a transition requires:
Response:

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 succeeded
  • 201 Created - Resource created successfully
  • 204 No Content - Resource deleted successfully
  • 400 Bad Request - Invalid request data
  • 401 Unauthorized - Missing or invalid authentication token
  • 403 Forbidden - User lacks permission for this resource
  • 404 Not Found - Resource not found
  • 500 Internal Server Error - Server error
Error responses include a JSON body with details:

Rate Limiting

Ralph API does not impose rate limits by default, but administrators may configure rate limiting in their deployment. Contact your Ralph administrator for details.