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

# Property Management

> Manage landlord workspaces and properties through the Property Management API

The Property Management API gives landlords programmatic access to their workspaces and properties. Use it to [create workspaces](/api-reference/workspace/create-workspace), [list accessible workspaces](/api-reference/workspace/list-accessible-workspaces), [create properties](/api-reference/property/create-properties) in bulk, [retrieve property records](/api-reference/property/get-property), [update property details](/api-reference/property/update-property), and [remove properties](/api-reference/property/delete-property).

<Note>
  The Modular API and Property Management API use the same token endpoint, [Generate Access Token](/api-reference/token/generate-access-token).
</Note>

<Card title="Property Management API Reference" icon="building" href="/property-management-api-reference">
  Explore workspace and property endpoints, including request fields and response schemas.
</Card>

## Base URLs

Choose the base URL for your environment:

<Tabs>
  <Tab title="Production">
    `https://api.skortorent.com/api/v1/property-management`
  </Tab>

  <Tab title="Sandbox">
    `https://dev-api.skortorent.com/api/v1/property-management`
  </Tab>
</Tabs>

The Production and Sandbox tabs stay synchronized across the examples on this page. Use credentials issued for the selected environment.

## Authentication

Generate a shared access token with your `client_id` and `client_secret`. Send the `client_id` as the HTTP Basic Auth username and the `client_secret` as the HTTP Basic Auth password.

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request POST \
      --user 'cid_example:cs_example' \
      'https://api.skortorent.com/api/v1/authenticate/token'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request POST \
      --user 'cid_example:cs_example' \
      'https://dev-api.skortorent.com/api/v1/authenticate/token'
    ```
  </Tab>
</Tabs>

Do not include the client credentials in a JSON body. The response includes a one-hour bearer token.

Pass the token to every workspace and property endpoint:

```bash theme={null}
Authorization: Bearer <token>
```

## Workspaces

### Create a workspace

Use [Create Workspace](/api-reference/workspace/create-workspace) to create a workspace. The request requires only a workspace `name`.

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request POST \
      --url 'https://api.skortorent.com/api/v1/property-management/workspaces' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "name": "Workspace Name"
      }'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request POST \
      --url 'https://dev-api.skortorent.com/api/v1/property-management/workspaces' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "name": "Workspace Name"
      }'
    ```
  </Tab>
</Tabs>

The response returns the created workspace:

```json theme={null}
{
  "status": "success",
  "message": "Workspace created successfully",
  "data": {
    "workspace": {
      "workspace_id": "Ab12Cd",
      "workspace_name": "Workspace Name"
    }
  }
}
```

### List workspaces

Use [List Accessible Workspaces](/api-reference/workspace/list-accessible-workspaces) to list the workspaces available to the authenticated landlord before making a property request:

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request GET \
      --header 'Authorization: Bearer <token>' \
      'https://api.skortorent.com/api/v1/property-management/workspaces'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request GET \
      --header 'Authorization: Bearer <token>' \
      'https://dev-api.skortorent.com/api/v1/property-management/workspaces'
    ```
  </Tab>
</Tabs>

Each result contains a `workspace_id` and `workspace_name`. The `workspace_id` is the public workspace UUID. Include it in every property request.

### Workspace permissions

Your role controls the operations you can perform:

| Role     | Read properties | Create, update, and delete properties |
| -------- | --------------- | ------------------------------------- |
| `OWNER`  | Yes             | Yes                                   |
| `GOLD`   | Yes             | Yes                                   |
| `SILVER` | Yes             | Yes                                   |
| `BRONZE` | Yes             | No                                    |
| `GUEST`  | Yes             | No                                    |

A request for a missing workspace returns `404`. A request without workspace access, or without the required role, returns `403`.

## Supported locations

The `province` and `municipality` values must match the supported location catalog exactly, including accents and bilingual names. The municipality must belong to the selected province.

<a href="https://api.skortorent.com/images/province-municipalities.txt" download="province-municipalities.json">
  Download the complete province and municipality catalog
</a>

<Accordion title="Supported province values">
  |            |                    |                        |             |
  | ---------- | ------------------ | ---------------------- | ----------- |
  | A Coruña   | Albacete           | Alicante/Alacant       | Almería     |
  | Asturias   | Badajoz            | Barcelona              | Burgos      |
  | Cantabria  | Castellón/Castelló | Ceuta                  | Ciudad Real |
  | Cuenca     | Cáceres            | Cádiz                  | Córdoba     |
  | Girona     | Granada            | Guadalajara            | Guipúzcoa   |
  | Huelva     | Huesca             | Illes Balears          | Jaén        |
  | La Rioja   | Las Palmas         | León                   | Lleida      |
  | Lugo       | Madrid             | Melilla                | Murcia      |
  | Málaga     | Navarra            | Ourense                | Palencia    |
  | Pontevedra | Salamanca          | Santa Cruz de Tenerife | Segovia     |
  | Sevilla    | Soria              | Tarragona              | Teruel      |
  | Toledo     | Valencia/València  | Valladolid             | Vizcaya     |
  | Zamora     | Zaragoza           | Álava                  | Ávila       |
</Accordion>

## Property fields

The API accepts property data in snake case:

| Field                | Type    | Required when creating | Description                                           |
| -------------------- | ------- | ---------------------- | ----------------------------------------------------- |
| `rent_amount`        | Number  | Yes                    | Monthly rent. Must be greater than zero.              |
| `street`             | String  | Yes                    | Street name.                                          |
| `street_number`      | Integer | Yes                    | Street number. Must be greater than zero.             |
| `postal_code`        | String  | Yes                    | Postal code.                                          |
| `floor`              | Integer | Yes                    | Floor number.                                         |
| `letter`             | String  | Yes                    | Unit or flat letter.                                  |
| `province`           | String  | Yes                    | Exact supported province value.                       |
| `municipality`       | String  | Yes                    | Exact supported municipality belonging to `province`. |
| `entrance_stairwell` | String  | No                     | Entrance or stairwell identifier.                     |
| `bedrooms`           | Integer | No                     | Bedroom count.                                        |
| `bathrooms`          | Integer | No                     | Bathroom count.                                       |
| `property_reference` | String  | No                     | Your external property reference.                     |

## Create properties

Use [Create Properties](/api-reference/property/create-properties) to create multiple properties in one request. Use an array with one item to create a single property.

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request POST \
      --url 'https://api.skortorent.com/api/v1/property-management/properties' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "workspace_id": "Ab12Cd",
        "properties": [
          {
            "rent_amount": 1250,
            "street": "Calle Mayor",
            "street_number": 12,
            "postal_code": "28013",
            "floor": 3,
            "letter": "B",
            "province": "Madrid",
            "municipality": "Madrid",
            "entrance_stairwell": "2",
            "bedrooms": 2,
            "bathrooms": 1,
            "property_reference": "MAD-12-3B"
          }
        ]
      }'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request POST \
      --url 'https://dev-api.skortorent.com/api/v1/property-management/properties' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "workspace_id": "Ab12Cd",
        "properties": [
          {
            "rent_amount": 1250,
            "street": "Calle Mayor",
            "street_number": 12,
            "postal_code": "28013",
            "floor": 3,
            "letter": "B",
            "province": "Madrid",
            "municipality": "Madrid",
            "entrance_stairwell": "2",
            "bedrooms": 2,
            "bathrooms": 1,
            "property_reference": "MAD-12-3B"
          }
        ]
      }'
    ```
  </Tab>
