Skip to content

Errors RFC 7807

Fredrik Dettner edited this page Oct 12, 2026 · 5 revisions

Errors (RFC 9457 Problem Details)

Every error response is a Problem Details document (RFC 9457, which replaced RFC 7807 with the same format), served as application/problem+json. OpenAPI and MCP tooling understand it natively.

The shape

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "Invalid query parameter.",
  "status": 400,
  "detail": "Unknown sort field(s): foo.",
  "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
  "invalidFields": ["foo"]
}
  • type identifies the kind of problem — branch on it, not on title. The write surface uses stable Sedis types (below); other errors use the HTTP status's RFC link.
  • status always equals the HTTP status code. detail is a human-readable explanation (English).
  • Sedis-specific members — traceId, invalidFields, errors, existingSedisId, rateLimitRemaining — are extension members at the top level, as RFC 9457 §3.2 defines them.
  • traceId is on every problem: a W3C / Application Insights correlation id — quote it when you contact Sedis support.

Status codes you'll see

Status Meaning Typical cause Members
400 Bad Request The request is malformed Unknown ?sort=/?fields= value; bad ?quarterId=; malformed geometry filter; a body that is not valid JSON or misses a required member; missing Idempotency-Key invalidFields[] or errors{}
401 Unauthorized Authentication failed Missing/invalid/revoked X-Api-Key —
403 Forbidden The key is not licensed for the product Rare; cross-customer access is 404, not 403 (below) —
404 Not Found Not found or not yours Unknown sedisId/id, or one owned by another customer —
409 Conflict The write collides with existing state A name already used by another of your property units or Samlingar; an upload for that value date already submitted; a request with the same Idempotency-Key still running; a DELETE of shared data (shared-data) existingSedisId / existingUploadId, existingStatus
412 Precondition Failed If-Match names an older version Someone changed the property unit since your GET —
413 Content Too Large The body is too large An upload over 5 MB — split it —
422 Unprocessable Content The body is understood but breaks a rule See Writing data; nothing was saved. Also: an Idempotency-Key reused for a different request errors[]
429 Too Many Requests Rate limited Burst or sustained cap exceeded rateLimitRemaining (+ Retry-After header)
500 Internal Server Error Server fault Unexpected — quote the traceId —

400 or 422? 400 means the request could not be read as intended — its syntax or shape is wrong. 422 means it was read fine but the content breaks a rule (an unknown property unit, a value of the wrong type, a point outside its municipality). A 422 always lists every broken rule at once.

Problem types

The write surface uses stable type URIs. They are part of the contract — new ones may be added, existing ones never change.

type Status Meaning
https://api.sedis.se/problems/validation 422 The body breaks one or more rules; see errors[]. Nothing was saved.
https://api.sedis.se/problems/conflict 409 The write collides with existing state.
https://api.sedis.se/problems/precondition-failed 412 If-Match names an older version.
https://api.sedis.se/problems/idempotency-key-reused 422 The Idempotency-Key was already used for a different request. Use a new key, or resend the original request unchanged to get its replay.
https://api.sedis.se/problems/shared-data 409 The data is shared — it counts in the Sedis objects other customers compare with — and cannot be withdrawn through the API. Contact Sedis support. A shared value can still be corrected with PATCH, which Sedis reviews.

The errors list (422)

{
  "type": "https://api.sedis.se/problems/validation",
  "title": "The property unit has errors.",
  "status": 422,
  "detail": "2 errors. Nothing was saved.",
  "traceId": "00-…",
  "errors": [
    { "pointer": "#/municipalityId", "code": "missingRequiredValue",
      "detail": "municipalityId is required with officialDesignation for a Swedish property: …" },
    { "pointer": "#/geometry/coordinates", "code": "geometryOutOfRange",
      "detail": "[6581099, 674322] is outside SWEREF 99 TM's area of use. Coordinates are [easting, northing] — check whether they are swapped." }
  ]
}

Each entry — the shape of RFC 9457 §3's example:

  • pointer — a JSON Pointer into your request body, as a URI fragment (#/rows/3/values/EB0).
  • code — stable and machine-readable; map it to your own handling. Codes are only ever added.
  • detail — what is wrong, in English, for a person reading the log.

Error codes

code Where Meaning
nameRequired property units name is missing or blank.
invalidValue any The value is not allowed — too long, an unknown id, an address.countryCode that is not ISO 3166-1, an unsupported geometryCrs, a value of the wrong JSON type for its parameter, a value date that is not accepted. detail says which.
missingRequiredValue any A required value is missing — e.g. municipalityId with a Swedish officialDesignation, or EA0/EB0 when submitting an upload.
geometryOutOfRange property units The point is outside the coordinate system's range — usually swapped coordinates.
geometryOutsideMunicipality property units A Swedish point that does not lie in its municipality.
geometryOutsideCountry property units A Swedish point outside Sweden, or a non-Swedish property unit whose point lies in Sweden.
unknownSedisId uploads No property unit with that sedisId exists for you.
nameNotFound uploads No property unit of yours has that name. Create it with POST property-units.
ambiguousName uploads The name matches several of your property units — use sedisId.
sedisIdNameMismatch uploads sedisId and name name different property units.
duplicateProperty uploads The same property unit is on two rows.
unknownParameterCode uploads Not a parameter code (codes are case-sensitive).
notBaseParameter uploads A calculated parameter — only base-data parameters can be uploaded.
pendingChanges uploads You have changes of this property unit's shared values at that value date waiting for Sedis's review (see pending-changes). Submit the upload once Sedis has reviewed them, or correct them with PATCH instead.
changedAfterUpload uploads You changed or removed this property unit's values at that value date through the API after the upload was made, so publishing it would put older values back. Seen by Sedis when publishing; upload again.

Other members

  • invalidFields (on 400 for a query) — the exact query value(s) that were wrong:

    { "status": 400, "detail": "Unknown field(s): gemoetry.", "invalidFields": ["gemoetry"] }
  • rateLimitRemaining (on 429) — how many requests remain in the current window. Pair it with the Retry-After header (Rate limits).

404 vs 403 — the cross-customer rule

Reading or writing a resource that belongs to another customer returns 404, not 403 — even with If-Match. A 403 (or a 412) would confirm the resource exists; 404 is indistinguishable from "never existed", so it leaks nothing. See Multi-tenant isolation.

No stack traces

Error bodies never contain stack traces or internal details. If something is genuinely broken on our side (500), capture the traceId and send it to Sedis support.

Clone this wiki locally