# Q\&As (FAQs)

Q\&As allow you to manage frequently asked questions and answers across your inventory, including buildings, unit types, and units. They provide guests, operations teams, and general audiences with relevant information about a space before and during their stay.

In the Lavanda PMS, this feature is referred to as **Q\&As**.

## Key Concepts

### Entity Scope

Every Q\&A is scoped to a specific level of your inventory hierarchy:

| Entity type   | Description                                                                                                                |
| ------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Building**  | Q\&As that apply to an entire building, useful for information about shared amenities, access instructions, or house rules |
| **Unit Type** | Q\&As relevant to all units of a particular type, for example kitchen appliance instructions for a "2 Bedroom Deluxe"      |
| **Unit**      | Q\&As specific to a single unit, such as Wi-Fi passwords, parking instructions, or appliance-specific guidance             |

This hierarchical scoping means you can define information once at the building level and have it automatically available for all units within that building, while still being able to add more specific Q\&As at the unit type or unit level.

### Categories

Each Q\&A has a category that determines its intended audience:

| Category  | Description                                                                                                                             |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `GENERAL` | Visible to all audiences. General Q\&As are not tied to a specific inventory item and apply workspace-wide                              |
| `GUEST`   | Intended for guests. These Q\&As contain information relevant to someone staying at the property                                        |
| `OPS`     | Intended for operations staff. These Q\&As contain internal operational information such as maintenance contacts or check-in procedures |

> **Note:** General Q\&As (`GENERAL` category) are workspace-level and are **not** associated with a specific building, unit type, or unit. They apply broadly across your inventory.

### Q\&As on Bookings

When you query a booking, you can retrieve all the Q\&As that are relevant to that stay. The system automatically aggregates Q\&As from across the inventory hierarchy, including the workspace, building, unit type, and unit associated with the booking, giving you a complete set of information for the guest.

This is particularly useful for building guest-facing check-in guides or operational handover documents.

## GraphQL API

### Types

#### `AccommodationFaq`

| Field       | Type                        | Description                                          |
| ----------- | --------------------------- | ---------------------------------------------------- |
| `id`        | `ID!`                       | Unique identifier                                    |
| `title`     | `String`                    | The question                                         |
| `body`      | `String`                    | The answer                                           |
| `category`  | `AccommodationFaqCategory!` | The audience category (`GENERAL`, `GUEST`, or `OPS`) |
| `createdAt` | `ISO8601DateTime`           | When the Q\&A was created                            |
| `updatedAt` | `ISO8601DateTime`           | When the Q\&A was last updated                       |

#### Enums

**`FaqEntityType`** - The type of inventory entity a Q\&A is associated with:

| Value       | Description                                |
| ----------- | ------------------------------------------ |
| `BUILDING`  | A building containing unit types and units |
| `UNIT_TYPE` | A unit type grouping multiple units        |
| `UNIT`      | A single accommodation unit                |

**`FaqType`** - The audience category for a Q\&A:

| Value     | Description                   |
| --------- | ----------------------------- |
| `GENERAL` | Visible to all audiences      |
| `GUEST`   | Intended for guests           |
| `OPS`     | Intended for operations staff |

### Querying Q\&As

Q\&As are available as a connection field on buildings, unit types, and units. They follow the standard [Connections](/concepts/api-paradigms/connections.md) used across the API.

**On a Unit:**

```graphql
query UnitFaqs($id: ID!) {
  spaces {
    unit(id: $id) {
      faqs {
        nodes {
          id
          title
          body
          category
        }
        totalCount
        pageInfo {
          hasNextPage
          endCursor
        }
      }
    }
  }
}
```

```json
{
  "id": "unit-id"
}
```

**On a Unit Type:**

```graphql
query UnitTypeFaqs($id: ID!) {
  spaces {
    unitType(id: $id) {
      faqs {
        nodes {
          id
          title
          body
          category
        }
      }
    }
  }
}
```

```json
{
  "id": "unit-type-id"
}
```

