> For the complete documentation index, see [llms.txt](https://api-docs.everreal.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.everreal.co/endpoints/listing/listing-mutation.md). Agents can also search and read this documentation through its [MCP server](https://api-docs.everreal.co/~gitbook/mcp).

# Listing Mutation

Create a listing, change its fields, and find the other listing mutations.

{% hint style="info" %}
This page covers `createListing` and `patchListing`. These operations are for [company](https://api-docs.everreal.co/key-concepts.md#company) admins. To change the status (activate, deactivate, archive), see [Listing: status changes](https://api-docs.everreal.co/endpoints/listing/listing-status-changes.md). To change pictures, see [Listing: pictures and files](https://api-docs.everreal.co/endpoints/listing/listing-pictures-and-files.md).
{% endhint %}

## All listing mutations

| Mutation                                                                                                                                                 | What it does                                                                                                                                               | Page                                                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `createListing`, `patchListing`                                                                                                                          | Create a [listing](https://api-docs.everreal.co/key-concepts.md#listing), change its fields                                                                | this page                                                                                                               |
| `updateListing`                                                                                                                                          | Activate, deactivate, archive                                                                                                                              | [Listing: status changes](https://api-docs.everreal.co/endpoints/listing/listing-status-changes.md)                     |
| `addListingPicturesFromUrls`, `addListingFloorplansFromUrls`, `setListingPictures`, `addListingPictures`, `setListingFloorplans`, `addListingFloorplans` | Pictures and floor plans                                                                                                                                   | [Listing: pictures and files](https://api-docs.everreal.co/endpoints/listing/listing-pictures-and-files.md)             |
| `setListingSettings`                                                                                                                                     | The toggles of the listing settings                                                                                                                        | [Listing: settings](https://api-docs.everreal.co/endpoints/listing/listing-settings.md)                                 |
| `setListingRequirements`                                                                                                                                 | Requirement template and scoring rows                                                                                                                      | [Listing: requirements](https://api-docs.everreal.co/endpoints/listing/listing-requirements.md)                         |
| `setListingCustomFields`                                                                                                                                 | [Custom field](https://api-docs.everreal.co/key-concepts.md#custom-field) values                                                                           | [Listing: custom fields](https://api-docs.everreal.co/endpoints/listing/listing-custom-fields.md)                       |
| `setListingEnergyCertificate`                                                                                                                            | The [energy certificate](https://api-docs.everreal.co/key-concepts.md#energy-certificate) of the [unit](https://api-docs.everreal.co/key-concepts.md#unit) | [Listing: energy certificate](https://api-docs.everreal.co/endpoints/listing/listing-energy-certificate.md)             |
| `patchListingUnit`, `patchListingProperty`                                                                                                               | Fields of the unit and the [property](https://api-docs.everreal.co/key-concepts.md#property) of the listing                                                | [Listing: unit and property fields](https://api-docs.everreal.co/endpoints/listing/listing-unit-and-property-fields.md) |

The ids you need ([users](https://api-docs.everreal.co/key-concepts.md#user-and-member), templates, custom field keys) come from the [reference reads](https://api-docs.everreal.co/endpoints/listing/listing-reference-reads.md).

## Introduction

Use `createListing` to make a new listing. Use `patchListing` to change fields of one listing.

* The listing starts **inactive** and **not archived**. Activate it with `updateListing` when it is ready.
* The company comes from your token. A write never takes a `companyId` inside its input object.
* Every write goes through the same checks as the EverReal web app. [Webhooks](https://api-docs.everreal.co/key-concepts.md#webhook) such as `LISTING_CREATED` and `LISTING_UPDATED` fire as usual.

**Endpoint:** `POST https://{subdomain}.everreal.co/api/reporting/graphql`

**Auth:** `Authorization: Bearer <ACCESS_TOKEN>`. The token must carry the [scope](https://api-docs.everreal.co/key-concepts.md#scope) `company_admin`. A token with only `company_user` gets the code `FORBIDDEN`.

## Schema

```graphql
type Mutation {
  createListing(input: CreateListingInput!, companyId: ID): ListingAdminResult!
  patchListing(input: PatchListingInput!, companyId: ID): ListingAdminResult!
}

type ListingAdminResult {
  id: ID!
  written: Boolean!   # false when nothing was written
  existing: Boolean!  # create only: true when externalId was used before
}
```

### Write into another company of your partner

`companyId` is optional. Use it to act in another company of your [partner](https://api-docs.everreal.co/key-concepts.md#partner) in which you are a member. Without it, the call acts in the company of your token. Another company answers `NOT_FOUND` with `companyScopedToken.notFoundForCompany`. Your [default company](https://api-docs.everreal.co/key-concepts.md#default-company-and-current-company) does not change. See [Access model](https://api-docs.everreal.co/master/access-model.md).

## createListing

Creates a listing.

* Send the same `externalId` twice and you get the first listing back (`existing: true`). Nothing changes. This makes a retry safe.
* EverReal refuses a field that the listing type does not store. The error names the field.
* A sale listing (apartment, house or parking spot for sale) needs a price, unless price upon request is on.
* `documents` are not accepted yet. EverReal refuses a call that sends documents.

### Arguments: `input` (CreateListingInput)

| Name                                | Type                         | Required       | Description                                                                                                                                            |
| ----------------------------------- | ---------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `type`                              | ListingAdminType             | yes            | One of the 22 listing types (see below).                                                                                                               |
| `title`                             | String                       | yes            | The title.                                                                                                                                             |
| `listingResponsibleId`              | ID                           | yes            | A user of your company. This is the contact person. The user needs a first name, a last name and a phone number. Get the ids from `listingAdminUsers`. |
| `externalId`                        | String                       | no             | Your own id. 1 to 255 characters. Unique in your company.                                                                                              |
| `property`                          | ListingAdminPropertyInput    | yes            | The property. Send `id` to use an existing property, or fill the fields to create one.                                                                 |
| `unit`                              | JSONObject                   | buildings only | The unit. `name` is required. Land types have no unit.                                                                                                 |
| `listingInformation`                | JSONObject                   | yes            | Fields of the listing type (for example `availableFrom`).                                                                                              |
| `contractDetails`                   | JSONObject                   | yes            | Money fields of the listing type (for example `currency`, `rent`).                                                                                     |
| `amenities`                         | JSONObject                   | buildings only | Amenities. Required for buildings.                                                                                                                     |
| `descriptions`                      | JSONObject                   | no             | Keys: `object`, `amenities`, `location`, `other`.                                                                                                      |
| `contractTemplateId`                | ID                           | no             | A [contract](https://api-docs.everreal.co/key-concepts.md#contract) template of your company.                                                          |
| `applicationFormTemplateId`         | ID                           | no             | An application form template. Get ids from `listingAdminApplicationFormTemplates`.                                                                     |
| `showListingResponsiblePhoneNumber` | Boolean                      | no             | Show the phone number in the expose.                                                                                                                   |
| `virtualTourLink`                   | JSONObject                   | no             | A virtual tour link.                                                                                                                                   |
| `pictures`                          | \[ListingAdminPictureInput!] | no             | See [Listing: pictures and files](https://api-docs.everreal.co/endpoints/listing/listing-pictures-and-files.md).                                       |
| `floorplans`                        | \[ListingAdminFileInput!]    | no             | See [Listing: pictures and files](https://api-docs.everreal.co/endpoints/listing/listing-pictures-and-files.md).                                       |
| `documents`                         | \[ListingAdminFileInput!]    | no             | **Not accepted yet.**                                                                                                                                  |

**Listing types (`ListingAdminType`):**

```graphql
enum ListingAdminType {
  RENT_APARTMENT
  SELL_APARTMENT
  RENT_SHORT_TERM_APARTMENT
  RENT_WG
  RENT_HOUSE
  SELL_HOUSE
  RENT_PARKING
  SELL_PARKING
  RENT_RESIDENTIAL_LAND
  SELL_RESIDENTIAL_LAND
  RENT_OFFICE
  SELL_OFFICE
  RENT_STORE
  SELL_STORE
  RENT_GASTRONOMY
  SELL_GASTRONOMY
  RENT_INDUSTRY
  SELL_INDUSTRY
  RENT_SPECIAL_PURPOSE
  SELL_SPECIAL_PURPOSE
  RENT_COMMERCIAL_LAND
  SELL_COMMERCIAL_LAND
}
```

**Required fields by type.** `listingInformation`, `contractDetails` and `amenities` hold the fields of the listing type. For example, `RENT_APARTMENT` needs `listingInformation.availableFrom` and `contractDetails.currency`, `rent`, `deposit` and `utilityCosts`. `RENT_WG` has `isFurnished`, `wgType` and `allInclusiveRent`. If a required field is missing, the error names it.

**Calculated amounts.** EverReal calculates `displayAmount` for you, unless you send it: for rent types from the rent (the all-inclusive rent for `RENT_SHORT_TERM_APARTMENT` and `RENT_WG`), for sell types from the price. `totalMonthlyRent` is calculated for rent types only.

### ListingAdminPropertyInput

| Name                                                        | Type                       | Required   | Description                                                                                                                      |
| ----------------------------------------------------------- | -------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `id`                                                        | ID                         | no         | An existing property of your company. Without it, a property is created.                                                         |
| `name`                                                      | String                     | yes        | The property name.                                                                                                               |
| `address`                                                   | ListingAdminAddressInput   | yes        | `street`, `number`, `city` are required. `zip`, `country` and `location { lat lng }` are optional. Both coordinates can be null. |
| `subtype`, `objectId`                                       | String                     | no         |                                                                                                                                  |
| `yearBuilt`, `noOfStories`                                  | Int                        | no         |                                                                                                                                  |
| `area`                                                      | Float                      | land types | Area in square metres.                                                                                                           |
| `descriptions`                                              | JSONObject                 | no         |                                                                                                                                  |
| `ownershipType`, `responsibilityType`                       | `INDIVIDUAL` or `MULTIPLE` | no         |                                                                                                                                  |
| `ownerId`, `responsibleUserId`, `groupId`, `neighborhoodId` | ID                         | no         |                                                                                                                                  |
| `hasPublicExpose`, `isHistoricBuilding`                     | Boolean                    | no         |                                                                                                                                  |

### Example

{% tabs %}
{% tab title="GraphQL" %}

```graphql
mutation CreateListing($input: CreateListingInput!) {
  createListing(input: $input) {
    id
    written
    existing
  }
}
```

Variables:

```json
{
  "input": {
    "type": "RENT_APARTMENT",
    "title": "Bright 2-room flat near the park",
    "listingResponsibleId": "0b6f1c2e-4a7d-4c1e-9d55-3a1f6e2b7c10",
    "externalId": "EXT-1001",
    "property": {
      "name": "Example House",
      "address": { "street": "Example Street", "number": "1", "city": "Berlin", "zip": "10115" }
    },
    "unit": { "name": "Flat 1", "rooms": { "rooms": 2 } },
    "listingInformation": { "availableFrom": "2027-01-01" },
    "contractDetails": { "currency": "EUR", "rent": 800, "deposit": 2400, "utilityCosts": 100 },
    "amenities": {}
  }
}
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl --location --request POST 'https://<subdomain>.everreal.co/api/reporting/graphql' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation($input: CreateListingInput!) { createListing(input: $input) { id written existing } }","variables":{"input":{"type":"RENT_APARTMENT","title":"Bright 2-room flat near the park","listingResponsibleId":"0b6f1c2e-4a7d-4c1e-9d55-3a1f6e2b7c10","externalId":"EXT-1001","property":{"name":"Example House","address":{"street":"Example Street","number":"1","city":"Berlin","zip":"10115"}},"unit":{"name":"Flat 1","rooms":{"rooms":2}},"listingInformation":{"availableFrom":"2027-01-01"},"contractDetails":{"currency":"EUR","rent":800,"deposit":2400,"utilityCosts":100},"amenities":{}}}}'
```

{% endtab %}
{% endtabs %}

Response:

```json
{
  "data": {
    "createListing": {
      "id": "7d2a9c34-1b8e-4f6a-a3c5-90e1d4b8f255",
      "written": true,
      "existing": false
    }
  }
}
```

If you send the same request again, you get `"written": false, "existing": true` with the same `id`.

## patchListing

Changes fields of one listing. Only the fields you send change.

* `listingInformation`, `contractDetails` and `amenities` merge field by field. Fields you leave out stay as they are.
* Set `descriptions` or `virtualTourLink` to `null` to clear them.
* If you change the rent or the price, `displayAmount` and `totalMonthlyRent` are calculated again, unless you send them.
* A sale listing needs a price, unless price upon request is on. This also applies to an update.
* The status is **not** a field here. Use `updateListing`.
* The type, the property and the unit cannot be changed here. To change unit and property fields, see [Listing: unit and property fields](https://api-docs.everreal.co/endpoints/listing/listing-unit-and-property-fields.md).
* If someone changes the listing at the same time, the call reads the listing again and merges once more.

### Arguments: `input` (PatchListingInput)

| Name                                | Type       | Required | Description                                                               |
| ----------------------------------- | ---------- | -------- | ------------------------------------------------------------------------- |
| `listingId`                         | ID         | yes      | The listing. It must belong to your company.                              |
| `title`                             | String     | no       | Not empty.                                                                |
| `descriptions`                      | JSONObject | no       | Keys: `object`, `amenities`, `location`, `other`. `null` clears.          |
| `listingInformation`                | JSONObject | no       | Merged. A required field cannot be set to `null`.                         |
| `contractDetails`                   | JSONObject | no       | Merged.                                                                   |
| `amenities`                         | JSONObject | no       | Merged.                                                                   |
| `listingResponsibleId`              | ID         | no       | A user of your company with a first name, a last name and a phone number. |
| `contractTemplateId`                | ID         | no       |                                                                           |
| `applicationFormTemplateId`         | ID         | no       |                                                                           |
| `showListingResponsiblePhoneNumber` | Boolean    | no       |                                                                           |
| `virtualTourLink`                   | JSONObject | no       | `null` clears.                                                            |

Send at least one field besides `listingId`.

### Example

```graphql
mutation {
  patchListing(input: {
    listingId: "7d2a9c34-1b8e-4f6a-a3c5-90e1d4b8f255"
    title: "Bright 2-room flat, now with balcony"
    contractDetails: { rent: 850 }
  }) {
    id
    written
  }
}
```

Response:

```json
{ "data": { "patchListing": { "id": "7d2a9c34-1b8e-4f6a-a3c5-90e1d4b8f255", "written": true } } }
```

If the listing already had these values, `written` is `false`.

## Errors

GraphQL answers with HTTP 200. Read the `errors` list. Each error has `extensions.code` and, for most refusals, `extensions.errorLocale`. Some also have `extensions.payload`. The payload is a **JSON string**, not an object. Parse it to read it.

```json
{
  "errors": [{
    "message": "documents are not accepted yet",
    "extensions": { "code": "BAD_USER_INPUT", "errorLocale": "listingAdmin.documentsNotSupported", "payload": "{\"field\":\"documents\"}" }
  }],
  "data": null
}
```

| code              | errorLocale                                                                                                 | When                                                                                                                                               |
| ----------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `UNAUTHENTICATED` | (none)                                                                                                      | No valid token, or no company on the token.                                                                                                        |
| `FORBIDDEN`       | `prismListings.validation.scopeMissing`                                                                     | The token has no `company_admin` scope.                                                                                                            |
| `BAD_USER_INPUT`  | `listingAdmin.documentsNotSupported`                                                                        | `documents` was sent on create.                                                                                                                    |
| `BAD_USER_INPUT`  | `listings.input.fieldRequired`                                                                              | A field required by the type is missing. The payload (a JSON string) names the field.                                                              |
| `BAD_USER_INPUT`  | `listings.input.fieldUnknown`                                                                               | The type does not store this field. The payload (a JSON string) names it.                                                                          |
| `BAD_USER_INPUT`  | `listings.input.valueInvalid`                                                                               | A value has the wrong shape.                                                                                                                       |
| `BAD_USER_INPUT`  | `listings.input.typeUnknown`                                                                                | The listing type is not known.                                                                                                                     |
| `BAD_USER_INPUT`  | `prismListings.validation.responsibleNotInCompany`                                                          | The user is not a user of your company.                                                                                                            |
| `BAD_USER_INPUT`  | `prismListings.validation.responsibleProfileIncomplete`                                                     | The user has no first name, last name or phone number.                                                                                             |
| `BAD_USER_INPUT`  | `listingAdmin.uuidInvalid`                                                                                  | An id is not a [uuid](https://api-docs.everreal.co/key-concepts.md#uuid).                                                                          |
| `BAD_USER_INPUT`  | `listingAdmin.patchEmpty`                                                                                   | `patchListing` has no field to change.                                                                                                             |
| `BAD_USER_INPUT`  | `listingAdmin.patchTitleInvalid`                                                                            | `title` is empty.                                                                                                                                  |
| `BAD_USER_INPUT`  | `listingAdmin.patchSectionInvalid`                                                                          | A section is not an object.                                                                                                                        |
| `BAD_USER_INPUT`  | `prismListings.validation.filePathNotAllowed`, `fileTypeNotAllowed`, `fileFieldRequired`, `fileSizeInvalid` | A picture or floor plan is wrong. See [Listing: pictures and files](https://api-docs.everreal.co/endpoints/listing/listing-pictures-and-files.md). |
| `BAD_USER_INPUT`  | `prism.api.admin.listings.cantCreate.externalIdInvalid`                                                     | `externalId` is not a text of 1 to 255 characters (create).                                                                                        |
| `NOT_FOUND`       | `listingAdmin.listing.notFound`                                                                             | The listing does not exist in your company. A listing of another company gives the same answer.                                                    |
| `NOT_FOUND`       | `companyScopedToken.notFoundForCompany`                                                                     | You are not a member of the `companyId` company, or it is not a company of your partner.                                                           |
| `CONFLICT`        | `prismListings.patch.conflict`                                                                              | `patchListing`: the listing changed again during the call. Send it again.                                                                          |
| `UPSTREAM_ERROR`  | `listingAdmin.prism.unreachable`, `listingAdmin.prism.noId`                                                 | The listing service did not answer. If you sent `externalId`, a retry is safe.                                                                     |
