Skip to main content

Response Format

Every Hypermid API response uses a consistent envelope format. This makes it straightforward to handle responses, errors, and metadata across all endpoints.

Response Envelope

All endpoints return a JSON object with three top-level fields:
Exactly one of data or error will be non-null. You can use this as a discriminator in your code.

Success Response

When a request succeeds, data contains the response payload and error is null:

Error Response

When a request fails, error contains the error details and data is null:

Error Object

Meta Object

The meta object is always present and contains:

Error Codes

For detailed error handling strategies, see the Error Handling Guide.

Handling Responses in Code

HTTP Status Codes

Hypermid uses standard HTTP status codes alongside the error.code field: