Errors and problem codes
API errors use RFC 9457 Problem Details with the application/problem+json media type. Use the stable, machine-readable code field in application logic. The detail field contains human-readable context.
{
"type": "https://docs.portfolio.exchange/external-api/v1/problems/authentication-failed",
"title": "Authentication failed",
"status": 401,
"detail": "Valid authentication is required.",
"instance": "urn:uuid:b495f901-5456-4df6-a4da-cc750638c66b",
"code": "authentication-failed",
"requestId": "b495f901-5456-4df6-a4da-cc750638c66b",
"violations": null
}
Preserve X-Request-Id when contacting support. If you send a valid X-Correlation-Id, the API echoes it for your own tracing.
Requests that reach the API receive a new X-Request-Id. This includes authentication failures and empty 404 responses when the API is disabled or the requested major is unsupported. Those 404 responses have no Problem Details body. The API echoes a valid X-Correlation-Id and omits an invalid one. API Gateway errors may use another response format.
X-Correlation-Id is optional and must contain exactly one value of 1–64 visible ASCII characters, without spaces or control characters. Use an opaque diagnostic identifier, such as a randomly generated UUID. You may reuse it to group related attempts; it does not provide authentication, authorization, or idempotency.
Valid correlation values are logged unchanged and may also be stored in audit records. Do not put names, email addresses, account details, financial information, access tokens, passwords, or other secrets in this header. Format validation does not detect sensitive content or mask it for you.
Problem catalogue
The type URI remains a stable identifier and opens the matching entry below. Match the code, rather than the human-readable detail, in your integration.