Relay API

Authentication

API Key

Send header "Authorization: Bearer [api-key]" with each request.

Security Scheme Type API Key
parameter name: Authorization

Addresses

CreateAddress

Creates an address

Authorizations:
Request Body schema: application/json
streetAddress
required
string

Street and house number

postalCode
required
string

Postal code / zip code

locality
required
string

City / town

country
required
string

2-letter country code (ISO 3166-1 alpha-2)

additionalInfo
string

Responses

Request samples

Content type
application/json
{
  • "streetAddress": "string",
  • "postalCode": "string",
  • "locality": "string",
  • "country": "string",
  • "additionalInfo": "string"
}

Response samples

Content type
application/json
0

Customers

CreateCustomer

Creates a customer. Can also connect to casavi Tenant

Authorizations:
None
Request Body schema: application/json
casaviAccountId
integer

If provided, the customer will be connected to given casavi tenant. If not, the customer will only exist in relay

required
object

Information about the customer that will be created

Responses

Request samples

Content type
application/json
{
  • "casaviAccountId": 0,
  • "customer": {
    }
}

Response samples

Content type
application/json
{
  • "casaviAccountId": 0,
  • "customer": {
    }
}

GetCustomers

Get all customers from your account

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "customers": [
    ]
}

Properties

CreateProperties

Creates or Updates one or multiple Properties.

Authorizations:
None
Request Body schema: application/json
casaviAccountId
number
required
Array of objects (PropertyApiDefinition) [ items ]

Responses

Request samples

Content type
application/json
{
  • "casaviAccountId": 0,
  • "properties": [
    ]
}

Response samples

Content type
application/json
{
  • "properties": [
    ]
}

GetProperties

Gets properties by accountId

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "properties": [
    ]
}

DeleteProperty

Delete Property by Id

Authorizations:
None
path Parameters
propertyId
required
number

Responses

GetProperty

Get Property by Id

Authorizations:
None
path Parameters
propertyId
required
number

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "externalId": 0,
  • "customerId": 0,
  • "origin": "string",
  • "address": {
    },
  • "mscNumber": "string",
  • "createdAt": "string",
  • "updatedAt": "string"
}

Orders

GetOrderById

Gets one specific order by ID

Authorizations:
path Parameters
orderId
required
number

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "title": "string",
  • "status": "OPEN",
  • "address": {
    },
  • "dueDate": "string",
  • "followUpDate": "string",
  • "createdAt": "string",
  • "updatedAt": "string",
  • "internalId": "string",
  • "isInternal": true,
  • "type": "string",
  • "taskId": "string",
  • "propertyId": 0,
  • "casaviOrderId": 0,
  • "casaviTicketId": 0,
  • "fields": [
    ],
  • "attachments": [
    ],
  • "comments": [
    ],
  • "contactPersons": [
    ],
  • "customerId": 0
}

PatchOrder

Patches an order

Authorizations:
path Parameters
orderId
required
number
Request Body schema: application/json
status
string
Enum: "OPEN" "IN_PROGRESS" "FINISHED" "DECLINED" "NULL" "PREPARE"
dueDate
string <date-time>
internalId
string
object (ApiAddress)

Responses

Request samples

Content type
application/json
{
  • "status": "OPEN",
  • "dueDate": "2019-08-24T14:15:22Z",
  • "internalId": "string",
  • "address": {
    }
}

Response samples

Content type
application/json
0

CreateOrder

Creates an order

Authorizations:
Request Body schema: multipart/form-data
required
object

This is expected as string in form data (stringified json)

files
Array of arrays[ items ]

A maximum of 10 files and 100 MB

Responses

Response samples

Content type
application/json
{
  • "id": 0
}

GetAllOrders

Gets all orders for one account

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GetOrderCommentsByOrderId

Gets all comments related to one order

Authorizations:
path Parameters
orderId
required
number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

CreateOrderComment

Creates an order comment

Authorizations:
path Parameters
orderId
required
number
Request Body schema: multipart/form-data
text
required
string
authorName
required
string
files
Array of arrays[ items ]

A maximum of 10 files and 100 MB

Responses

Response samples

Content type
application/json
{
  • "id": 0
}

GetAttachmentsForOrder

Returns a Url to download a zipped file of all attachments for an order

Authorizations:
path Parameters
orderId
required
number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GetAttachmentsForOrderComment

Returns a Url to download a zipped file of all attachments for an order comment

Authorizations:
path Parameters
orderId
required
number
commentId
required
number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

OrderFields

CreateOrderField

Creates an order-field

