Download OpenAPI specification:
Lead API allows an agent to view and manage leads associated with his/her agency office.
A lead can be received from several sources such as marketplaces and other partners. The agent need to handle a new lead by marking its status as approved (APPROVED) or rejected (REJECTED).
Leads can be also sent to a partner as an outgoing lead.
If you have any questions, comments or feedback regarding our APIs, please contact developer@ovipro.fi.
This endpoint is used by marketplaces to create leads. A marketplace specific permission is required to use this endpoint.
| marketplaceCode required | string (MarketplaceSourceCode) Enum: "ETUOVI" "VUOKRAOVI" "OIKOTIE" "KL_TOIMITILAT" "TOIMITILAT_FI" |
| Request-ID required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the HTTP request. The value of this header must be created by the client. This identifier is used for troubleshooting purposes. |
Contains the details for the lead.
required | object Lead details |
{- "lead": {
- "leadTypeCode": "SELLER_REFERRAL",
- "agencyOffice": {
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8"
}, - "realty": {
- "friendlyId": "123456",
- "address": {
- "streetAddress": "Katu 1",
- "stairwell": "A",
- "apartmentNumber": "1",
- "postcode": "00100",
- "postalArea": "Helsinki"
}
}, - "message": "Haluan lisätietoja asunnosta",
- "additionalNote": "Yhteydenotto mieluiten aamuisin ennen klo 10.",
- "customer": {
- "firstName": "Teemu",
- "lastName": "Virtanen",
- "emailAddress": "teemu.virtanen@example.com",
- "phoneNumber": "+358501234567"
}, - "recipient": {
- "name": "Kiinteistöykkönen Oy",
- "emailAddress": "sales@example.com"
}, - "supplierAssignedIdentifiers": [
- {
- "schemeId": "realtorSystemLeadId",
- "supplierAssignedId": "abcd"
}
], - "tags": [
- "Kesäkampanja 2024",
- "Toimistoyhteydenotto"
], - "spamClassificationCode": "SPAM"
}
}{- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd"
}An agent can fetch all the leads for his/her agency offices.
Use the modifiedAfter parameter to fetch only the leads that have been created or modified since the previous fetch:
modifiedAfter to the newest modificationTime received in the previous fetch minus one minute, and startIndex to 0. The overlap ensures that leads which were being saved during the previous fetch are not missed.modifiedAfter, startIndex, sort=modificationTime|asc and size=100.modificationTime of the last lead in the response, exactly as returned:modifiedAfter, keep modifiedAfter and increase startIndex by the number of leads in the response.modifiedAfter to it, and set startIndex to 0. The leads at the end of the response that have this same modificationTime are returned again in the next response.size.The same lead can be returned more than once, for example because of the overlap or because the lead was modified during the fetch, so update the stored leads by leadId.
| leadId | Array of strings <uuid> (LeadId) [ items <uuid >^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... ] Example: leadId=ac34ee3b-3f6e-469e-8d02-9fa37f311ccd Search by the lead identifier to get a list of leads having these identifiers. |
| agentId | string <uuid> (AgentId) ^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... Example: agentId=5d2a6d47-da73-4b11-8940-27cffabb6de5 Search by the agent identifier to get a list of leads the agent is associated with. |
| agencyOfficeId | Array of strings <uuid> (AgencyOfficeId) [ items <uuid >^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... ] Example: agencyOfficeId=212114ec-819e-483c-a8e0-f82289ac6e19 Search by the agency office identifiers to get a list of leads that belong to certain agency offices. |
| leadTypeCode | Array of strings (LeadTypeCode) Items Enum: "BUYER_REFERRAL" "SELLER_REFERRAL" "REALTY_CONTACT_REQUEST" "PURCHASE_ANNOUNCEMENT_CONTACT_REQUEST" "SHOWING_REQUEST" "MEETING_REQUEST" "PRICE_ESTIMATE_REQUEST" "BROCHURE_REQUEST" "OFFICE_CONTACT_REQUEST" "AGENT_CONTACT_REQUEST" "WATCH_REQUEST" "OTHER_CONTACT_REQUEST" "RENTAL_APPLICATION" Example: leadTypeCode=SELLER_REFERRAL Search by the lead type codes to get a list of leads having these lead types. |
| partyId | string <uuid> (PartyId) ^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... Example: partyId=62701576-2621-4a27-8d2b-63cea492abb6 Search by the party identifier to get a list of leads associated with the party. |
| leadStatusCode | Array of strings (LeadStatusCode) Items Enum: "NEW" "IN_PROGRESS" "APPROVED" "REJECTED" Example: leadStatusCode=NEW Search by the lead status codes to get a list of leads that have certain statuses. |
Array of MarketplaceSourceCode (string) or OtherSourceCode (string) (LeadSourceTypeCode) Example: leadSourceTypeCode=BANK Search by the lead source types to get a list of leads that have certain lead source types. | |
| spamClassificationCode | Array of strings (SpamClassification) Items Enum: "NOT_CLASSIFIED" "LEGITIMATE" "SUSPICIOUS" "SPAM" Example: spamClassificationCode=NOT_CLASSIFIED&spamClassificationCode=LEGITIMATE&spamClassificationCode=SUSPICIOUS Search by the spam classifications to get a list of leads that have certain spam classifications. |
| realtyFriendlyId | string Example: realtyFriendlyId=D66927 Search by the realty identifier to get a list of leads associated with the realty. |
| modifiedAfter | string <date-time> (Timestamp) Example: modifiedAfter=2026-10-28T09:10:39.284Z Search by modification time to get a list of leads created or modified on or after the specified time. The time must include a time offset, for example See the endpoint description for how to fetch only changed leads. |
| startIndex | integer <int32> >= 0 Default: 0 Example: startIndex=20 Paginate leads starting from this index. Index starts from 0. |
| size | integer <int32> [ 1 .. 100 ] Default: 50 Example: size=40 Leads returned per page. |
| sort | Array of strings[ items^(effectiveCreationTime|modificationTime)\|(a... ] Example: sort=effectiveCreationTime|desc Sort leads based on the specified fields. Each field must also include a sort order as follows:
When When |
| Request-ID required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the HTTP request. The value of this header must be created by the client. This identifier is used for troubleshooting purposes. |
{- "totalCount": 2,
- "leads": [
- {
- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd",
- "leadStatusCode": "NEW",
- "leadActionCodes": [ ],
- "lead": {
- "leadTypeCode": "SELLER_REFERRAL",
- "leadSourceTypeCode": "BANK",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "realty": {
- "friendlyId": "123456",
- "address": {
- "streetAddress": "Katu 1",
- "stairwell": "A",
- "apartmentNumber": "1",
- "postcode": "00100",
- "postalArea": "Helsinki"
}
}, - "message": "Haluan lisätietoja asunnosta",
- "additionalNote": "Yhteydenotto mieluiten aamuisin ennen klo 10.",
- "customer": {
- "firstName": "Teemu",
- "lastName": "Virtanen",
- "emailAddress": "teemu.virtanen@example.com",
- "phoneNumber": "+358501234567",
- "partyId": "62701576-2621-4a27-8d2b-63cea492abb6",
- "partyTypeCode": "PERSON_PARTY"
}, - "recipient": {
- "name": "Kiinteistöykkönen Oy",
- "emailAddress": "sales@example.com",
- "agencyOfficeId": "6ad770c0-8495-4564-a05d-f72e06af36ba"
}, - "supplierAssignedIdentifiers": [ ],
- "tags": [
- "Kesäkampanja 2024",
- "Toimistoyhteydenotto"
], - "spamClassificationCode": "SPAM"
}, - "creationTime": "2023-08-02T13:32:28Z",
- "modificationTime": "2023-08-03T11:45:09Z"
}, - {
- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd",
- "leadStatusCode": "APPROVED",
- "leadActionCodes": [
- "CONTACTED"
], - "lead": {
- "leadTypeCode": "BUYER_REFERRAL",
- "leadSourceTypeCode": "BANK",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "message": "",
- "additionalNote": "",
- "customer": {
- "firstName": "Minna",
- "lastName": "Monnila",
- "emailAddress": "minna.monnila@example.com",
- "phoneNumber": "+358501234567",
- "partyId": "08e21d7b-db8a-45d8-9632-a91e9138b4f4",
- "partyTypeCode": "PERSON_PARTY"
}, - "recipient": {
- "name": "Kiinteistöykkönen Oy",
- "emailAddress": "sales@example.com",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8"
}, - "supplierAssignedIdentifiers": [
- {
- "schemeId": "realtorSystemLeadId",
- "supplierAssignedId": "abcd"
}
], - "tags": [
- "Kesäkampanja 2024"
], - "spamClassificationCode": "NOT_CLASSIFIED"
}, - "assignmentTime": "2023-08-02T13:32:28Z",
- "decisionTime": "2023-08-03T11:45:09Z",
- "creationTime": "2023-07-13T17:32:28Z",
- "modificationTime": "2023-07-13T17:32:28Z"
}
]
}Create a new lead. The lead can arrive from a marketplace or from a partner.
| Request-ID required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the HTTP request. The value of this header must be created by the client. This identifier is used for troubleshooting purposes. |
Contains the details for the lead.
required | object (LeadWrite) Lead details |
{- "lead": {
- "leadTypeCode": "SELLER_REFERRAL",
- "leadSourceTypeCode": "BANK",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "realty": {
- "friendlyId": "123456",
- "address": {
- "streetAddress": "Katu 1",
- "stairwell": "A",
- "apartmentNumber": "1",
- "postcode": "00100",
- "postalArea": "Helsinki"
}
}, - "message": "Haluan lisätietoja asunnosta",
- "additionalNote": "Yhteydenotto mieluiten aamuisin ennen klo 10.",
- "customer": {
- "firstName": "Teemu",
- "lastName": "Virtanen",
- "emailAddress": "teemu.virtanen@example.com",
- "phoneNumber": "+358501234567",
- "partyId": "62701576-2621-4a27-8d2b-63cea492abb6"
}, - "recipient": {
- "name": "Kiinteistöykkönen Oy",
- "emailAddress": "sales@example.com",
- "agencyOfficeId": "6ad770c0-8495-4564-a05d-f72e06af36ba"
}, - "supplierAssignedIdentifiers": [
- {
- "schemeId": "realtorSystemLeadId",
- "supplierAssignedId": "abcd"
}
], - "tags": [
- "Kesäkampanja 2024",
- "Toimistoyhteydenotto"
]
}
}{- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd"
}Update details for the specified lead.
| leadId required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the lead. |
| Request-ID required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the HTTP request. The value of this header must be created by the client. This identifier is used for troubleshooting purposes. |
Contains the details for the lead.
| leadStatusCode required | string (LeadStatusCode) Enum: "NEW" "IN_PROGRESS" "APPROVED" "REJECTED" Lead status. The status defines if the lead is approved or rejected. Possible values are:
|
| leadActionCodes | Array of strings (LeadActionCode) Items Enum: "CONTACTED" "BROCHURE_SENT" "SHOWING_BOOKED" "MEETING_BOOKED" "NOT_INTERESTED" "NO_RESPONSE" "WATCH_ADDED" |
required | object (LeadUpdate) Lead update |
{- "leadStatusCode": "APPROVED",
- "leadActionCodes": [
- "CONTACTED",
- "SHOWING_BOOKED"
], - "lead": {
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "agentId": "2dca92fa-0a9a-4903-bca2-6d6c74995e8d",
- "additionalNote": "Yhteydenotto mieluiten aamuisin ennen klo 10.",
- "customer": {
- "partyId": "62701576-2621-4a27-8d2b-63cea492abb6"
}
}
}{ }Outgoing Lead API allows an agent to manage all the outgoing leads for his/her agency offices and create a lead for a partner.
An agent can fetch all the outgoing leads for his/her agency offices.
| leadId | Array of strings <uuid> (LeadId) [ items <uuid >^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... ] Example: leadId=ac34ee3b-3f6e-469e-8d02-9fa37f311ccd Search by the lead identifier to get a list of outgoing leads having these identifiers. |
| agentId | string <uuid> (AgentId) ^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... Example: agentId=5d2a6d47-da73-4b11-8940-27cffabb6de5 Search by the agent identifier to get a list of outgoing leads the agent is associated with. |
| agencyOfficeId | Array of strings <uuid> (AgencyOfficeId) [ items <uuid >^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... ] Example: agencyOfficeId=212114ec-819e-483c-a8e0-f82289ac6e19 Search by the agency office identifiers to get a list of outgoing leads that were sent by certain agency offices. |
| partyId | string <uuid> (PartyId) ^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... Example: partyId=62701576-2621-4a27-8d2b-63cea492abb6 Search by the party identifier to get a list of outgoing leads associated with the party. |
| realtyId | string <uuid> (RealtyId) ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]... Example: realtyId=9fd9124c-e6c1-4368-9f17-6938f0e2f524 Search by the realty identifier to get a list of outgoing leads associated with the realty. |
| startIndex | integer <int32> >= 0 Default: 0 Example: startIndex=20 Paginate leads starting from this index. Index starts from 0. |
| size | integer <int32> [ 1 .. 100 ] Default: 50 Example: size=40 Leads returned per page. |
| sort | Array of strings[ items^(creationTime)\|(asc|ASC|desc|DESC)$ ] Example: sort=creationTime|desc Sort leads based on the specified fields. Each field must also include a sort order as follows:
|
| Request-ID required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the HTTP request. The value of this header must be created by the client. This identifier is used for troubleshooting purposes. |
{- "totalCount": 2,
- "leads": [
- {
- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd",
- "lead": {
- "languageCode": "fi",
- "subject": "Muista hakea lainaa ajoissa",
- "message": "Asiakkaalla tarve uudelle asuntolainalle",
- "additionalNote": "Yhteydenotto mieluiten aamuisin ennen klo 9:00.",
- "realty": {
- "realtyId": "9fd9124c-e6c1-4368-9f17-6938f0e2f524",
- "friendlyId": "D66927"
}, - "documents": [
- {
- "documentId": "7634091f-a637-4a9b-be75-ba008e221d31",
- "documentTypeCode": "BROCHURE"
}, - {
- "documentId": "aaa4f3d9-f8c4-4017-bcee-366fc8acbd78",
- "documentTypeCode": "TITLE_CERTIFICATE"
}
]
}, - "customer": {
- "firstName": "Teemu",
- "lastName": "Virtanen",
- "emailAddress": "teemu.virtanen@example.com",
- "partyId": "62701576-2621-4a27-8d2b-63cea492abb6"
}, - "sender": {
- "firstName": "Minna",
- "lastName": "Monnila",
- "emailAddress": "minna.monnila@example.com",
- "phoneNumber": "+358501234567",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "agentId": "7b2a906c-9e68-4c06-be27-3d8a3fd79651"
}, - "creationTime": "2023-08-02T13:32:28Z"
}, - {
- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd",
- "lead": {
- "languageCode": "fi",
- "subject": "Muista hakea lainaa ajoissa",
- "message": "Asiakkaalla tarve uudelle asuntolainalle",
- "additionalNote": "Yhteydenotto mieluiten aamuisin ennen klo 9:00.",
- "realty": {
- "realtyId": "ddc25849-7bc7-43c0-9c3b-602cb03f7806",
- "friendlyId": "D173248"
}, - "documents": [ ]
}, - "customer": {
- "firstName": "Minna",
- "lastName": "Monnila",
- "emailAddress": "minna.monnila@example.com",
- "partyId": "92f3f480-ce29-4328-9c4d-42ab1a3cd451"
}, - "sender": {
- "firstName": "Teemu",
- "lastName": "Virtanen",
- "emailAddress": "teemu.virtanen@example.com",
- "phoneNumber": "+358501234567",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "agentId": "7b2a906c-9e68-4c06-be27-3d8a3fd79651"
}, - "creationTime": "2023-07-13T17:32:28Z"
}
]
}Create a new outgoing lead. The lead will be sent to a partner.
You can optionally include a list of document IDs that will be used to generate download links from the document API. The user must have access to the documents, otherwise the request will fail.
| Request-ID required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the HTTP request. The value of this header must be created by the client. This identifier is used for troubleshooting purposes. |
Contains the details for the lead.
required | object (OutgoingLead) Lead details |
required | object |
required | object |
| documentIds | Array of strings <uuid> (DocumentId) [ items <uuid >^([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[8... ] List of document IDs to be used for generating download links via the document API. |
{- "lead": {
- "languageCode": "fi",
- "subject": "Muista hakea lainaa ajoissa",
- "message": "Haluan lisätietoja asunnosta",
- "additionalNote": "Yhteydenotto mieluiten aamulla ennen klo 10.",
- "realty": {
- "realtyId": "9fd9124c-e6c1-4368-9f17-6938f0e2f524",
- "friendlyId": "D66927"
}, - "documents": [
- {
- "documentId": "7634091f-a637-4a9b-be75-ba008e221d31",
- "documentTypeCode": "BROCHURE"
}
]
}, - "customer": {
- "partyId": "62701576-2621-4a27-8d2b-63cea492abb6"
}, - "sender": {
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8"
}
}{- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd"
}Retrieves document download URLs for the specified outgoing lead. The URLs can be used to access attached documents directly.
| leadId required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the lead. |
| Request-ID required | string <uuid> Example: 9031d1c5-7d40-41dd-b2b8-7919a2fc4fe9 A unique id which identifies the HTTP request. The value of this header must be created by the client. This identifier is used for troubleshooting purposes. |
Optional configuration for document download URLs
| expiryDays | integer [ 1 .. 90 ] Number of days until the download URLs expire. Defaults to 14 days if not specified. |
{- "expiryDays": 30
}{- "documents": [
- {
- "documentId": "7634091f-a637-4a9b-be75-ba008e221d31",
- "name": "offer_document.pdf",
- "documentTypeCode": "BROCHURE"
}
], - "expiryDays": 14
}