Skip to content

Errors

Every error from the API is an RFC 9457 problem, sent as application/problem+json:

{
"type": "https://docs.spanslice.com/api/errors#invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "The request body is invalid at /stage: Invalid option: expected one of \"created\"|\"completed\"",
"code": "invalid_request",
"errors": [
{ "detail": "Invalid option: expected one of \"created\"|\"completed\"", "pointer": "/stage" },
{ "detail": "At least 1", "pointer": "/then_actions/0/oneIn" }
]
}
Field Meaning
type A link to this page. Its fragment is the code.
title A short summary of the kind of problem.
status The HTTP status.
detail What went wrong with this request, and how to fix it where possible.
code Stable and machine-readable. Branch on this, not on title or detail.
errors For invalid_request, each problem found, so you can fix them all at once. Optional.

Each item in errors has a detail and points to the problem with one of these fields:

  • pointer: a JSON Pointer into the request body. /then_actions/0/oneIn is the oneIn field of the first action.
  • parameter: a path or query parameter, such as limit.
  • header: a request header, such as if-match.

MCP tools return the same problem as the text of a result marked as an error.

400. The request doesn’t fit the operation. The body might not be valid JSON, a field might be missing or the wrong type, or a parameter might be out of range. This code also covers requests the operation can’t carry out. For example: a service slug the project doesn’t have, a commit to an environment that doesn’t require commit, or a revert of an organization-wide setting. errors lists each problem it found.

Fix the request. Sending it again unchanged fails the same way.

401. The request has no access token, or the token is unknown, expired, or revoked. An SDK API key (ss_…) also gets this error. The API accepts only access tokens (ss_pat_…, ss_org_…). The response includes a WWW-Authenticate: Bearer header.

Send Authorization: Bearer <token>. If the token expired or was revoked, create a new one under Settings › Access tokens.

403. The token’s role is too low for the operation, such as a viewer token creating a rule. A personal token acts with the lower of its own role and yours, so it can lose access when your role changes.

Use a token with the role that the reference lists for the operation.

404. The thing doesn’t exist, or the token can’t reach it. Other organizations, and everything in them, return 404 rather than 403, as if they didn’t exist. A path that names no operation also returns 404.

Check the slugs and IDs. getMe returns the token’s organization, and the list operations return the rest.

405. The path exists, but not with this HTTP method.

Check the method in the reference.

409. The request was made against a state that has since changed. commitEnvironment and revertChange send this when the environment’s settings changed after the working_version you sent. Nothing is committed or reverted, so you never act on changes you haven’t reviewed.

Call getPendingChanges again, review the changes, and retry with the new working_version.

412. The If-Match version is stale: the rule changed after you read it. Nothing was written.

Read the rule again, reapply your change to it, and send its new version.

413. The request body is over 1 MB.

500. Something went wrong on SpanSlice’s side. SpanSlice logs the error. Retrying may help. Before you retry a write, read what it changes to see whether it took effect.

502. A service that SpanSlice depends on either failed or didn’t respond.

Retry after a short wait.