</Tabs>

Duplicate detection compares all required address fields without regard to capitalization. It applies to active properties in the selected workspace and to duplicates within the same bulk request.

If any property is a duplicate, the API returns `409` and does not insert any item from the request.

## List properties

Use [List Properties](/api-reference/property/list-properties) to list properties with pagination:

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request GET \
      --header 'Authorization: Bearer <token>' \
      'https://api.skortorent.com/api/v1/property-management/properties?workspace_id=Ab12Cd&page=1&limit=20'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request GET \
      --header 'Authorization: Bearer <token>' \
      'https://dev-api.skortorent.com/api/v1/property-management/properties?workspace_id=Ab12Cd&page=1&limit=20'
    ```
  </Tab>
</Tabs>

`page` defaults to `1`. `limit` defaults to `20` and accepts a maximum of `100`. The response includes `page`, `limit`, `total`, and `total_pages`.

## Get a property

Use [Get Property](/api-reference/property/get-property). Pass the property ID in the path and the workspace UUID in the query string:

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request GET \
      --header 'Authorization: Bearer <token>' \
      'https://api.skortorent.com/api/v1/property-management/properties/<property_id>?workspace_id=Ab12Cd'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request GET \
      --header 'Authorization: Bearer <token>' \
      'https://dev-api.skortorent.com/api/v1/property-management/properties/<property_id>?workspace_id=Ab12Cd'
    ```
  </Tab>
</Tabs>

## Update a property

Use [Update Property](/api-reference/property/update-property). Send the `workspace_id` and at least one property field. The API applies the same validation and duplicate detection rules used during creation.

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request PATCH \
      --url 'https://api.skortorent.com/api/v1/property-management/properties/<property_id>' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "workspace_id": "Ab12Cd",
        "rent_amount": 1325
      }'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request PATCH \
      --url 'https://dev-api.skortorent.com/api/v1/property-management/properties/<property_id>' \
      --header 'Authorization: Bearer <token>' \
      --header 'Content-Type: application/json' \
      --data '{
        "workspace_id": "Ab12Cd",
        "rent_amount": 1325
      }'
    ```
  </Tab>
</Tabs>

## Delete a property

Use [Delete Property](/api-reference/property/delete-property). Deleting a property soft-deletes it.

<Tabs>
  <Tab title="Production">
    ```bash theme={null}
    curl --request DELETE \
      --header 'Authorization: Bearer <token>' \
      'https://api.skortorent.com/api/v1/property-management/properties/<property_id>?workspace_id=Ab12Cd'
    ```
  </Tab>

  <Tab title="Sandbox">
    ```bash theme={null}
    curl --request DELETE \
      --header 'Authorization: Bearer <token>' \
      'https://dev-api.skortorent.com/api/v1/property-management/properties/<property_id>?workspace_id=Ab12Cd'
    ```
  </Tab>
</Tabs>

## Response format

Successful responses use the standard v1 envelope:

```json theme={null}
{
  "status": "success",
  "message": "Request completed successfully",
  "data": {}
}
```

Validation errors include the affected field and a message:

```json theme={null}
{
  "status": "error",
  "message": "Request validation failed",
  "errors": [
    {
      "field": "properties.0.street",
      "message": "properties.0.street is required"
    }
  ]
}
```

## Recommended flow

<Steps>
  <Step title="Generate a shared access token">
    Authenticate with [Generate Access Token](/api-reference/token/generate-access-token) using your `client_id` and `client_secret`. Store the returned one-hour bearer token securely.
  </Step>

  <Step title="Create or list a workspace">
    Create a workspace with [Create Workspace](/api-reference/workspace/create-workspace), or retrieve the landlord's existing workspaces with [List Accessible Workspaces](/api-reference/workspace/list-accessible-workspaces). Select the public `workspace_id` for subsequent requests.
  </Step>

  <Step title="Manage properties">
    Create properties individually or in bulk, then use the list, get, update, and delete endpoints as needed.
  </Step>
</Steps>
