Back to top

Brivity Core API

Event Subscriptions API

Event Subscriptions

Create Event Subscription
POST/api/event_subscriptions

Subscribe to be notified of a certain event at a specified callback URI.

Example URI

POST /api/event_subscriptions
Request
HideShow
Headers
Accept: application/json
Content-Type: application/json
Authorization: Token token=c7f00964b8c4814bf59a8a17605165be
Body
{
  "event": "new_lead",
  "target_url": "https://zapier.com/7893da2560a372183866947fc8503e5e",
  "source": "Zapier",
  "http_auth_strategy": "basic",
  "http_auth_credentials": "yourusername:yourpassword"
}
Schema
{
  "type": "object",
  "properties": {
    "event": {
      "type": "string",
      "description": "Name of the event being subscribed to"
    },
    "target_url": {
      "type": "string",
      "description": "URI at which the subscriber will be sent events"
    },
    "source": {
      "type": "string",
      "description": "Name of the integration partner"
    },
    "http_auth_strategy": {
      "type": "string",
      "description": "Optional strategy to be used for HTTP `Authorization` header ('basic' or 'token')"
    },
    "http_auth_credentials": {
      "type": "string",
      "description": "Optional 'username:password' or API token to set for value of `Authorization` header"
    },
    "http_verb": {
      "type": "string",
      "description": "Http verb to call ('post' or 'put') if nothing passed, defaults to 'post'"
    }
  },
  "required": [
    "event",
    "target_url"
  ]
}
Response  201
HideShow

The resource was created.

Headers
Content-Type: application/json; charset=utf-8
Body
{
  "status": "created",
  "event_subscription": {
    "id": 410358389,
    "account_id": 71606358,
    "event": "new_lead",
    "target_url": "https://zapier.com/7893da2560a372183866947fc850339292",
    "created_at": "2017-03-21T08:22:07.653-07:00",
    "updated_at": "2017-03-21T08:22:07.653-07:00",
    "source": "Zapier",
    "http_auth_strategy": "token",
    "http_auth_credentials": "7893da2560a372183866947fc850339292"
  }
}
Schema
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "'created' if successful"
    },
    "event_subscription": {
      "id": {
        "type": "integer",
        "description": "Brivity Event Subscription ID"
      },
      "account_id": {
        "type": "integer",
        "description": "Brivity Account ID associated with provided API token"
      },
      "event": {
        "type": "string",
        "description": "Type of event subscription invoked by the API"
      },
      "target_url": {
        "type": "string",
        "description": "Callback URI for sending data when webhook is invoked"
      },
      "created_at": {
        "type": "string",
        "description": "Time the event subscription was created"
      },
      "updated_at": {
        "type": "string",
        "description": "Time the event subscription was last updated",
      },
      "source": {
        "type": "string",
        "description": "",
        "default": ""
      },
      "http_auth_strategy": {
        "type": "string",
        "description": ""
        "default": nil
      },
      "http_auth_credentials": {
        "type": "string",
        "description": "",
        "default": nil
      },
    }
  }
}

Person API

Person

Show Person
GET/api/people/{id}

Retrieve the Person with the given identifier.

Example URI

GET /api/people/38732871
URI Parameters
HideShow
id
integer (required) Example: 38732871

The person’s unique identifier

Request
HideShow
Headers
Accept: application/json
Authorization: Token token=c7f00964b8c4814bf59a8a17605165be
Response  200
HideShow

The Person with the specified identifier and associated with the authenticated Account

Headers
Content-Type: application/json; charset=utf-8
Body
[
  {
    "account_id": 71606358,
    "first_name": "Euclidean",
    "last_name": "Owner",
    "lead_type": "buyer",
    "email_address": "euclidean_person@example.com",
    "phone_number": "555.555.5555",
    "source": null,
    "type": "team"
  }
]
Schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "account_id": {
        "type": "integer",
        "description": "ID of the person's account"
      },
      "first_name": {
        "type": "string",
        "description": "Person's first name"
      },
      "last_name": {
        "type": "string",
        "description": "Person's last name"
      },
      "lead_type": {
        "type": [
          "string",
          "null"
        ],
        "description": "If the person is a lead, this describes what sort of lead they are."
      },
      "email_address": {
        "type": [
          "string",
          "null"
        ],
        "description": "The person's personal email address"
      },
      "phone_number": {
        "type": [
          "string",
          "null"
        ],
        "description": "The person's home phone number"
      },
      "source": {
        "type": [
          "string",
          "null"
        ],
        "description": "How the person came into Brivity"
      },
      "type": {
        "type": [
          "string",
          "null"
        ],
        "description": "Categorization of the person's role"
      }
    },
    "required": [
      "account_id",
      "first_name",
      "last_name",
      "lead_type",
      "email_address",
      "phone_number",
      "source",
      "type"
    ]
  }
}

Agent Roster API

Roster

Get Agent Roster
GET/api/v2/roster

Request a list of agents for a given account.

Example URI

