Skip to main content

AI Guard API Codes

The AI Guard API uses the response codes and error messages listed in the following table.

All error responses conform to RFC 9457 Problem Details and are returned with a Content-Type of application/problem+json. Every error response includes the type, title, status, detail, and correlation id. Validation errors additionally include a fields[] array.

Code

Status

Description

200

OK

The request was successful. This response code is returned by GET (single resource and list) and PUT requests. GET requests retrieving a list of resources return it in a JSON object in the following format: { "items": [] }.

201

Created

The request was completed successfully, and a new resource has been created. This response code is returned by POST requests.

204

No Content

The request was completed successfully. No response body is returned. This response code is used by DELETE requests.

400

Bad Request

The request is invalid due to malformed JSON, an unknown field, or a request body or parameter validation error. When applicable, the response includes a fields[] array.

401

Unauthorized

The bearer token is missing or expired, has an invalid signature, or fails issuer or audience validation. The response includes a WWW-Authenticate: Bearer header.

403

Forbidden

The request is authenticated, but the token's scopes or role do not grant permission to perform the requested operation.

404

Not Found

The requested route or target resource (identified by ID or name) could not be found.

409

Conflict

The resource already exists (e.g., a duplicate name during creation), or the delete operation was blocked because the resource is referenced by another active configuration. Where supported, append deleteReferences=true as a query parameter to remove references before deleting the resource.

429

Too Many Requests

The client has exceeded the API rate limit by sending too many requests within a given time period. The request can be retried after a wait period.

500

Internal Server Error

An unexpected error occurred in the service or a downstream dependency. The response includes a correlation id for troubleshooting. No internal implementation details are exposed.

HTTP Status Codes by Operation​

Every operation can return 400, 401, 403, 429, and 500. The following table lists additional codes per operation type.

OperationHTTP MethodSuccess CodeAdditional Error Codes
ListGET200404
Get by ID or name, or referential checkGET /{id}200404
CreatePOST201409
UpdatePUT /{id}200404
DeleteDELETE /{id}204404, 409
Actions (enable, disable, and regenerate)POST /{id}/actions200409 (on conflict)