API Error Codes

A complete reference for all error codes returned by the Yuki API. Use this guide to understand what went wrong and how to resolve it quickly.

Error Response Format

All errors returned by the Yuki API follow RFC 7807 – Problem Details for HTTP APIs. Understanding this structure helps you handle errors programmatically.

{
    "type": "https://httpstatuses.com/422",
    "title": "Validation Error",
    "status": 422,
    "errors": {
        "validation:invalid_input": [
            "The email field is not a valid email address."
        ]
    },
    "traceId": "00-ad89db24d04645ed383f4b90c1913602-0b19ca914794928b-00",
    "errorCode": "validation:invalid_input"
}
FieldTypeDescription
typestringA URI that identifies the error type. Points to the relevant HTTP status documentation.
titlestringA short, human-readable summary of the error type.
statusintegerThe HTTP status code for this error.
errorsobjectA map of error codes to arrays of descriptive messages. There may be more than one entry when multiple validations fail.
traceIdstringA W3C Trace Context identifier for the request. Always include this when contacting support.
errorCodestringThe primary error code, matching the key in errors. Use this for programmatic error handling.

HTTP Status Codes

The Yuki API uses standard HTTP status codes to indicate the outcome of each request.

HTTP StatusMeaningWhen it occurs
200 OKSuccessThe request was processed successfully and a response body is returned.
201 CreatedResource createdA new resource was successfully created.
204 No ContentSuccess, no bodyThe request succeeded but there is no response body (e.g. DELETE).
400 Bad RequestInvalid requestThe request is malformed, missing required fields, or contains invalid values.
401 UnauthorizedAuthentication failureThe access token is missing, expired, or invalid.
403 ForbiddenAuthorization failureThe authenticated user does not have permission to perform this action.
404 Not FoundResource not foundThe requested resource does not exist.
409 ConflictState conflictThe request conflicts with the current state of the resource.
422 Unprocessable EntityValidation errorThe request body is syntactically correct but semantically invalid.
429 Too Many RequestsRate limit exceededThe client has sent too many requests in a given time window.
500 Internal Server ErrorServer errorAn unexpected condition occurred on the server side.
503 Service UnavailableService downThe API is temporarily unavailable. Retry after a short delay.

Error Code Reference

The following tables list all error codes grouped by category.


Authentication

Error CodeHTTP StatusDescriptionResolution
authentication:unauthorized401The request is missing a valid access token, or the token is invalid or expired.Include a valid Authorization: Bearer <token> header. Re-authenticate via Visma Connect to obtain a fresh token.
authentication:forbidden403The authenticated user does not have permission to perform this action.Verify that your application and user have been granted access to the requested resource in Yuki.

Validation

Error CodeHTTP StatusDescriptionResolution
validation:invalid_input422The request contains one or more fields with invalid values.Check the errors map for field-level messages that describe what is wrong with each value.
validation:missing_required_field400A required field is absent from the request body.Ensure all required fields are included in your request payload.

Companies

Error CodeHTTP StatusDescriptionResolution
companies:not_found404The specified company (administration) does not exist.Verify the administration ID and that it is accessible by your application.
companies:validation_failed422The request to create or modify a company failed validation.Check the errors map for details on which fields are invalid.
companies:update_failed409The company could not be updated due to a conflict with its current state.Retrieve the current state of the company and retry the operation with valid data.

Domains

Error CodeHTTP StatusDescriptionResolution
domains:not_found404The specified domain does not exist.Verify the domain identifier and that it belongs to the correct administration.
domains:validation_failed422The domain request failed one or more validation rules.Check the errors map for field-level validation messages.
domains:creation_failed422The domain could not be created.Review the request payload and ensure it meets all domain creation requirements.
domains:update_failed409The domain could not be updated due to a conflict with its current state.Retrieve the current state of the domain and retry the operation with valid data.

Portals

Error CodeHTTP StatusDescriptionResolution
portals:not_found404The specified portal does not exist.Verify the portal identifier and that it is accessible by your application.
portals:validation_failed422The portal request failed one or more validation rules.Check the errors map for details on which fields are invalid.

Rate Limiting

Rate limiting is enforced at the API gateway level and returns HTTP 429 Too Many Requests. These responses do not include an application-level errorCode field. Check the Retry-After response header for the number of seconds to wait before retrying. If you are consistently hitting rate limits, contact Yuki Support to review your quota.


Server Errors

Error CodeHTTP StatusDescriptionResolution
server:internal_error500A known internal error occurred on the server.This is not related to your request. Retry after a short delay. If the issue persists, contact Yuki Support and provide the traceId from the error response.
server:unexpected_error500An unhandled exception occurred that does not map to a known error type.Retry after a short delay. If the issue persists, contact Yuki Support and provide the traceId.

Handling Errors in Your Application

Follow these best practices to handle API errors gracefully in your integration.

Check the HTTP status code first

Use the HTTP status code as the primary signal to branch your error handling logic before inspecting the code field.

const response = await fetch('https://api.yukisoftware.com/v1/administrations', {
  headers: { Authorization: `Bearer ${accessToken}` }
});

if (!response.ok) {
  const body = await response.json();
  console.error(`[${body.errorCode}] ${body.title} (traceId: ${body.traceId})`);

  switch (body.errorCode) {
    case 'authentication:unauthorized':
      // Token missing, invalid or expired — redirect to login and re-authenticate
      break;
    case 'authentication:forbidden':
      // User lacks permission — show access denied message
      break;
    case 'validation:invalid_input':
    case 'validation:missing_required_field':
      // Surface the per-field messages to the user
      console.error(body.errors);
      break;
    case 'companies:not_found':
    case 'domains:not_found':
    case 'portals:not_found':
      // Resource does not exist — handle gracefully
      break;
    default:
      // Generic fallback — log traceId for support
      console.error('traceId:', body.traceId);
      break;
  }
}

Implement retry logic with back-off

For transient errors (429, 503, 502), retry the request with exponential back-off.

async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fetch(url, options);
    if (response.status !== 429 && response.status !== 503) {
      return response;
    }
    // Wait before retrying: 1s, 2s, 4s ...
    const delay = Math.pow(2, attempt) * 1000;
    await new Promise(resolve => setTimeout(resolve, delay));
  }
  throw new Error('Max retries reached');
}

Log the traceId

Always log the traceId from error responses. Should you need to contact support, providing this value allows Yuki's team to investigate the exact request in question.

Need Help?

If you encounter an error not listed here, or if you believe a server error is impacting your integration, reach out to the Yuki support team.

  • Support portal: yukisoftware.com/support
  • Include in your report: the traceId, the endpoint called, the request payload (redacted of sensitive data), and the timestamp of the error.