The ProblemDetails envelope
Every non-success response from the Raise API uses one of two envelope shapes — both based on RFC 7807. The baseProblemDetails envelope:
The validation variant
For validation errors (typically400 Bad Request on a write endpoint), the response uses HttpValidationProblemDetails, which extends ProblemDetails with a per-field error map:
errors object is keyed by field path with arrays of error messages. Use it to surface field-specific feedback in your integration’s UI rather than just showing the top-level title.
Documented status codes
The Raise OpenAPI spec formally documents five success/error status codes across the surface:401 is documented on every endpoint, since every endpoint requires Bearer authentication. Documented 400 responses appear on most endpoints; 404 appears on resource-specific paths (/api/Donor/{donorId}, etc.).
What each endpoint’s 400 and 404 mean
The generic “Bad Request” and “Not Found” labels are only the starting point. In the API reference, each endpoint’s 400 and 404 responses describe what that particular endpoint rejects — which parameter or field was at fault, whether the stored record changed, and whether retrying can help. A few patterns worth knowing:
- On writes, a
400means nothing was persisted.Update a Campaignleaves the stored campaign untouched;Transfer a Donor Giftleaves the gift with its current donor. - On deletes, a
400can mean the record still has dependencies. For campaigns, custom fields, and projects, read the dependency count first and reassign the dependent records with the matching replace endpoint. - On
Cancel a Recurring Gift, a400means the schedule exists but isn’t cancellable — including when it’s already cancelled — while a404means the ID doesn’t resolve at all. Re-read the schedule rather than retrying. - On nested donor resources (addresses, contact methods, emails, phone numbers), a
404also covers the case where the child record exists but belongs to a different donor. Thedetailfield names the record that was missing. - On existence checks like
Check if Segment Code Exists, a400means the query parameter itself was rejected — a code that simply isn’t in use returns200with a negative result.
Process a Donation Payment, Capture a Lead, the Query endpoints, and a few others — document no error responses beyond 401. They still return the ProblemDetails envelope; the spec just doesn’t enumerate their failure cases, so treat 400 and 404 as possible there too.
Status codes that occur but aren’t in the spec
A few status codes aren’t formally documented in the Raise spec but partner integrations will encounter them. Handle them defensively even though the spec is silent.
For each of these, the response body should still follow the
ProblemDetails envelope — though the detail and type fields may be less informative than for documented errors.
401 used to be in this list; it’s now documented on every endpoint. Future updates to the spec are expected to add explicit documentation for 403, 429, and 500. Until then, code defensively as if every endpoint could return these status codes — because it can.Handling errors in code
The pattern: check the status code, parse the body if non-2xx, route by status class.
JavaScript
204 No Contentis handled explicitly. Some delete and cancel endpoints return204with no body — callingresponse.json()on an empty body throws. Detect204and returnnullinstead.- The body is attempted to be parsed as JSON. Most errors return JSON; some (gateway errors, network issues) may not. Fall back to the status text.
- The error carries structured detail. Downstream handlers can switch on
err.statusfor retry decisions and surfaceerr.problem.detailfor user-facing messages.
Routing by status class
For partner integrations doing retries, route errors by category — see Error Recovery Patterns for the full pattern. The Raise-specific summary:
Retrying a
400 won’t make it succeed — the request body needs to change. Retrying a 401 won’t make it succeed — the token needs to be replaced. Retrying a 500 usually will succeed within a few attempts.
Validation errors in detail
When the spec documents400 Bad Request on a write endpoint, the most common cause is field-level validation. The response includes the errors map keyed by field name:
JavaScript
What the detail field gives you
The detail field is the most useful diagnostic in the ProblemDetails envelope. Three patterns for using it well:
Log it on every non-2xx
JavaScript
Surface it to your UI carefully
detail is human-readable but written for an API consumer (developer), not an end user. It may contain technical jargon, internal field names, or unhelpful messages like "An error occurred while processing your request." Sanitize before surfacing to non-technical users.
A reasonable pattern: use errors for field-level user-facing messages; use detail for logs and developer-facing error contexts only.
Don’t switch on it
The exact text ofdetail is not a stable contract. The platform may rephrase messages, translate them, or improve them. Code that parses or matches on detail strings is brittle — switch on status codes and structured type URIs instead.
Network and TLS errors
Errors that occur before the request reaches Raise are network-layer issues — they don’t produce a ProblemDetails response because the server never saw the request:
Most clients surface these as exceptions before any HTTP response is available. Handle them as transient errors with retry — see Error Recovery Patterns for the retry pattern.
Where to go next
Rate Limits
The detail on
429 responses and how to avoid them.Error Recovery Patterns
The retry strategy, dead-letter handling, and circuit breaker patterns for production integrations.
Authentication
The deeper coverage of
401 causes and remediation.Pagination and Filtering
Other error patterns specific to paginated reads.