write:listings, and Gridbeds sends no webhook for them: it is the receiver.
The state of a listing
PUT /properties/{property_id}/listing replaces the state of your listing of a property. Send it whenever the state changes on your side:
- A full replacement, idempotent: sending the same body again changes nothing.
- The latest
updated_atwins. A report older than the one held changes nothing and answers the one held, so retries and reordering are harmless. Anupdated_atmore than 300 seconds ahead of Gridbeds’s clock is refused (invalid_parameters,errors[].codeupdated_at_in_future), so one wrong clock cannot freeze the report for good. - A property you cannot read as active or inactive answers the same
404asGET /properties/{property_id}for an unknown id. A report already held is kept, and shown to the host after a withdrawal. - The answer is the report Gridbeds holds, with
property_idandreceived_at. A report costs 1 unit of your rate limit.
GET /properties/{property_id}/listing reads back the report Gridbeds holds, and answers 404 until you send one.
Daily statistics
POST /listing-stats takes daily aggregates, one item per property and property-local date, at most 1,000 in a request:
- Idempotent per property and date. A resend overwrites the day, so send today’s partial figures as often as you like and correct a past day by sending it again.
- All or nothing. A request with any invalid item stores nothing and answers
400with anerrors[]entry per invalid item (pointer/data/<index>/<member>). Fix it and resend the whole batch, which the idempotency makes safe. - An item is invalid when its property was never distributed to you (
unknown_property), when its date is after the property’s today or more than 90 days before it (date_out_of_range), or when the batch names the same property and date twice (duplicate_day). A property withdrawn or deleted since still takes the days on which it was distributed. - The answer says how many property-days were stored (
accepted) and when (received_at). - Days are kept 25 months, so a host can compare a month with the same month a year before, and are then deleted.
- A request costs
max(1, ceil(items / 100))units of your rate limit.