GET /api/v2/roster
Request
HideShow
Headers
Accept: application/json
Content-Type: application/json
Authorization: Token token=c7f00964b8c4814bf59a8a17605165be
Body
{
  "user_id": 1
}
Schema
{
  "type": "object",
  "properties": {
    "user_id": {
      "type": "integer",
      "description": "ID of the agent"
    }
  }
}
Response  200
HideShow

The resource was found.

Headers
Content-Type: application/json; charset=utf-8
Body
[
    {
      "user_id": 38732871,
      "role": "Administrator",
      "is_owner" true,
      "first_name": "Euclidean",
      "last_name": "Owner",
      "phone_number": "(360) 360 - 3600",
      "agent_email": "euclidean_owner@example.com",
      "contact_email": "euclidean_owner@example.com",
      "brokerage": "Euclidean's Brokerage",
      "team": "Andy's Team",
      "city": "Alexandria",
      "street_address": "123 El-Gaish Rd",
      "locality": null,
      "postal_code": "129",
      "country": "Egypt",
      "photo_url": "user-default.svg OR URL to original image resource",
      "photo_urls": {
        "original": "user-default.svg OR URL to original image resource",
        "large_profile": "URL to 600x600px",
        "public": "URL to 170x170px",
        "gravatar": "URL to 80x80px",
        "thumb": "URL to 40x40px",
        "icon": "URL to 30x30px"
      },
      "bio": "Information about this agent",
      "subdomain": "john-doe",
      "social_media_urls": {
        "URLS to facebook, linkedin, instagram, twitter"
      },
      "sms_enabled_phone_number": "+13605551234",
      "primary_phone_number": "+13605551234",
      "signature": "string of signature, could be HTML string",
      "updated_at_utc": "string of most recent updated_at of User, Person, Account, Account Address, or Permissions"
    }
]
Schema
[
    {
      "type": "object",
      "properties": {
        "agent_id": {
          "type": "string",
          "description": "ID of the agent"
        },
        "role": {
          "type": "string",
          "description": "role of the agent"
        },
        "is_owner": {
          "type": "boolean",
          "description": "true if the user is the account owner"
        },
        "first_name": {
          "type": "string",
          "description": "first name of the agent"
        },
        "last_name": {
          "type": "string",
          "description": "last name of the agent"
        },
        "phone_number": {
          "type": "string",
          "description": "phone number of the agent"
        },
        "agent_email": {
          "type": "string",
          "description": "email of the agent user account"
        },
        "contact_email": {
          "type": "string",
          "description": "agent's primary email for contact"
        },
        "brokerage": {
          "type": "string",
          "description": "brokerage the agent belongs to"
        },
        "team": {
          "type": "string",
          "description": "Brivity team the agent belongs to"
        },
        "city": {
          "type": "string",
          "description": "city of the agent"
        },
        "street_address": {
          "type": "string",
          "description": "address of the agent"
        },
        "locality": {
          "type": "string",
          "description": "locality of the agent"
        },
        "postal_code": {
          "type": "string",
          "description": "postal code of the agent"
        },
        "country": {
          "type": "string",
          "description": "country of the agent"
        },
        "photo_url": {
          "type": "string",
          "description": "url of the agent profile picture"
        }
      }
    }
  }
]

Lead API

Lead

Create Leads
POST/api/v2/leads

Create a lead with various attributes

Example URI

POST /api/v2/leads
Request
HideShow
Headers
Accept: application/json
Content-Type: application/json
Authorization: Token token=c7f00964b8c4814bf59a8a17605165be
Body
{
  "brivity_id": 1054827427,
  "primary_agent_id": 398323,
  "site_id": "a0bjd8d83jo3020jsdf0",
  "contact_id": "fj0so30230jf030jd2384",
  "source": "zillow",
  "lead_type": "buyer",
  "status": "new",
  "first_name": "Jimothy",
  "last_name": "Johnston",
  "email": "jimothy_johnston@example.com",
  "phone": "555-555-5555",
  "street_address": "123 Main Street",
  "property_city": "Seattle",
  "locality": "WA",
  "property_zip": "98102",
  "country": "USA",
  "description": "Jimothy is a software developer looking to buy a place in Capitol Hill Seattle. etc",
  "property_value": "300000",
  "is_contact_address": true
}
Schema
Legend:
  * Internal = "In Brivity database"
  * External = "In 3rd party/partner's database"

