# Wayline API (WAPI)

The Wayline API lets your systems, and AI agents acting for you, read and manage
your Wayline organization: rental listings, and the knowledge base your Wayline
agents answer residents and prospects from.

## Choose how to connect

| What you want to do | Use | How you connect |
|--------------------|-----|-----------------|
| Ask your AI assistant to work in Wayline | [MCP server](https://docs.wayline.com/mcp.md#connecting) | Add `https://mcp.wayline.com` in your assistant, then sign in with your Wayline account |
| Build a sync, automation or backend integration | [REST API](https://docs.wayline.com/authentication.md) | Create an API key in **Organization Settings → Developer** and send it with your requests |

### Connect your AI assistant

Use MCP (Model Context Protocol) to give a compatible AI assistant tools for reading
and updating Wayline. For example, ask it to find a listing or update your pet policy.
You sign in to Wayline and approve its access, choosing whether it can make changes
or only read. You don't need to create an API key for this sign-in flow.

[Connect using MCP →](https://docs.wayline.com/mcp.md#connecting)

### Build an integration

Use the REST API when your software needs to call Wayline directly, such as syncing
rental listings from another system. An organization admin creates an API key, and
your backend sends it with each request.

[Create an API key →](https://docs.wayline.com/authentication.md#getting-a-key)

Both interfaces use the same underlying operations and organization boundaries.
MCP can also accept an API key for clients that support custom authorization
headers. Agents can call REST too; choose the interface your client supports.

## API details

- **Base URL:** `https://api.wayline.com/v1`
- **Authentication:** an API key, sent as `Authorization: Bearer wapi_…` ([authentication](https://docs.wayline.com/authentication.md))
- **MCP:** the same API as tools for AI agents, at `https://mcp.wayline.com`; people connect by signing in with their Wayline account ([mcp](https://docs.wayline.com/mcp.md))
- **Format:** JSON in and out, camelCase field names
- **Docs:** at `https://docs.wayline.com`; every page is also plain Markdown at `/<page>.md`, for AI agents

## Pages

| Page | What it covers |
|------|----------------|
| [authentication](https://docs.wayline.com/authentication.md) | API keys: creating, sending, expiry |
| [conventions](https://docs.wayline.com/conventions.md) | Errors, paging, rate limits, limits, versioning |
| [listings](https://docs.wayline.com/listings.md) | Listings, properties and property groups |
| [knowledge](https://docs.wayline.com/knowledge.md) | Questions, answers, guardrails and search |
| [imports](https://docs.wayline.com/imports.md) | Importing PDFs into the knowledge base, step by step for an AI agent |
| [mcp](https://docs.wayline.com/mcp.md) | Connecting an AI agent: every endpoint as an MCP tool |

## Endpoints

### Listings and places

| Method | Path | Does |
|--------|------|------|
| `GET` | `/v1/listings` | List rental listings |
| `POST` | `/v1/listings` | Create a listing |
| `GET` | `/v1/listings/{id}` | Read one listing |
| `PATCH` | `/v1/listings/{id}` | Change a listing |
| `PUT` | `/v1/listings/external/{externalId}` | Create or update a listing by your own id |
| `GET` | `/v1/properties` | List properties |
| `GET` | `/v1/properties/{id}/units` | List a property's units |
| `GET` | `/v1/property-groups` | List property groups and their properties |

### Knowledge

| Method | Path | Does |
|--------|------|------|
| `GET` | `/v1/knowledge/questions` | List questions with their answers |
| `POST` | `/v1/knowledge/questions` | Create a question with its answers |
| `GET` | `/v1/knowledge/questions/{id}` | Read one question |
| `PATCH` | `/v1/knowledge/questions/{id}` | Rename or recategorize a question |
| `DELETE` | `/v1/knowledge/questions/{id}` | Delete a question and its answers |
| `POST` | `/v1/knowledge/questions/{id}/answers` | Add an answer to a question |
| `PATCH` | `/v1/knowledge/answers/{id}` | Change an answer: text, publishing, scope |
| `DELETE` | `/v1/knowledge/answers/{id}` | Delete an answer |
| `GET` | `/v1/knowledge/search` | Find the answers closest to a question |
| `GET` | `/v1/knowledge/guardrails` | List guardrails |
| `POST` | `/v1/knowledge/guardrails` | Create a guardrail |
| `GET` | `/v1/knowledge/guardrails/{id}` | Read one guardrail |
| `PATCH` | `/v1/knowledge/guardrails/{id}` | Change a guardrail |
| `DELETE` | `/v1/knowledge/guardrails/{id}` | Delete a guardrail |
| `POST` | `/v1/knowledge/uploads` | Get somewhere to upload one PDF |
| `POST` | `/v1/knowledge/imports` | Import uploaded PDFs into Pending |
| `GET` | `/v1/knowledge/imports` | List imports |
| `GET` | `/v1/knowledge/imports/{id}` | Read one import's progress and outcome |

## Quick start

```bash
curl https://api.wayline.com/v1/knowledge/questions?status=pending \
  -H "Authorization: Bearer $WAYLINE_API_KEY"
```

```json
{
  "data": [
    {
      "id": 812,
      "question": "Do you allow pets?",
      "category": "LEASING",
      "required": false,
      "createdAt": "2026-11-03T16:02:48.000Z",
      "updatedAt": "2026-11-04T09:15:02.311Z",
      "answers": [
        {
          "id": 2044,
          "value": "Cats and dogs under 40 lb, with a $500 deposit.",
          "published": false,
          "verbatim": false,
          "properties": [], "propertyGroups": [],
          "countryCodes": [], "stateCodes": [], "counties": [], "cities": [], "zipCodes": [],
          "fromCase": null,
          "knowledgeImportId": 31,
          "createdAt": "2026-11-04T09:15:02.311Z",
          "updatedAt": "2026-11-04T09:15:02.311Z"
        }
      ]
    }
  ],
  "nextCursor": null
}
```
