Skip to content

Agents API Reference

List Agents

GET /api/v1/agents

Retrieve a list of agents based on various filter criteria.

Query Parameters

ParameterTypeDescription
pageNumberPage number (default: 1)
limitNumberNumber of items per page (default: 20, max: 100)
idNumberNumeric ID of the agent
sStringSearch term for agent name, email, or associated website
accessKeyStringAccess key for website filtering
hostnameStringHostname for website filtering
websiteIDNumberWebsite ID for filtering
suburbStringSuburb for location-based filtering
stateStringState for location-based filtering
postcodeStringPostcode for location-based filtering
fullSuburbStringFull suburb details for location-based filtering
regionStringRegion Names(s), can be comma-separated
areanameStringArea Names(s), can be comma-separated
addressStringAddress for location-based filtering
emailStringAgent's email address (agency or CRM)
nameStringAgent's name (partial match)
slugStringAgent's unique slug
departmentStringComma-separated list of departments

Example Request

javascript
const headers = {
  "x-access-key": "your_access_key_here",
  "x-secret-key": "your_secret_key_here",
};

fetch("https://agencyhubapi.stepps.net/api/v1/agents?name=John&department=sales", { headers })
  .then((response) => response.json())
  .then((data) => console.log(data));

Example Response

json
{
  "total": 2705,
  "hasNext": true,
  "totalPage": 136,
  "data": [
    {
      "id": 12345,
      "websiteID": 321,
      "officeID": ["123", "456"],
      "name": "John Doe",
      "firstname": "John",
      "lastname": "Doe",
      "slug": "john-doe",
      "telephone": [
        {
          "number": "9600 0000",
          "type": "BH"
        },
        {
          "number": "0411 000 000",
          "type": "mobile"
        }
      ],
      "email": "johndoe@realestatewebsite.com.au",
      "profileVideo": "",
      "departments": ["principal", "sales"],
      "positions": ["Group Principal"],
      "profileImage": "https://images.realestatewebsite.com.au/Lara-2.jpg",
      "profileLink": "https://realestatewebsite.com.au/agents/ray-fayad/",
      "listingsStats": [
        {
          "totalListings": 51,
          "totalListingValues": 47210000,
          "totalSoldPrices": 0,
          "totalRentPrices": 0,
          "status": "current",
          "listingType": "residential",
          "modtime": "2024-09-09T14:55:57.000Z"
        },
        {
          "totalListings": 22,
          "totalListingValues": 139230000,
          "totalSoldPrices": 148230000,
          "totalRentPrices": 0,
          "status": "sold",
          "listingType": "commercial",
          "modtime": "2024-09-05T12:32:00.000Z"
        },
        {
          "totalListings": 178,
          "totalListingValues": 201382000,
          "totalSoldPrices": 201310000,
          "totalRentPrices": 0,
          "status": "sold",
          "listingType": "land",
          "modtime": "2024-09-05T12:32:00.000Z"
        },
        {
          "totalListings": 176,
          "totalListingValues": 183835500,
          "totalSoldPrices": 182945500,
          "totalRentPrices": 0,
          "status": "sold",
          "listingType": "residential",
          "modtime": "2024-09-05T12:35:01.000Z"
        },
        {
          "totalListings": 12,
          "totalListingValues": 12825000,
          "totalSoldPrices": 0,
          "totalRentPrices": 0,
          "status": "current",
          "listingType": "commercial",
          "modtime": "2024-09-06T12:04:51.000Z"
        },
        {
          "totalListings": 3,
          "totalListingValues": 2100000,
          "totalSoldPrices": 0,
          "totalRentPrices": 0,
          "status": "current",
          "listingType": "land",
          "modtime": "2024-08-15T00:50:04.000Z"
        }
      ],
      "socialMedia": {
        "facebook": "",
        "twitter": "",
        "instagram": "",
        "linkedIn": "",
        "youtube": ""
      },
      "website": {
        "websiteID": 321,
        "name": "Real Estate Website",
        "link": "https://realestatewebsite.com.au/",
        "accessKey": "eBAPN6IJmCmf2kpPlGt8",
        "address": {
          "fullAddress": ",",
          "streetAddress": "",
          "fullSuburb": ",",
          "subNumber": "",
          "lotNumber": "",
          "streetNumber": "",
          "street": "",
          "suburb": "",
          "state": "",
          "postcode": "",
          "latitude": "-33.8668623",
          "longitude": "151.209658"
        },
        "config": {
          "primaryColor": "#000000",
          "secondaryColor": "#f2f2f2",
          "tertiaryColor": "",
          "video": "",
          "cloudFrontCDN": "/",
          "cloudFlareCDN": "http://images.realestatewebsite.com.au/",
          "listingTypes": {
            "hasForSale": true,
            "hasForRent": true
          }
        },
        "integrations": {
          "reviews": "",
          "offmarketLink": "",
          "propertyEstimateLink": "https://realestatewebsite.com.au/property-estimate/",
          "propertyAppraisalLink": "https://realestatewebsite.com.au/property-appraisal/",
          "switchToUsLink": "https://realestatewebsite.com.au/property-management/#switch-to-us-section",
          "suburbProfileLink": "https://realestatewebsite.com.au/suburb-profiles/",
          "privacyPolicyLink": ""
        },
        "logo": {
          "light": "https://assets-agencyhub.stepps.net/realestatewebsite/logo-light.png",
          "dark": "https://assets-agencyhub.stepps.net/realestatewebsite/logo-light.png",
          "override": ""
        },
        "hostname": "realestatewebsite.com.au"
      },
      "createdAt": "2024-01-29T00:01:04.384Z",
      "updatedAt": "2024-09-09T05:16:23.589Z"
    }
    // ... more agents
  ]
}

