Skip to main content
In this guide, you publish an apartment in the sandbox: you check your data, create the listing, read it back, and add pictures. You only need a Housera account with a confirmed email.
1

Create a sandbox key

Enter the sandbox environment at Settings → API (https://staging.housera.ro/setari/api), and create a key with rights listings:read, listings:write, and media:write.The key looks like this: 12|hsr_test_…. You see it only once, right after creation, so copy it immediately to a safe location. The details are in Authentication.In the examples below, the key is stored in the environment variable HOUSERA_KEY:
2

Validate the listing

POST /listings/validate applies exactly the publishing rules but does not write anything. It’s the fastest way to check your field mapping.
The content of file apartament.json:
apartament.json
If everything is fine, you receive 200 with {"valid": true}. Otherwise, you receive 422, with each issue in its field:
The contact phone for the listing is, by default, the one in your account. If you do not have a phone in your account, send field contact_phone. The name and contact email are always those of the account.
3

Create the listing

The same body, at POST /listings. Add header Idempotency-Key with a unique value for this operation (for example, a UUID): if the request gets lost along the way and you repeat it with the same key, you receive the same listing, not two.
The response is 201 Created. The listing is in state pending: waiting for moderation.
We shortened the object: the full response also includes the location, facts, features, images, and publication data. Keep code: it is the identifier of the listing on Housera.
4

Read the listing

GET /account/listings/{code} shows you the listing with its current state, whatever state it may be in.
Header ETag (and field etag) is the version of the listing. You send it back in If-Match when you edit, so you don’t overwrite a change made in the meantime. See Editing.
5

Add pictures

PUT /listings/{code}/photos receives the complete list of pictures, in order. The first is the cover. The easiest way is to provide public HTTPS URLs, which Housera will download.
The response comes immediately, 202 Accepted, with {"queued": 3}. The pictures are downloaded and processed in the background. When media.processing from GET /account/listings/{code} becomes false again, the pictures are on the listing. For files from your system, without a public URL, see Pictures.

What’s next

The listing remains pending until a moderator approves it. Then it becomes active and appears in search. To find out without always asking, set up a webhook for listing.published and listing.rejected.

Moderation

The states of the listing and transitions.

Webhooks

You are notified immediately when a listing is published or rejected.