Handle errors gracefully
Every error from the Sigma PIM API follows a consistent JSON shape. Use the error code for programmatic handling and the message for debugging and user-facing display.
Error Response Shape
All error responses return a JSON object with two fields: a machine-readable error code and a human-readable message.
error
A stable, uppercase string constant. Use this for programmatic error handling in your code. These codes will not change between API versions.
message
A human-readable description that may change over time. Suitable for logging and debugging, but do not parse or match against this field programmatically.
error field for specific handling.
Error Codes
VALIDATION_ERROR
The request body contains invalid data, is missing required fields, or fails schema validation. Check the message for details about which field is invalid.
UNAUTHORIZED
The request is missing authentication credentials or the provided credentials are invalid. This includes expired JWT tokens, invalid API keys, and missing auth headers.
PERMISSION_DENIED
The authenticated user does not have permission to perform the requested action. This is determined by the user's role and its attribute-level permissions.
NOT_FOUND
The requested resource does not exist. The message includes the resource type and the ID that was requested, making it easy to identify the missing entity.
CONFLICT
The request conflicts with the current state of the resource. This commonly occurs when creating a resource with a duplicate ID or violating a unique constraint on an attribute value.
LIMIT_EXCEEDED
The Early Access edition enforces a 500 SKU limit per workspace. This error occurs when attempting to create a new record that would exceed the limit. Delete unused records or upgrade to increase the limit.
TRANSITION_ERROR
A lifecycle state transition was rejected. This can happen when the transition is not defined in the workflow, the user's role lacks permission to perform it, or the record does not meet the minimum completeness score required by the transition gate.
INTERNAL_ERROR
An unexpected server error occurred. The message will always be generic for security reasons. If you encounter this error repeatedly, contact support with the request details and timestamp.
Error Code Summary
| HTTP Status | Error Code | Description |
|---|---|---|
400 |
VALIDATION_ERROR |
Invalid input data, missing required fields, type mismatch, or pattern violation |
400 |
TRANSITION_ERROR |
Lifecycle transition not allowed, role gate or completeness gate failed |
401 |
UNAUTHORIZED |
Missing or invalid authentication credentials |
403 |
PERMISSION_DENIED |
Authenticated but insufficient permissions for the action |
403 |
LIMIT_EXCEEDED |
Early Access 500 SKU limit reached |
404 |
NOT_FOUND |
Requested entity or resource does not exist |
409 |
CONFLICT |
Duplicate ID or unique constraint violation |
500 |
INTERNAL_ERROR |
Unexpected server error |
Handling Errors in Code
Troubleshooting
"Missing authentication" on every request
Ensure you are including either the Authorization: Bearer {token} header or the X-Sigma-ApiKey: {key} header. The auth routes (/api/v1/auth/*) and the health check (/healthz) are the only endpoints that do not require authentication.
"Invalid or expired token" after successful login
JWT tokens expire after 24 hours. Call POST /api/v1/auth/refresh with the current token before it expires. If the token has already expired, you must re-authenticate via POST /api/v1/auth/login.
"Entity limit of 500 reached"
The Early Access edition enforces a 500 SKU limit per workspace. Delete unused records to free up capacity, or contact us about upgrading your plan for higher limits.
"Transition from X to Y is not allowed"
Check that the workflow attached to the record's schema defines a valid transition between those two states. Also verify that your role has permission for the transition and that the record meets any completeness gates defined on the transition.
"Entity with id X already exists"
When creating resources, the API auto-generates unique IDs. If you are providing a custom id field, ensure it is unique. Use a different ID or omit it to let the system generate one.
Receiving 500 INTERNAL_ERROR repeatedly
This indicates an unexpected server issue. Note the exact request (method, URL, body) and timestamp, then contact support. Check GET /healthz to verify the API server is running.
Rate Limiting
The Early Access edition does not enforce rate limits. However, production deployments may introduce rate limiting in the future. When rate limiting is active, the API will return:
Retry-After and X-RateLimit-Remaining headers. Design your integration to respect these headers by implementing exponential backoff.