Get a Single Agent

GET /api/v1/agents/{id}

Retrieve details of a specific agent by their ID.

Path Parameters

ParameterTypeDescription
idStringUnique identifier of the agent (can be MongoDB ObjectId or numeric ID)

Example Request

javascript
const headers = {
  "x-access-key": "your_access_key_here",
  "x-secret-key": "your_secret_key_here",
};

fetch("https://agencyhubapi.stepps.net/api/v1/agents/12345", { headers })
  .then((response) => response.json())
  .then((data) => console.log(data));

Example Response

json
{
  "id": 12345,
  "websiteID": 321,
  "officeID": ["123", "456"],
  "name": "John Doe",
  "firstname": "John",
  "lastname": "Doe",
  "slug": "john-doe",
  "telephone": [
    {
      "number": "9600 0000",
      "type": "BH"
    },
    {
      "number": "0411 000 000",
      "type": "mobile"
    }
  ],
  "email": "johndoe@realestatewebsite.com.au",
  "profileVideo": "",
  "biography": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
  "departments": ["principal", "sales"],
  "positions": ["Group Principal"],
  "profileImage": "https://images.realestatewebsite.com.au/johndoe.jpg",
  "profileLink": "https://realestatewebsite.com.au/agents/john-doe/",
  "listingsStats": [
    {
      "totalListings": 51,
      "totalListingValues": 47210000,
      "totalSoldPrices": 0,
      "totalRentPrices": 0,
      "status": "current",
      "listingType": "residential",
      "modtime": "2024-09-09T14:55:57.000Z"
    },
    {
      "totalListings": 22,
      "totalListingValues": 139230000,
      "totalSoldPrices": 148230000,
      "totalRentPrices": 0,
      "status": "sold",
      "listingType": "commercial",
      "modtime": "2024-09-05T12:32:00.000Z"
    },
    {
      "totalListings": 178,
      "totalListingValues": 201382000,
      "totalSoldPrices": 201310000,
      "totalRentPrices": 0,
      "status": "sold",
      "listingType": "land",
      "modtime": "2024-09-05T12:32:00.000Z"
    },
    {
      "totalListings": 176,
      "totalListingValues": 183835500,
      "totalSoldPrices": 182945500,
      "totalRentPrices": 0,
      "status": "sold",
      "listingType": "residential",
      "modtime": "2024-09-05T12:35:01.000Z"
    },
    {
      "totalListings": 12,
      "totalListingValues": 12825000,
      "totalSoldPrices": 0,
      "totalRentPrices": 0,
      "status": "current",
      "listingType": "commercial",
      "modtime": "2024-09-06T12:04:51.000Z"
    },
    {
      "totalListings": 3,
      "totalListingValues": 2100000,
      "totalSoldPrices": 0,
      "totalRentPrices": 0,
      "status": "current",
      "listingType": "land",
      "modtime": "2024-08-15T00:50:04.000Z"
    }
  ],
  "socialMedia": {
    "facebook": "",
    "twitter": "",
    "instagram": "",
    "linkedIn": "",
    "youtube": ""
  },
  "website": {
    "websiteID": 321,
    "name": "Real Estate Website",
    "link": "https://realestatewebsite.com.au/",
    "accessKey": "eBAPN6IJmCmf2kpPlGt8",
    "address": {
      "fullAddress": ",",
      "streetAddress": "",
      "fullSuburb": ",",
      "subNumber": "",
      "lotNumber": "",
      "streetNumber": "",
      "street": "",
      "suburb": "",
      "state": "",
      "postcode": "",
      "latitude": "-33.8668623",
      "longitude": "151.209658"
    },
    "config": {
      "primaryColor": "#000000",
      "secondaryColor": "#f2f2f2",
      "tertiaryColor": "",
      "video": "",
      "cloudFrontCDN": "/",
      "cloudFlareCDN": "http://images.realestatewebsite.com.au/",
      "listingTypes": {
        "hasForSale": true,
        "hasForRent": true
      }
    },
    "integrations": {
      "reviews": "",
      "offmarketLink": "",
      "propertyEstimateLink": "https://realestatewebsite.com.au/property-estimate/",
      "propertyAppraisalLink": "https://realestatewebsite.com.au/property-appraisal/",
      "switchToUsLink": "https://realestatewebsite.com.au/property-management/#switch-to-us-section",
      "suburbProfileLink": "https://realestatewebsite.com.au/suburb-profiles/",
      "privacyPolicyLink": ""
    },
    "logo": {
      "light": "https://assets-agencyhub.stepps.net/realestatewebsite/logo-light.png",
      "dark": "https://assets-agencyhub.stepps.net/realestatewebsite/logo-light.png",
      "override": ""
    },
    "hostname": "realestatewebsite.com.au"
  },
  "createdAt": "2024-01-29T00:01:04.384Z",
  "updatedAt": "2024-09-09T05:16:23.589Z"
}