Authorizations:
Request Body schema: application/json
name
required
string
content
required
string
position
required
number
orderId
required
number

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "content": "string",
  • "position": 0,
  • "orderId": 0
}

Response samples

Content type
application/json
0

OrderContactPersons

CreateOrderContactPerson

Creates a contact person for a specific order

Authorizations:
Request Body schema: application/json
name
required
string
type
required
string
telephone
string
mobile
string
email
required
string
orderId
required
number

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "type": "string",
  • "telephone": "string",
  • "mobile": "string",
  • "email": "string",
  • "orderId": 0
}

Response samples

Content type
application/json
0

Appointments

CreateAppointment

Creates an appointment

Authorizations:
None
Request Body schema: application/json
title
required
string

title

description
string

description

dateStart
required
string <2021-02-06 11:00:00>

dateStart

dateEnd
required
string <2021-02-06 11:00:00>

dateEnd

location
required
string

location

customerId
required
number

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "description": "string",
  • "dateStart": "string",
  • "dateEnd": "string",
  • "location": "string",
  • "customerId": 0
}

Response samples

Content type
application/json
{
  • "id": 0
}

GetAllAppointments

Get all appointments

Authorizations:
None

Responses

UpdateAppointment

Updates an appointment

Authorizations:
None
path Parameters
appointmentId
required
number
Request Body schema: application/json
title
string

title

description
string

description

dateStart
string <2021-02-06 11:00:00>

dateStart

dateEnd
string <2021-02-06 11:00:00>

dateEnd

location
string

location

customerId
number

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "description": "string",
  • "dateStart": "string",
  • "dateEnd": "string",
  • "location": "string",
  • "customerId": 0
}

Response samples

Content type
application/json
{
  • "id": 0
}

Documents

CreateDocument (deprecated)

[DEPRECATED] Creates a document

Authorizations:
Request Body schema: application/json
title
required
string

The title of the document

propertyId
required
string

The property id the document should be attached to

customerId
required
string

The customer id the document is coming from

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "propertyId": "string",
  • "customerId": "string"
}

Response samples

Content type
application/json
{
  • "id": 0
}

CreateDocument

Creates a document. In order to create the document successfully we need at least one reference to a property and a customer. Therefore, please provide either a property id or internal property id and a customer id or internal customer id.

Authorizations:
Request Body schema: application/json
title
required
string

The title of the document

propertyId
string

The property id the document should be attached to

internalPropertyId
string

The internal property id the document should be attached to

customerId
string

The customer id the document should be attached to

internalCustomerId
string

The internal customer id the document should be attached to

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "propertyId": "string",
  • "internalPropertyId": "string",
  • "customerId": "string",
  • "internalCustomerId": "string"
}

Response samples

Content type
application/json
{
  • "id": 0
}

DocumentApiController_patchDocument

Authorizations:
path Parameters
documentId
required
string
Request Body schema: application/json
status
required
string
Enum: "PUBLISHED" "PREPARING"

The document status

Responses

Request samples

Content type
application/json
{
  • "status": "PUBLISHED"
}

DocumentApiController_postAttachment

Authorizations:
path Parameters
documentId
required
string
Request Body schema: application/json
name
required
string

File name

fileType
required
string

MIME Type, must be application/pdf

content
required
string

Base64 encoded content

metadata
object

Data for casavi to assign the attachment

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "fileType": "string",
  • "content": "string",
  • "metadata": { }
}

Consumptions

Eed

Consumes eed data

Authorizations:
None
Request Body schema: application/json
propertyId
required
integer

ID of property

unitId
required
number

ID of unit

customerId
required
number

ID of customer

period
required
string

Month of measurement. Format: YYYY-mm

mscName
required
string

Measurement service company name

required
Array of objects (EedConsumptionDto) [ items ]

Eed consumption data

required
Array of objects (BenchmarkDto) [ items ]

Eed benchmark data

Responses

Request samples

Content type
application/json
{
  • "propertyId": 0,
  • "unitId": 0,
  • "customerId": 0,
  • "period": "string",
  • "mscName": "string",
  • "consumptions": [
    ],
  • "benchmarks": [
    ]
}

Units

GetUnits

Gets units by customer

Authorizations:
None
query Parameters
limit
required
number
offset
required
number

Responses

Response samples

Content type
application/json
{
  • "units": [
    ]
}

GetMscUnits

Gets units by customer. Only Units that have an mscNumber

Authorizations:
None
query Parameters
limit
required
number
offset
required
number

Responses

Response samples

Content type
application/json
{
  • "units": [
    ]
}