**On a Building:**

```graphql
query BuildingFaqs($id: ID!) {
  spaces {
    building(id: $id) {
      faqs {
        nodes {
          id
          title
          body
          category
        }
      }
    }
  }
}
```

```json
{
  "id": "building-id"
}
```

**On a Booking** (aggregated Q\&As from the entire inventory hierarchy):

```graphql
query BookingFaqs($id: ID!) {
  bookings {
    booking(id: $id) {
      faqs {
        nodes {
          id
          title
          body
          category
        }
      }
    }
  }
}
```

```json
{
  "id": "booking-id"
}
```

> **Note:** The `faqs` connection on a booking automatically aggregates Q\&As from the workspace, building, unit type, unit, and any parent units associated with the booking's accommodation.

### Creating a Q\&A

To create a Q\&A, use the `createFaq` mutation under the `faqs` namespace. You must specify the entity it belongs to, its category, and the question/answer content.

```graphql
mutation CreateFaq($input: CreateFaqMutationInput!) {
  faqs {
    createFaq(input: $input) {
      id
    }
  }
}
```

```json
{
  "input": {
    "input": {
      "entityType": "BUILDING",
      "entityId": "building-id",
      "type": "GUEST",
      "title": "What time is check-in?",
      "body": "Check-in is available from 3:00 PM. Early check-in may be available on request."
    }
  }
}
```

**Required fields:**

| Field        | Type             | Description                                             |
| ------------ | ---------------- | ------------------------------------------------------- |
| `entityType` | `FaqEntityType!` | The type of entity (`UNIT`, `UNIT_TYPE`, or `BUILDING`) |
| `entityId`   | `ID!`            | The ID of the entity to attach the Q\&A to              |
| `type`       | `FaqType!`       | The audience category (`GENERAL`, `GUEST`, or `OPS`)    |
| `title`      | `String!`        | The question                                            |
| `body`       | `String!`        | The answer                                              |

### Updating a Q\&A

To update an existing Q\&A, use the `updateFaq` mutation. Only provide the fields you wish to change, as all fields are optional on update.

```graphql
mutation UpdateFaq($input: UpdateFaqMutationInput!) {
  faqs {
    updateFaq(input: $input) {
      id
    }
  }
}
```

```json
{
  "input": {
    "faqId": "faq-id",
    "faq": {
      "title": "What time is check-in and check-out?",
      "body": "Check-in is from 3:00 PM. Check-out is by 11:00 AM."
    }
  }
}
```

> **Warning:** If you change the `entityType`, you must also provide a new `entityId`, and vice versa. These fields must be updated together.

### Deleting a Q\&A

To delete a Q\&A, use the `deleteFaq` mutation with the Q\&A's ID.

```graphql
mutation DeleteFaq($input: DeleteFaqMutationInput!) {
  faqs {
    deleteFaq(input: $input) {
      id
    }
  }
}
```

```json
{
  "input": {
    "input": {
      "faqId": "faq-id"
    }
  }
}
```

## MCP Tools

If you are using the Lavanda MCP integration, the following tools are available for managing Q\&As:

* [create\_faqs](/mcp/tools/faqs/create_faqs.md) - Create one or more Q\&A entries
* [update\_faqs](/mcp/tools/faqs/update_faqs.md) - Update one or more existing Q\&A entries
* [delete\_faqs](/mcp/tools/faqs/delete_faqs.md) - Delete one or more Q\&A entries

See the [Tools](/mcp/tools.md) overview for setup instructions and the full list of available tools.

## Relationships

Q\&As are closely related to the [Buildings](/spaces-and-inventory/buildings.md) domain:

* A **building** can have many Q\&As
* A **unit type** can have many Q\&As
* A **unit** can have many Q\&As
* A **booking** provides an aggregated view of all Q\&As relevant to the guest's stay

See [Structure & Terms](/concepts/structure-and-terms.md) for more information on how buildings, unit types, and units relate to each other.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lavanda.app/q-and-as/faqs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