Create an Agent

POST /api/v1/agents

Create a new agent.

Request Body

FieldTypeDescriptionExample
nameStringFull name of the agent (required)John Doe
firstnameStringFirst name of the agent (required)John
lastnameStringLast name of the agent (required)Doe
websiteIDNumberWebsite ID associated with the agent (required)321
emailObjectAgent's email addresses{
  agency: "johndoe@realestatewebsite.com.au",
  crm: "johndoe@crm.com.au"
}
telephoneArray of ObjectAgent's phone numbers[
 {
    number: "9600 0000",
    type: "BH"
  },
  {
    number: "0411 000 000",
    type: "mobile"
  }
]
departmentsString[]List of departments the agent belongs to["sales", "administrator"]
profileImageStringURL of the agent's profile imagehttps://assets-agencyhub.stepps.net/realestatewebsite/johndoe.jpg
biographyStringAgent's biographystring content about the agent
socialMediaObjectAgent's social media links{
  facebook: "",
  twitter: "",
  instagram: "",
  linkedIn: "",
  youtube: ""
}

Example Request

javascript
const headers = {
  "x-access-key": "your_access_key_here",
  "x-secret-key": "your_secret_key_here",
  "Content-Type": "application/json",
};

const body = JSON.stringify({
  name: "Jane Smith",
  firstname: "Jane",
  lastname: "Smith",
  websiteID: 67890,
  email: {
    agency: "jane.smith@agency.com",
    crm: "jane.smith@crm.com",
  },
  telephone: [
    {
      number: "9600 0000",
      type: "BH",
    },
    {
      number: "0411 000 000",
      type: "mobile",
    },
  ],
  departments: ["sales", "rentals"],
  profileImage: "https://assets-agencyhub.stepps.net/realestatewebsite/johndoe.jpg",
  biography: "string content about the agent",
  socialMedia: {
    facebook: "https://facebook.com/john-doe",
    twitter: "",
    instagram: "https://www.instagram.com/john-doe",
    linkedIn: "",
    youtube: "",
  },
});

fetch("https://agencyhubapi.stepps.net/api/v1/agents", {
  method: "POST",
  headers: headers,
  body: body,
})
  .then((response) => response.json())
  .then((data) => console.log(data));

Example Response

