Download OpenAPI specification:Download
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.
Below is the summary of most common error codes included in the response's errorCode
field.
HTTP status code | Error code | Meaning |
---|---|---|
400 | BAD_REQUEST_PARAMETERS |
Invalid request with e.g. missing mandatory parameters. |
400 | BAD_REQUEST_BODY |
Invalid request body with e.g. missing mandatory fields. |
400 | VALUE_REQUIRED |
Mandatory value missing for the request. |
400 | INVALID_TYPE |
Invalid data type provided for the value in the request. |
400 | INVALID_STATUS |
Unable to perform the request operation due to invalid state. |
401 | UNAUTHORIZED |
Unauthorized request. |
404 | INVALID_ID |
Missing or invalid identifier. |
404 | INVALID_API_KEY |
Missing or invalid API key. |
415 | UNSUPPORTED_MEDIA_TYPE |
Unsupported media type. |
500 | TECHNICAL_ERROR |
A technical error has occurred. |
An agent can fetch all the leads for his/her agency offices.
leadId | Array of strings <uuid> (LeadId) 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) 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" 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: "UNASSIGNED" "ASSIGNED" "APPROVED" "REJECTED" Example: leadStatusCode=UNASSIGNED Search by the lead status codes to get a list of leads that have certain statuses. |
leadSourceTypeCode | Array of strings (LeadSourceTypeCode) Items Value: "BANK" Example: leadSourceTypeCode=BANK Search by the lead source types to get a list of leads that have certain lead source types. |
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 Example: sort=validAfter|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",
- "leadStatusCode": "UNASSIGNED",
- "lead": {
- "leadTypeCode": "SELLER_REFERRAL",
- "leadSourceTypeCode": "BANK",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "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": [ ],
- "decisionTime": "2023-08-03T11:45:09Z"
}, - "creationTime": "2023-08-02T13:32:28Z",
- "modificationTime": "2023-08-03T11:45:09Z"
}, - {
- "leadId": "ac34ee3b-3f6e-469e-8d02-9fa37f311ccd",
- "leadStatusCode": "APPROVED",
- "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"
}, - "recipient": {
- "name": "Kiinteistöykkönen Oy",
- "emailAddress": "sales@example.com",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8"
}, - "supplierAssignedIdentifiers": [
- {
- "schemeId": "realtorSystemLeadId",
- "supplierAssignedId": "abcd"
}
], - "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 (Lead) Lead details |
{- "lead": {
- "leadTypeCode": "SELLER_REFERRAL",
- "leadSourceTypeCode": "BANK",
- "agencyOfficeId": "7bdffe48-0077-4de0-acd4-d9b9b1ab49f8",
- "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"
}
]
}
}
{- "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: "UNASSIGNED" "ASSIGNED" "APPROVED" "REJECTED" Lead status. The status defines if the lead is approved or rejected. Possible values are:
|
required | object (LeadUpdate) Lead update |
{- "leadStatusCode": "APPROVED",
- "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) 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) 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) 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 Example: sort=validAfter|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": {
- "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": {
- "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.
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 |
{- "lead": {
- "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"
}