> ## Documentation Index
> Fetch the complete documentation index at: https://api.housera.ro/llms.txt
> Use this file to discover all available pages before exploring further.

# Moderation and Listing States

> What happens to a listing after you submit it, what you can change through the API, and how to find out the result.

On Housera, each new listing is verified by a person before it appears in search. There is no shortcut through the API: the listing you create goes into moderation, just like one added from the form.

## States

The `status` field of a listing has one of the values below.

| State | What it means | Appears in search |
| - | - | - |
| `draft` | Draft started in the portal and not submitted. No drafts are created through the API. | No |
| `pending` | Submitted, awaiting moderation. | No |
| `active` | Approved and published. | Yes |
| `rejected` | Rejected by moderation, with a reason. You can correct it and resubmit. | No |
| `paused` | Paused by you. You can reactivate it at any time, without new moderation. | No |
| `unconfirmed` | Removed from search because you didn't confirm in time that the property is still available. Confirmation is done from your account. | No |
| `hidden` | Hidden by moderation. | No |
| `sold` | Sold or rented. The listing page remains accessible, but the listing no longer appears in search. | No |

## What is moderated

**A new listing.** `POST /listings` and `PUT /listings/ref/{ref}` with a new id create the listing with state `pending`. After approval, it becomes `active`; if rejected, it becomes `rejected`.

**An edit on a published listing.** When you edit a listing `active` (or `paused`, `unconfirmed`), the public version remains unchanged, and your edit awaits approval:

* you receive `202 Accepted` instead of `200`;
* `moderation.edit_pending` becomes `true`;
* after approval, the edit applies to the listing and `edit_pending` returns to `false`;
* if the edit is rejected, the listing remains with the old version, `edit_pending` returns to `false`, and the reason appears in `moderation.rejection_reason`.

The photos submitted for a published listing follow the same path: they join the edit awaiting moderation.

**What is not moderated.** A yet unpublished listing (`pending`) is modified directly and remains in the moderation queue. Pausing, reactivating, and marking as sold do not go through moderation.

## API Transitions

| Action | Endpoint | From state | To state |
| - | - | - | - |
| Create | `POST /listings` | – | `pending` |
| Edit | `PATCH /listings/{code}` | `pending` | remains `pending` |
| Resubmit | `PATCH /listings/{code}` | `rejected`, `draft` | `pending` |
| Edit with moderation | `PATCH /listings/{code}` | `active`, `paused`, `unconfirmed` | same state, with `edit_pending: true` |
| Pause | `POST /listings/{code}/pause` | `active` | `paused` |
| Reactivate | `POST /listings/{code}/resume` | `paused` | `active` |
| Sold or rented | `POST /listings/{code}/sold` | `active`, `paused` | `sold` |
| Delete | `DELETE /listings/{code}` | `draft`, `rejected`, `paused`, `unconfirmed` | deleted (`204`) |

A few rules to remember:

* **Incorrect state means `404`.** For example, `POST /listings/{code}/resume` on a listing `active` or `DELETE` on a listing `active`. An active listing must first be paused, then deleted.
* **A refusal with a reason means `409 listing_action_refused`.** For example, a listing with open reports cannot be deleted until the reports are closed. The reason is in `detail`.
* **A listing `hidden` or `sold` can no longer be edited.**
* **A resubmission without any changes is rejected** (`422`): a rejected listing, sent back identically, would be rejected again for the same reason.
* **Marking as sold renounces the edit** that was awaiting moderation, if there was one.

## Rejection

A rejected listing has in `moderation`:

```json theme={null}
{
  "moderation": {
    "edit_pending": false,
    "rejection_reason": "Pozele nu corespund proprietății. Te rugăm să încarci fotografii ale apartamentului.",
    "rejection_codes": ["photos"]
  }
}
```

`rejection_reason` is text for people. `rejection_codes` are stable codes that you can use in your system:

| Code | Reason |
| - | - |
| `photos` | Photos do not match the property. |
| `content` | Title or description lacks real content. |
| `contact_in_text` | Contact details in title or description. |
| `price` | Unrealistic price. |
| `fake` | Suspicion of fake listing. |

The list may be empty when the moderator has only written a free reason. To resubmit the listing, you correct it with `PATCH /listings/{code}`: the listing returns to `pending`.

## How to find out the result

You have three ways, from the best to the simplest:

<CardGroup cols={3}>
  <Card title="Webhooks" icon="bell" href="/en/webhooks">
    You receive instantly `listing.published`, `listing.rejected`, and other events.
  </Card>

  <Card title="Events" icon="clock-rotate-left" href="/en/webhooks#recuperarea-evenimentelor">
    `GET /events?after=` gives you everything that has happened in the last 35 days.
  </Card>

  <Card title="Direct Read" icon="magnifying-glass">
    `GET /account/listings/{code}` shows you `status` and `moderation` at any time.
  </Card>
</CardGroup>

Events that correspond to state changes:

| Change | Event |
| - | - |
| The listing becomes `active` after moderation | `listing.published` |
| The listing is rejected | `listing.rejected` (with `reason` and `rejection_codes`) |
| The listing is paused | `listing.paused` |
| The listing returns from pause | `listing.reactivated` |
| The listing is marked sold or rented | `listing.sold` |
| The listing is hidden by moderation | `listing.withdrawn` with `by: "moderation"` |
| The listing is deleted | `listing.withdrawn` with `by: "owner"` |

<Note>
  The result of moderating an **edit** on an already published listing does not change the state of the listing, thus it does not produce a state event. You find out by reading the listing: `moderation.edit_pending` becomes `false` again, and a rejection appears in `moderation.rejection_reason`. A CRM that sends edits on active listings periodically checks listings with `edit_pending: true`.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.