We do not handle life-threatening emergencies: call 112.

+34 611 673 280

DevelopersAPI v1

Guides

Errors

The error format (RFC 9457), what each HTTP status means and the list of API error types with their cause and fix.

Last reviewed: October 1, 2026

Format

Every error follows the Problem Details standard (RFC 9457), with Content-Type: application/problem+json:

JSON
{
  "type": "/errors/validation-error",
  "title": "Error de validación",
  "status": 400,
  "detail": "estimatedMinutes must be divisible by 10",
  "instance": "/api/integrations/v1/visits",
  "errors": [
    { "field": "estimatedMinutes", "message": "estimatedMinutes must be divisible by 10" }
  ],
  "timestamp": "2026-10-01T09:10:00.000Z"
}
FieldDescription
typeStable identifier of the error. It's a relative path (/errors/…). Your code should decide what to do based on status and type, never on the text.
titleShort, human-readable summary. Its wording may change.
statusThe same HTTP status code as the response.
detailSpecific explanation of this case ("El aviso AV-000123 está en estado EN_ROUTE…"). For showing to your operator or logging.
instanceThe path of the request that failed.
errorsValidation errors only: one item per field, with its path (patient.documentNumber, address.postalCode).
timestampWhen it happened.

Some errors include additional fields with data about the case. Ignore any you don't recognise.

The errors[] messages in format validation errors come straight from the validator, in English (must be a UUID, should not exist): they're meant for developers, not end users. Business errors (detail), on the other hand, are worded so they can be shown to users.

When you contact us about an error, include the type, the detail, the instance, the timestamp and the X-Serad-Environment header: with those we can track it down right away.

HTTP status codes

CodeMeaningRetry?
200 OKSuccess. When creating a visit, it's also the response to a repeat with the same Idempotency-Key.—
201 CreatedVisit created.—
400 Bad RequestThe request isn't valid: a malformed field, a service type you don't have, a business rule.No: fix it.
401 UnauthorizedThe key is missing, invalid, revoked or expired, or belongs to the other environment.No.
403 ForbiddenThe key is valid but lacks the required scope.No.
404 Not FoundThe visit (or the report) doesn't exist or isn't yours. Also sandbox paths in production.No.
409 ConflictThe current status doesn't allow it (cancelling a visit that is en route) or there's an idempotency conflict.Only idempotency-in-progress.
429 Too Many RequestsYou've exceeded the rate limit.Yes, after Retry-After.
500 Internal Server ErrorOur fault.Yes, with exponential backoff.
502 / 503 / 504The API is temporarily unavailable (deployment, maintenance).Yes, with exponential backoff.

Error types

Authentication and rate limits

typeStatusCauseFix
/errors/provider-api/invalid-key401There's no X-Api-Key header, or the key doesn't exist, is revoked or expired, or your organisation is inactive.Check that you're sending the full key in X-Api-Key. If it's correct, email us with its prefix.
/errors/provider-api/wrong-environment401Test key against production, or production key against the sandbox.Use srd_test_… with https://sandbox-api.saludenruta.es/api/integrations/v1 and srd_live_… with https://api.saludenruta.es/api/integrations/v1. See environments.
/errors/provider-api/scope-missing403The key doesn't have the scope the endpoint requires (detail says which).Ask for a key with that scope. See scopes.
/errors/provider-api/rate-limited429You've exceeded the key's requests per minute.Wait Retry-After seconds. Use webhooks instead of polling.

Idempotency

typeStatusCauseFix
/errors/provider-api/idempotency-key-invalid400The Idempotency-Key is longer than 200 characters.Use a shorter key.
/errors/provider-api/idempotency-key-reused409You've used the same Idempotency-Key with a different body in the last 24 h.Generate one key per visit; if it's a retry, send exactly the same body.
/errors/provider-api/idempotency-in-progress409The first request with that key is still being processed.Wait a few seconds and retry with the same key.

Creating visits

typeStatusCauseFix
/errors/validation-error400One or more fields have the wrong format (missing required field, length, enum…) or there are fields the API doesn't recognise (property … should not exist). errors[] says which.Fix the fields listed. See request fields.
/errors/provider-api/service-type-required400You sent neither serviceTypeCode nor serviceTypeId.Send serviceTypeCode (recommended).
/errors/provider/service-type-not-allowed400That service type isn't in your catalogue (it has no price in your current rate card) or the code doesn't exist.Read your catalogue and use one of its code values.
/errors/provider/insurer-not-managed400The insurerId isn't one of your insurers, or you aren't an intermediary.Use an id from catalog.insurers in the same environment, or don't send insurerId.
/errors/visits/external-ref-required400Your contract requires a case number and you didn't send one.Send externalRef.
/errors/visits/invalid-schedule400The appointment slot is inconsistent (an end without a start, or an end before the start).Send scheduledFrom and estimatedMinutes, without scheduledTo.
/errors/visits/schedule-in-past400The appointment starts more than 15 minutes in the past.Check the date and time zone of scheduledFrom.
/errors/visits/schedule-beyond-horizon400The appointment is more than 90 days ahead.Schedule it closer, or send it later.
/errors/visits/provider-inactive400Your organisation is inactive and can't create new visits.Contact us.
/errors/patients/document-number-required400You set documentType (DNI, NIE or passport) without documentNumber.Send the number, or documentType: "NONE".
/errors/patients/document-not-allowed400You sent documentNumber with documentType: "NONE".Set the correct document type.
/errors/patients/document-invalid400The DNI or NIE has an invalid format or its check letter doesn't match.Double-check the document with the patient.
/errors/patients/not-found404The patientId doesn't exist or isn't from one of your visits.Send the patient's details in patient.
/errors/dates/in-future400A date that can't be in the future is (e.g. birthDate, or dateFrom in the list).Fix the date.
/errors/dates/range-invalid400In the list, dateTo is earlier than dateFrom.Fix the range.

Retrieval, cancellation and reports

typeStatusCauseFix
/errors/visits/not-found404The visit doesn't exist, belongs to another provider or is in the other environment.Check the id and the environment. You can look it up by externalRef.
/errors/validation-error400The id in the path isn't a UUID.Use the visit's id, not its code.
/errors/provider/visit-not-cancellable409The visit is no longer PENDING or ASSIGNED (the unit is en route or on site, or the visit has already finished or been cancelled).Call the dispatch centre (+34 611 673 280). See cancel.
/errors/provider/report-not-available404There's no signed and shared report, or the patient hasn't consented.Wait for the report.shared webhook. Without consent there will be no report.

Sandbox

typeStatusCauseFix
/errors/sandbox/only-in-sandbox404You called /sandbox/… in production.Those paths only exist at https://sandbox-api.saludenruta.es/api/integrations/v1.
/errors/sandbox/visit-not-advanceable400You asked to move a visit to an earlier or disallowed status (e.g. from EN_ROUTE to ASSIGNED).See manual simulation.

Server errors

typeStatusCauseFix
/errors/internal-error500Unexpected error on our side.Retry with exponential backoff. If it persists, email us with the timestamp and the instance.
/errors/rate-limited429Platform-wide limit (separate from your key's limit).Same as provider-api/rate-limited: wait for Retry-After.

Something missing or not matching what you see? Email our technical team: info@saludenruta.es.