{
  "type": "object",
  "properties": {
    "primary_agent_id": {
      "type": "integer",
      "description": "Internal id of the primary agent.",
      "default": "Account owner's id"
    },
    "site_id": {
      "type": "string",
      "description": "External site identifier for connected integration account."
    },
    "contact_id": {
      "type": "string",
      "description": "Foreign key to external contact record"
    },
    "source": {
      "type": "string",
      "description": "Recognized source slugs internal to Brivity",
      "options": ["canceled_expired", "brivity_idx", "circle_prospecting", "flyer", "just_listed_postcard", "just_sold_postcard", "live_bellingham", "brivity_valuations", "brivity_showing_request", "blossor", "craigslist", "keller_williams", "trulia", "zillow", "google", "bing", "facebook", "newspaper", "real_estate_book", "local_zine", "sphere_referral", "agent_referral", "personal", "professional", "past_client"]
    },
    "lead_type": {
      "type": "string",
      "description": "The type of lead, the lead's intention.",
      "options": ['buyer', 'seller/buyer', 'seller', 'tenant', 'recruit', 'n/a']
    },
    "status": {
      "type": "string",
      "description": "The status of the lead",
      "options": ['new', 'unqualified', 'watch', 'nurture', 'hot', 'archived']
    },
    "first_name": {
      "type": "string",
      "description": "First name of the lead"
    },
    "last_name": {
      "type": "string",
      "description": "Last name of the lead"
    },
    "email": {
      "type": "string",
      "description": "Email of the lead"
    },
    "phone": {
      "type": "string",
      "description": "Phone number of the lead"
    },
    "street_address": {
      "type": "string",
      "description": "Address of the lead"
    },
    "property_city": {
      "type": "string",
      "description": "City of the lead"
    },
    "locality": {
      "type": "string",
      "description": "State or Province"
    },
    "property_zip": {
      "type": "string",
      "description": "Postal code of the lead"
    },
    "country": {
      "type": "string",
      "description": "Country of the lead"
    },
    "description": {
      "type": "string",
      "description": "Description of the lead"
    },
    "property_value": {
      "type": "integer",
      "description": "Value of the property in whole dollars"
    },
    {
      "is_contact_address": {
      "type": "boolean",
      "description": "Create address details in CRM? Defaults to false. Timeline events will be created either way"
      }
    }

  },
  "required": {
    "description": "Only one of the following attributes are required",
    "attributes": [["first_name", "last_name"], "email", "phone", ["stree_address", "city"]]
}
Response  201
HideShow

The resource was created.

Headers
Content-Type: application/json; charset=utf-8
Body
{
  status: "created",
  lead: {
    "lead_id": 384801,
    "person_id": 33864,
    "primary_agent_id": 398323,
    "site_id": "a0bjd8d83jo3020jsdf0",
    "contact_id": "fj0so30230jf030jd2384",
    "source": "zillow",
    "lead_type": "buyer",
    "status": "new",
    "first_name": "Jimothy",
    "last_name": "Johnston",
    "email": "jimothy_johnston@example.com",
    "phone": "555-555-5555",
    "street_address": "123 Main Street",
    "city": "Seattle",
    "locality": "WA",
    "postal_code": "98102",
    "country": "USA",
    "description": "Jimothy is a software developer looking to buy a place in Capitol Hill Seattle. etc"
  }
}
Schema
Legend:
  * Internal = "In Brivity database"
  * External = "In 3rd party/partner's database"

{
  "type": "object",
  "properties": {
    "lead_id": {
      "type": "integer",
      "description": "Internal id of the lead object created by Brivity after successful lead creation"
    },
    "person_id": {
      "type": "integer",
      "description": "Internal id of the person object associated with the lead, created by Brivity after successful lead creation"
    },
    "primary_agent_id": {
      "type": "integer",
      "description": "Internal id of the primary agent.",
      "default": "Account owner's id"
    },
    "site_id": {
      "type": "string",
      "description": "External site identifier for connected integration account."
    },
    "contact_id": {
      "type": "string",
      "description": "Foreign key to external contact record"
    },
    "source": {
      "type": "string",
      "description": "Recognized sources internal to Brivity",
      "options": ["canceled_expired", "circle_prospecting", "flyer", "just_listed_postcard", "just_sold_postcard", "live_bellingham", "brivity_valuations", "brivity_showing_request", "blossor", "craigslist", "keller_williams", "trulia", "zillow", "google", "bing", "facebook", "newspaper", "real_estate_book", "local_zine", "sphere_referral", "agent_referral", "personal", "professional", "past_client"]
    },
    "lead_type": {
      "type": "string",
      "description": "The type of lead, the lead's intention.",
      "options": ['buyer', 'seller/buyer', 'seller', 'tenant', 'n/a']
    },
    "status": {
      "type": "string",
      "description": "The status of the lead",
      "options": ['new', 'unqualified', 'watch', 'nurture', 'hot', 'archived']
    },
    "first_name": {
      "type": "string",
      "description": "First name of the lead"
    },
    "last_name": {
      "type": "string",
      "description": "Last name of the lead"
    },
    "email": {
      "type": "string",
      "description": "Email of the lead"
    },
    "phone": {
      "type": "string",
      "description": "Phone number of the lead"
    },
    "street_address": {
      "type": "string",
      "description": "Address of the lead"
    },
    "city": {
      "type": "string",
      "description": "City of the lead"
    },
    "locality": {
      "type": "string",
      "description": "State or Province"
    },
    "postal_code": {
      "type": "string",
      "description": "Postal code of the lead"
    },
    "country": {
      "type": "string",
      "description": "Country of the lead"
    },
    "description": {
      "type": "string",
      "description": "Description of the lead"
    }
  },
  "required": {
    "description": "Only one of the following attributes are required",
    "attributes": [["first_name", "last_name"], "email", "phone", ["stree_address", "city"]]
}

Generated by aglio on 10 Jul 2019