Skip to content

Errors

import { Aside } from ‘@astrojs/starlight/components’;

The Melbora API returns standard HTTP status codes with a JSON body:

{
"error": "human-readable message",
"details": null
}

error is always a string — branch on the HTTP status code plus the message text. details is optional and contains structured context for the more elaborate failures (e.g. the failed validator output on a 400).

The request body or query failed validation. Common messages:

Message containsCauseFix
Body requiredMissing JSON body on POST/PUTSend a JSON object
Invalid JSON bodyBody was non-JSON or malformedValidate JSON before sending
Invalid request body — <field>: <issue>Zod schema validation failedRead the field/issue pair printed in error
Invalid path params — <field>: <issue>URL path param failed validationCheck path against /v1/<resource>/{id} shape
name is required, slug is required, etc.Missing field on a hand-validated routeAdd the field
slug already existsSlug collision (globally unique)Pick a different slug
must be #RRGGBB hexNon-hex color valueUse #RRGGBB format
Message containsFix
Missing token / No Authorization headerSend Authorization: Bearer vc_pat_...
Invalid tokenToken revoked or copied truncated; mint a fresh one
Your session is staleRe-login (client-only — Cognito subject vanished underneath the JWT)
Message containsFix
Admin role requiredUse an admin token, or hit the client-scoped equivalent endpoint
Not authorized to ...The Website is owned by a different client
Website does not have the <feature> feature enabledvantage websites features <id> --<feature> first
... is not available on the <tier> tierUpgrade the SEO/feature tier
Message containsFix
Website <id> not foundVerify with vantage websites list
Client <id> does not existThe clientId is wrong / not yet created
Domain not foundCheck vantage domains list <id>
Pending transfer not foundThe transfer was cancelled or already accepted

The API folds conflicts into 400 rather than 409:

Message containsCause
Someone else saved while you were editingContent SHA mismatch on PUT /content — refetch + retry

Hand-rolled rate limiting isn’t documented per-endpoint yet. Assume ~10 req/s per token as a safe ceiling for sustained traffic. Back off and retry on any non-2xx that looks transient.

500 returns include the error message plus optional details. Retry idempotent reads (GET) freely; for non-idempotent writes confirm the side effect first (vantage websites get <id> after a 500 from create).

502 / 503 / 504 usually mean Lambda was cold, throttled, or timed out. Retry with exponential backoff. If 503s persist, check AWS Service Health for us-east-1.

The TypeScript SDK throws VantageApiError:

import { VantageClient, VantageApiError } from "@vantageconnections/sdk";
try {
await vc.websites.get("wb_does_not_exist");
} catch (err) {
if (err instanceof VantageApiError) {
console.log(err.status); // 404
console.log(err.message); // "Website wb_does_not_exist not found"
console.log(err.body); // { error: "...", details: ... }
} else {
throw err;
}
}

Branch on err.status (the stable signal). err.message is the human-readable message — fine for logging, less stable for programmatic switching. err.body is the parsed response body for fine-grained access to details when present.

The CLI prints the error message and exits with code 1. Run any command with --help to see usage if you suspect a syntax issue. Run vantage selftest first to isolate whether the problem is credentials, the API, or the specific command.