Reference
Errors
Every error is JSON with one envelope and a real HTTP status. code is stable and machine-readable — branch on it; message explains what to fix and may be reworded. A few errors add fields alongside (today only scope, on community-report 429s).
error envelope
{
"error": {
"code": "invalid_request",
"message": "Unknown parameter `grades`."
}
}with an extra field
{
"error": {
"code": "rate_limited",
"message": "…",
"scope": "establishment"
}
}| Status | Code | Meaning | Retry? |
|---|---|---|---|
| 400 | invalid_request | A parameter is missing, out of range, malformed, or unknown (v1.1 list endpoints reject parameters they don't recognize — the message names the offender). Also: a required `X-Device-Id` header is missing, or a JSON body doesn't match its schema. | Don't — fix the request. The message says what's wrong. |
| 401 | unauthorized | Missing, malformed, unknown, or revoked API key. A key that isn't `dd_live_`/`dd_test_` + 40 hex characters is treated as missing. | Don't — check the key and the header name. |
| 404 | not_found | No record behind that identifier (CAMIS, BBL, slug, photo or avatar id). With a dd_test_ key, also returned for an id outside the fixture city. | Don't. Batch endpoints never 404 — misses land in `meta.notFound`. |
| 409 | conflict | `PATCH /v1/profile` only: the username is already taken. | Pick another name (`GET /v1/profile/username-check` first). |
| 429 | rate_limited | Your key's daily limit is spent (resets midnight UTC); the shared playground key's per-IP cap (200/day) is spent; or a community-report cap / the 14-day username rename throttle applies. Community-report 429s add a `scope` field: "establishment" or "device". | After midnight UTC for daily limits; 429s never count against your quota. |
| 500 | internal | Our fault — usually an upstream city data source timing out. | Yes, with exponential backoff (e.g. 1s, 2s, 4s). |
Handling errors
a resilient client (JavaScript)
async function dd(path, init = {}, attempt = 0) {
const res = await fetch(`https://www.dailydog.ai/api${path}`, {
...init,
headers: { Authorization: `Bearer ${process.env.DAILYDOG_KEY}`, ...init.headers },
});
if (res.ok) return res.status === 204 ? null : res.json();
const { error } = await res.json();
// Only 500s are worth retrying; 429 means "come back after midnight UTC".
if (res.status === 500 && attempt < 3) {
await new Promise((r) => setTimeout(r, 1000 * 2 ** attempt));
return dd(path, init, attempt + 1);
}
throw Object.assign(new Error(error.message), { status: res.status, code: error.code });
}- Batch endpoints never 404 on a bad id — misses come back in
meta.notFoundso one bad id never fails the whole sweep. - A 429 isn't always your key's quota. Community-report caps (3 per establishment, 25 citywide, per device per UTC day) and the 14-day username rename throttle also answer 429 — check
X-RateLimit-Remainingto tell them apart. See rate limits. - 401 on a key that looks right? Keys are
dd_live_ordd_test_plus 40 hex characters; anything else (a truncated paste, stray quotes) is treated as missing. - Stuck? Contact us with the endpoint, the time (UTC), and the error body.