API reference

Ur Next Door API v1 reference: base URL, authentication, request and response envelopes, headers, and every endpoint grouped by area.

View as Markdown

The reference pages are generated from the OpenAPI document, so they always match the API. This page covers what every endpoint shares.

Base URL

Text
https://urnextdoor.com/api/v1

Always the apex domain. A community subdomain answers 421 wrong_host. All paths in the reference are relative to this URL.

Authentication

Send your key in Authorization: Bearer und_sk_... or X-API-Key: und_sk_.... Never in the URL. See Authentication.

Requests

  • Bodies are JSON objects with Content-Type: application/json, up to 256 KB. POST /media also accepts multipart/form-data, and its JSON body may be up to 12 MB (for base64 images).
  • Content bodies (body, a community's description) are HTML. See Formatting.
  • Times are ISO 8601 with an offset or Z. Scheduling stores UTC and responses use Z.
  • Ids are numbers. Slugs and usernames are strings.
  • POST and DELETE accept an optional Idempotency-Key header. See Idempotency.

Successful responses

Every success is a JSON object that starts with "ok": true and ends with the request_id. Responses that describe an item with a url also carry web_url, the full address to open or share.

JSON
{
  "ok": true,
  "id": 41,
  "slug": "five-easy-ways-to-save-water-at-home",
  "url": "/posts/five-easy-ways-to-save-water-at-home",
  "web_url": "https://urnextdoor.com/posts/five-easy-ways-to-save-water-at-home",
  "item": { "id": 41, "type": "post", "slug": "five-easy-ways-to-save-water-at-home" },
  "request_id": "9f8e7d6c5b4a3921"
}

Error responses

Every error, whatever the Accept header, is:

JSON
{
  "ok": false,
  "error": "title and body are required",
  "code": "validation_failed",
  "errors": { "body": "Body is required." },
  "request_id": "a1b2c3d4e5f60718"
}

errors appears only on validation failures, with one message per field. Codes and what to do about each are on Errors.

Headers

HeaderDirectionWhenMeaning
Authorization or X-API-KeyRequestEvery call except the OpenAPI documentYour key
Content-TypeRequestCalls with a bodyapplication/json, or multipart/form-data for media
Idempotency-KeyRequestOptional on POST and DELETEMakes a retry safe
X-Request-IdResponseEvery responseThe request's id, also in the body as request_id
Cache-Control: no-storeResponseEvery API response except the OpenAPI documentNever cache answers
X-RateLimit-LimitResponseQuota-counted callsToday's limit for that action
X-RateLimit-RemainingResponseQuota-counted callsWhat is left today
X-RateLimit-ResetResponseQuota-counted callsUnix seconds of the next UTC midnight
Retry-AfterResponse429Seconds to wait
Idempotent-Replayed: trueResponseA replayed answerYou got the stored answer of an earlier identical request

Versioning

The version is in the path (/api/v1). Write clients that ignore response fields and error codes they do not recognise, so a new optional field never breaks them. Every change is listed in the changelog.

Last updated