General Information
API URL
The API URL is https://api.getbrokerkit.com/v2 and all the request URLs must be appended to
this URL. For example to a create "lead" make a POST request to
Request Headers
With every request you must set the following Authorization and Content-Type headers:
- Authorization: Token token=YOUR API KEY
- Content-Type: application/json
Response Codes
Response Code | Returned when |
200 OK | Successful GET request |
201 Created | Resource has been successfully created |
204 No Content | Resource has been successfully updated |
400 Bad Request | Request is erroneous (e.g a required parameter was not provided) |
401 Unauthorised | Failed API authorisation |
403 Forbidden | No access to a resource (e.g makes a lead create request but has no create lead permission) |
404 Not Found | Requested resource was not found |
422 Unprocessable Entity | Request was valid but failed because of validation errors (e.g the request tried to create a new user with an email that already exists) |
Other things to keep in mind:
-
When a parameter is required, it is marked as "REQUIRED FIELD". All other fields are optional.
-
Request parameters must be encoded in UTF-8.
Using the API
Finding API key for a Team
-
Click this link while logged into your Brokerkit account, or visit the “Team Settings” section of yourBrokerkit account, then click the “Copy to Clipboard” button to copy your API Key for your Team.
Leads
Creating a Lead
Thing | Value |
URL | /leads |
Method | POST |
Response | Lead or error list |
Other things to keep in mind:
- If you include the test parameter with boolean value "true", the API will not save the lead to the
DB and notify, if value will be "false" API will save the lead to the DB and notify.
Example Parameters:
{
"test": false, //SHOULD BE BOOLEAN VALUE, NOT STRING.
If you include the test(true) parameter in any
way, the API will not save the lead to the DB and notify.
"first_name": "Peet",
"last_name": "Peeter",
"birthday": "24/03/1975",
"phone": "+11111111111", //Should be valid phone number
"email": "peet@example.com",
"note": "#TESTNOTE",
"source": "Abstrakt",
"currently_at": "RE-MAX United",
"alt_address": "1111 A Shangri, New York, NY 11111, USA",
"alt_city": "New York",
"alt_zip": "1111",
"office_address": "1111 N Tatum, New York, NY 11111, USA",
"office_city": "New York",
"office_zip": "11111",
"product": "retention", //When using this parameter, an agent vs lead will be created.
//Additionally, here are the Keller Williams specific
fields "kpa_taken": true,
"active_listings_count": "
111",
"rating": "4", //Integer from 4 to 10
"production_ytd": "10000",
"production_label": "mega", //Should be "mega super mid low new in_school not_licensed"!!! otherwise you will get an error.
"owner_email": "test@getbrokerkit.com", //Owner email is the email address of the team member
at BrokerKit (Admin / Staff). Please, make sure that owner(user with email = owner_email) exists in BK app, before creating leads with an owner.
"referrer_email": "test@getbrokerkit.com" //Referrer email is the email address of the team member at BrokerKit (Admin / Staff). Please, make sure that referrer(user with email = referrer_email) exists in BK app, before creating leads with a referrer.
"other_phone": "+11111111111", //Should be valid phone number
"office_phone": "+11111111111" //Should be valid phone number
}
Example request(cURL):
Just copy and paste this code in your console and run.
curl -X POST \
-H 'Authorization: Token token=Your Team Token' \
-H 'Content-Type: application/json' \
-d '{
"test": false,
"first_name": "Peet",
"last_name": "Peeter",
"birthday": "24/03/1975",
"email": "peet@example.com",
"phone": "+11111111111",
"note": "#TESTNOTE",
"source": "Abstrakt",
"currently_at": "RE-MAX United",
"alt_address": "1111 A Shangri, New York, NY 11111, USA",
"alt_city": "New York",
"alt_zip": "1111",
"office_address": "1111 N Tatum, New York, NY 11111, USA",
"office_city": "New York",
"office_zip": "11111",
"kpa_taken": "true",
"active_listings_count": "111",
"rating": "4",
"production_ytd": "10000",
"production_label": "mega",
"owner_email": "test@brokerkit.com",
"referrer_email": "test@brokerkit.com",
"other_phone": "+11111111111",
"office_phone": "+11111111111"
}'
Example successful response:
{
"id": null,
"team_id": 38,
"status": "new_lead",
"bucket": "default",
"photo_url": null,
"first_name": "Peet",
"last_name": "Peeter",
"name": "Peet Peeter",
"birthday": "1975-03-24",
"email": "peet@example.com",
"phone": "+11111111111",
"production_label": "mega",
"production_ytd": 10000,
"currently_at": "RE-MAX United",
"source": "Abstrakt",
"rating": 4,
"kpa_taken": true,
"active_listings_count": "111",
"referred_at": "2019-05-07",
"anniversary_month": null,
"joined_at": null,
"follow_up_at": null,
"last_activity_at": "2019-05-07T17:18:38.231Z",
"first_appointment_at": null,
"last_appointment_at": null,
"updated_at": null,
"created_at": null,
"note": "#TESTNOTE",
"links": null,
"alt_address": "1111 A Shangri, New York, NY 11111, USA",
"alt_city": "New York",
"alt_zip": null,
"alt_lat": 40.7127753,
"alt_lng":-74.0059728,
"office_address": "1111 N Tatum, New York, NY 11111, USA",
"office_city": "New York",
"office_zip": null,
"office_lat": 40.7127753,
"office_lng":-74.0059728,
"other_phone": "+11111111111",
"office_phone": "+11111111111",
"recruiting": true,
"retention": false,
"is_recruiting_status": true,
"is_retention_status": false,
"archived": false,
"backlogged": false,
"snoozed": false,
"latest_appointment_logged": true,
"last_activity": null,
"my_last_activity_at": null,
"appointments": [],
"activities": [],
"owner": { // If the owner has been assigned successfully
"id": 1,
"email": "test@getbrokerkit.com",
"title": "",
"first_name": "Test",
"last_name": "Brokerkit",
"name": "Test Brokerkit Account",
"avatar_url": "LINK TO CLOUDDINARY",
"admin": true,
"signature": "Regards, Brokerkit",
"timezone": "America/Denver",
"phone": "",
"last_sign_in_at": "2019-08-28T15:16:43.426Z",
"updated_at": "2019-09-06T00:04:37.743Z",
"created_at": "2019-03-13T09:49:47.298Z",
"avatar": {
"medium": "LINK TO CLOUDDINARY",
"small": "LINK TO CLOUDDINARY",
"tiny": "LINK TO CLOUDDINARY"
}
},
"referrer": { // If the referrer has been assigned successfully
"id": 1,
"email": "test@getbrokerkit.com",
"title": "",
"first_name": "Test",
"last_name": "Brokerkit",
"name": "Test Brokerkit Account",
"avatar_url": "LINK TO CLOUDDINARY",
"admin": true,
"signature": "Regards, Brokerkit",
"timezone": "America/Denver",
"phone": "",
"last_sign_in_at": "2019-08-28T15:16:43.426Z",
"updated_at": "2019-09-06T00:04:37.743Z",
"created_at": "2019-03-13T09:49:47.298Z",
"avatar": {
"medium": "LINK TO CLOUDDINARY",
"small": "LINK TO CLOUDDINARY",
"tiny": "LINK TO CLOUDDINARY"
}
}
}
Example unsuccessful response with validation errors:
{
"email": [
"is invalid"
],
"phone": [
"is an invalid number"
]
}
Note
If test is set to true: `"test":true` in a request parameters, email will not be populated in the response and response will have `"email": null`
Once test is set to false or removed from parameters, email will be populated as expected
Comments
0 comments
Please sign in to leave a comment.