Skip to content

Errors

TekMemo Cloud APIs return structured errors designed to be predictable and easy to log.

Error shape

A standard error response follows the { error, meta } envelope format:

json
{
  "error": {
    "code": "bad_request",
    "message": "The request payload was invalid.",
    "details": {
      "reason": "Missing required field: 'projectId'"
    }
  },
  "meta": {
    "requestId": "req_123abc"
  }
}

Common error classes

CodeHTTP StatusMeaning
bad_request400The request was malformed or missing required parameters.
unauthorized401Authentication failed. Check your TEKMEMO_API_KEY.
forbidden403You do not have permission to access this resource or project.
not_found404The requested memory, project, or node was not found.
method_not_allowed405The HTTP method used is not supported for this route.
conflict409A sync conflict occurred or the resource already exists.
validation_error422The input failed validation (e.g., content too long).
rate_limited429Too many requests.
internal_error500An unexpected internal error occurred on the server.

Success and List Envelopes

Success responses also use a standard envelope with a meta object containing the requestId for debugging.

Single Resource

json
{
  "data": { "id": "note_123", "content": "..." },
  "meta": { "requestId": "req_456" }
}

Resource List (Pagination)

For list endpoints, the meta object includes pagination details.

json
{
  "data": [...],
  "meta": {
    "requestId": "req_789",
    "pagination": {
      "nextCursor": "cursor_xyz"
    }
  }
}

Security and redaction

By default, the @tekmemo/cloud-client strips upstream provider secrets and internal tokens from error messages before throwing them.

Rule: Never blindly log raw HTTP response bodies if you aren't using the official client, as some providers may echo keys back on failure.

Released under the MIT License.