json
{
  "name": "Jane Smith",
  "firstname": "Jane",
  "lastname": "Smith",
  "websiteID": 67890,
  "email": {
    "agency": "jane.smith@agency.com",
    "crm": "jane.smith@crm.com"
  },
  "telephone": [
    {
      "number": "9600 0000",
      "type": "BH"
    },
    {
      "number": "0411 000 000",
      "type": "mobile"
    }
  ],
  "departments": ["sales", "rentals"],
  "profileImage": "https://assets-agencyhub.stepps.net/realestatewebsite/johndoe.jpg",
  "biography": "string content about the agent",
  "socialMedia": {
    "facebook": "https://facebook.com/john-doe",
    "twitter": "",
    "instagram": "https://www.instagram.com/john-doe",
    "linkedIn": "",
    "youtube": ""
  }
}

Update an Agent

PUT /api/v1/agents/{id}

Update an existing agent's information.

Path Parameters

ParameterTypeDescription
idStringUnique identifier of the agent (can be MongoDB ObjectId or numeric ID)

Request Body

Include any fields from the IAgent interface that you want to update.

Example Request

javascript
const headers = {
  "x-access-key": "your_access_key_here",
  "x-secret-key": "your_secret_key_here",
  "Content-Type": "application/json",
};

const body = JSON.stringify({
  biography: "Jane has been in real estate for 15 years...",
  departments: ["sales", "rentals", "commercial"],
});

fetch("https://agencyhubapi.stepps.net/api/v1/agents/12346", {
  method: "PUT",
  headers: headers,
  body: body,
})
  .then((response) => response.json())
  .then((data) => console.log(data));

Example Response

json
{
  "id": 12345,
  "websiteID": 321,
  "officeID": ["123", "456"],
  "name": "John Doe",
  "firstname": "John",
  "lastname": "Doe",
  "slug": "john-doe",
  "telephone": [
    {
      "number": "9600 0000",
      "type": "BH"
    },
    {
      "number": "0411 000 000",
      "type": "mobile"
    }
  ],
  "email": "johndoe@realestatewebsite.com.au",
  "profileVideo": "",
  "biography": "Jane has been in real estate for 15 years...",
  "departments": ["sales", "rentals", "commercial"],
  "positions": ["Group Principal"],
  "profileImage": "https://images.realestatewebsite.com.au/johndoe.jpg",
  "profileLink": "https://realestatewebsite.com.au/agents/john-doe/",
  "socialMedia": {
    "facebook": "",
    "twitter": "",
    "instagram": "",
    "linkedIn": "",
    "youtube": ""
  },
  "createdAt": "2024-01-29T00:01:04.384Z",
  "updatedAt": "2024-09-09T05:16:23.589Z"
}

Delete an Agent

DELETE /api/v1/agents/{id}

Delete an agent from the system.

Path Parameters

ParameterTypeDescription
idStringUnique identifier of the agent (can be MongoDB ObjectId or numeric ID)

Example Request

javascript
const headers = {
  "x-access-key": "your_access_key_here",
  "x-secret-key": "your_secret_key_here",
};

fetch("https://agencyhubapi.stepps.net/api/v1/agents/12346", {
  method: "DELETE",
  headers: headers,
})
  .then((response) => response.json())
  .then((data) => console.log(data));

Example Response

json
{
  "id": 12345,
  "websiteID": 321,
  "officeID": ["123", "456"],
  "name": "John Doe",
  "firstname": "John",
  "lastname": "Doe",
  "slug": "john-doe",
  "telephone": [
    {
      "number": "9600 0000",
      "type": "BH"
    },
    {
      "number": "0411 000 000",
      "type": "mobile"
    }
  ],
  "email": "johndoe@realestatewebsite.com.au",
  "profileVideo": "",
  "biography": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
  "departments": ["principal", "sales"],
  "positions": ["Group Principal"],
  "profileImage": "https://images.realestatewebsite.com.au/johndoe.jpg",
  "profileLink": "https://realestatewebsite.com.au/agents/john-doe/",
  "socialMedia": {
    "facebook": "",
    "twitter": "",
    "instagram": "",
    "linkedIn": "",
    "youtube": ""
  },
  "createdAt": "2024-01-29T00:01:04.384Z",
  "updatedAt": "2024-09-09T05:16:23.589Z"
}

Error Handling

The API uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted), and codes in the 5xx range indicate an error with our servers.

CodeDescription
200OK - The request was successful
400Bad Request - The request was invalid or cannot be served
401Unauthorized - The request requires authentication
403Forbidden - The server understood the request but refuses to authorize it
404Not Found - The requested resource could not be found
500Internal Server Error - The server encountered an unexpected condition

For more information on using these endpoints, please refer to our Authentication Guide and Quick Start Guide.