# Casavi

## Casavi API Integration Documentation and Authentication

## Introduction

Casavi is the leading platform for digitization in real estate management.

Base url: `https://api.mycasavi.com/`

[Casavi's system-status can be seen here](https://status.mycasavi.com/).

## Casavi Authentication

Casavi uses and a key and secret that is provided by Casavi itself. The user has to provide it upon authentication. There is no refreshing mechanism, but the token received upon initial authentication is valid for one month in the standard-setting.

1. To start authentication make a POST against <https://api.mycasavi.com/authenticate> with the header Content-Type: application/json\
   The body should be\
   `{`\
   `"key":"xyz",`\
   `"secret":"xyz"`\
   `}`\
   While the details are provided by Casavi
2. You will receive back:\
   `{`\
   `"token": "xyz",`\
   `"expiresAt": "2020-12-10T20:52:53Z"`\
   `}`
3. Start making request with the header token: xyz-your-token e.g. `https://api.mycasavi.com/contacts`

## Pagination

All GET request collections have the below three attributes that define the number of objects, the current page and the total pages:&#x20;

* "count": 67,
* "page": 0
* "pageCount": 3

```
{
    "count": 67,
    "page": 0,
    "pageCount": 3,
    "content": [
        {
            "id": "235655-43",
            "internalId": 123456,
            "title": null,
            "salutation": null,
            "firstName": null,
            "lastName": null,
            "companyRole": null,
            "email": null,
            "telephone": null,
            "mobile": null,
            "fax": null,
            "website": null,
            "street": null,
            "postalCode": null,
            "city": null,
            "country": null,
            "company": "blabla KG",
            "isRegistered": false,
            "preferredWayOfContact": "ONLINE"
        },
...
```

## IDs in Casavi

Casavi has two types of IDs:

* External IDs (this is the `id` field in the API)
* Internal IDs (this is the `internalId` field)

The external ID can come from a third party system and is used in all API calls when an id has to be provided (e.g. [`getContactById`](https://api.mycasavi.com/docs/manager#operation/getContactById) expects the external ID, or when creating a post the external staff id has to be provided for the field `authorId`)


---

# 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.locoia.com/connectors/connectors/casavi.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.
