Skip to navigation

Write a news draft

Partner key only. Creates a draft (201); publishing is a separate call. Recipients are restaurantSlugs (the API rejects restaurantIds) or audienceAll: true; with a TEST key only sandboxes and never audienceAll: true, with a LIVE key only real restaurants in restaurantSlugs. Bound to the key’s environment: a TEST key only reaches news whose recipients are all sandboxes (never audienceAll); a LIVE key reaches all news that is not bound to TEST (including audienceAll news, which on publishing is locked to the sandboxes as well). Needs a key created by an owner or administrator. Changes count in the partner’s bucket of 60 per 10 minutes (shared with LettBestilt Partner). Every change is logged with ids and field names, never the text.

Authentication

AuthorizationBearer

The partner key (lbp_test_… or lbp_live_…), sent as Authorization: Bearer lbp_… and created in LettBestilt Partner under Partner key. It belongs to the whole partner, not to a restaurant, and only works against /api/v1/partner. Server to server only: a request with an Origin header is rejected with 403 FORBIDDEN, and the key must never be in a browser. A TEST key sees and creates only sandboxes; LIVE keys work once LettBestilt Partner is open. A suspended or archived partner, a revoked key and a restaurant key (lbs_…) here give 401 UNAUTHORIZED; an expired key gives 401 KEY_EXPIRED.

Request

This endpoint expects an object.
titlestringRequired1-200 characters
bodystringRequired1-20000 characters

Markdown. Images only from LettBestilt (otherwise 422 IMAGE_NOT_ALLOWED).

levelenumRequired
Allowed values:
audienceAllbooleanRequired

true = all the restaurants the partner can reach when the news is published (locked then). Only with a LIVE key; with a TEST key, true gives 422.

sendEmailbooleanOptional

Also email the owners when the news is published. Default true.

restaurantSlugslist of stringsOptional

The recipients as the restaurants’ slugs (required when audienceAll is false). TEST key: sandboxes only; LIVE key: real restaurants only. A slug that is not one of the partner’s restaurants in the key’s environment that can be reached now gives 404 RESTAURANT_NOT_FOUND. LettBestilt Partner calls the field restaurantIds; the API rejects that name.

expiresAtdate or nullOptional

Hidden after this day (Oslo time, YYYY-MM-DD). null = shown until archived.

Response

The draft.
dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error