Lead OData API

Overview

Use the Lead OData to retrieve and update lead information. This API supports multiple filter and expand options, allowing you to get a list of leads and all the information surrounding them. It will allow you to make an update to a lead, as well. 

If you are looking to POST or create a lead, you should visit the Lead API documentation

This is an OData endpoint and it will support the OData query language. More information about this can be found at odata.org

Possible Response Codes

  • 200 (OK). This request was successful and information will be returned.
  • 204 (No Content). The patch was successful. 
  • 400 (Bad Request). The request is invalid.
  • 401 (Unauthorized). The token is missing, invalid, or expired.
  • 404 (Not Found). The lead was not able to be found.
  • 500 (Internal Server Error). The request was malformed, the lead given in the request did not exist, or some other unspecified error occurred when attempting to retrieve lead information.

Authentication

The Lead OData API requires authentication. The GET and PATCH request will require a valid Authenticate message header with an API token. See the Aimbase Authentication API for more information on how to authenticate your request. 

Authenticate message header example:

Authenticate: Avala-Api {username}:{token}

Query Information

This OData API allows GET and PATCH. 

Endpoint for GET

GET https://{baseurl}/odata/V2/Leads

Endpoint for PATCH

PATCH https://{baseurl}/odata/V2/Leads

Lead OData Data Schema 

The information below will be returned in a GET. It can also be updated via a PATCH.

Name

Editable

Values

Description

Id
Integer The Aimbase ID of the lead.
ExternalId
String (50) An external system ID that can be passed in with the lead or updated later.
LeadUid
UID The lead's unique identifier.
ProspectId
Integer The prospect's Aimbase identifier.
DealerId
Integer The dealer's Aimbase identifier.
ProductId
Integer The product's Aimbase identifier.
LeadDate X YYYY-MM-dd ±hh:mm The date the lead was entered.
ViewedDate
YYYY-MM-dd ±hh:mm The date the lead was viewed by the assigned contact. 
Event X String (50) The event on the lead.  
Score
Integer The score on the lead
CreateDate
YYYY-MM-dd ±hh:mm The creation date of the lead
UpdateDate
YYYY-MM-dd ±hh:mm The latest update date of the lead
CreateAccountId
Integer The id of the account that created the lead
UpdateAccountId
Integer The id of the account that last updated the lead
SentDate
YYYY-MM-dd ±hh:mm The date the lead was sent to the contact
Medium X String (200) The medium on the lead
ScoreText
String (30) The computed text of the score on the lead
ProspectInterestId
Integer The id of the prospect interest
IsActive
Boolean If the lead is in an active state or not.
StagingLeadId
Integer The staging lead ID of the lead
DealerDistance
Integer Distance of the lead from the assigned dealer
DealerDistanceMiles
Integer Distance in miles of the lead from the assigned dealer
IsQualified
Boolean If the lead is qualified or not
FollowUpStatusCode X String The follow up status code of the lead.
PurchaseStatusCode X String The purchase status code of the lead.
LeadTypeCode X String The lead type code for the lead
LeadCategoryCode X String The lead category code for the lead
LeadSourceCode X String The lead source code for the lead
LeadCampaignCode X String The lead campaign code for the lead
LeadStatusCode X String The lead status code for the lead. Default is Pending. 
Program
String The OEM program the lead is associated - not every lead will have a program. 
ConditionCode X String The condition of the product New (N), Used (U) or Showroom (S). 
OemManufacturerCode
String (20) This field is used for shared leads. The manufacturer code is the value to the Aimbase instance the lead is being shared.
OemDealerNumber
String (20) This field is used for shared leads. The OEM dealer number is the value in the Aimbase instance the lead is being shared. 
Customs X Customs Custom fields defined in Aimbase are listed as "FieldName" : "FieldValue" under the customs object. 
Metadata X Metadata If any metadata appears on the lead, it will be listed as "FieldName":"FieldValue" under the metadata object. 

Expand Options 

The Lead OData API supports several $expand options that allow you to retrieve additional related data by expanding associated models. This can help reduce the number of separate API calls needed and ensure that you have access to detailed, related information directly within the response.

Rather than duplicating the full field documentation for each related model, this section links out to the appropriate OData API documentation for each expandable entity. You can refer to those documents for detailed field definitions, filtering capabilities, and usage examples.

Expand Property Description Related OData API Documentation
Prospect
Includes the fields from the associated Prospect model.
Prospect OData API
Dealer
Includes the fields from the Dealer model associated with the lead.    
Dealer OData API
Product Includes the associated Product.    
Product OData API

Sample Queries

Get All Leads - Default Page Size 1,000

GET http://{baseurl}/odata/V2/Leads

Get a Lead and Expand Prospect

GET https://{baseurl}/odata/V2/Leads(114)?$expand=Prospect

Get a Lead and Expand Prospect and Company

GET https://{baseurl}/odata/V2/Leads(302383)?$expand=Prospect($expand=Company)

Get a Lead and Expand Prospect, Dealer, Product, Brand, and Product Category

GET https://{baseurl}/odata/V2/Leads(302383)?$expand=Prospect,Dealer,Product($expand=Brand,ProductCategory)

Patch a Lead

PATCH https://{baseurl}.aimbase.com/odata/V2/Leads(114)
Content-Type: application/json
Authenticate: Avala-Api {username}:{token}


{
    "Medium": "Medium"
}

Example Response (expanded by Prospect)

{
  "@odata.context": "https://{baseurl}/odata/V2/$metadata#Leads/$entity",
  "Id": 114,
  "ExternalId": "1481995",
  "LeadUid": "cc16dda6-8c50-483b-a928-cc506817cc33",
  "ProspectId": 74712,
  "DealerId": 1565,
  "ProductId": 6064,
  "LeadDate": "2016-08-29T15:31:01-05:00",
  "ViewedDate": null,
  "Event": null,
  "Score": 0,
  "CreateDate": "2016-11-22T00:14:41.47-06:00",
  "UpdateDate": null,
  "CreateAccountId": 0,
  "UpdateAccountId": null,
  "SentDate": "2016-08-29T15:32:04.997-05:00",
  "Medium": null,
  "ScoreText": "0",
  "ProspectInterestId": 1,
  "IsActive": true,
  "StagingLeadId": null,
  "DealerDistance": null,
  "DealerDistanceMiles": null,
  "IsQualified": true,
  "FollowUpStatusCode": "Contacted",
  "PurchaseStatusCode": "Unknown",
  "LeadTypeCode": "LeadType",
  "LeadCategoryCode": "LeadCategory",
  "LeadSourceCode": "Website",
  "LeadCampaignCode": null,
  "LeadStatusCode": "Pending",
  "Customs": {
    "BuyTimeFrame": null,
    "Comment": null,
  },
  "Metadata": {},
  "Prospect": {
    "Id": 74712,
    "ExternalId": null,
    "ProspectUid": "b118e079-22ab-493f-8237-83f3e397d1b2",
    "ProspectAggregationId": 85651,
    "CompanyId": null,
    "LastName": "Jane",
    "FirstName": "Doe",
    "Title": null,
    "Address1": "",
    "Address2": "",
    "City": "",
    "State": "CA",
    "PostalCode": "93023     ",
    "ZIP4": null,
    "CompanyName": null,
    "CompanyTitle": null,
    "County": null,
    "Country": "United States",
    "HomePhone": "111-222-3300",
    "WorkPhone": "",
    "Fax": null,
    "Email": "jane.doe@rollick.io",
    "PhoneRefused": false,
    "TextRefused": false,
    "MailRefused": false,
    "FIPSCode": null,
    "CensusCode": null,
    "CassCertified": null,
    "CountryCode": "US",
    "MobilePhone": "",
    "AddrStatus": null,
    "AddrError": null,
    "LangCode": null,
    "CassOverride": null,
    "IsActive": true,
    "IsInvalidEmail": false,
    "IsAddressCleaned": false,
    "EmailRefused": false,
    "Score": 0,
    "ScoreText": "0",
    "LegacyCustomerId": 2885537,
    "OriginProspectType": "Website",
    "CurrentProspectType": "Website",
    "CompetitiveBrand": "",
    "Latitude": 34.448123,
    "Longitude": -119.252560,
    "IsNurtured": true,
    "HomePhoneNumeric": "8054523040",
    "WorkPhoneNumeric": "",
    "MobilePhoneNumeric": "",
    "CreateDate": "2016-11-22T00:14:23.327-06:00",
    "UpdateDate": null,
    "CreateAccountId": 0,
    "UpdateAccountId": null,
    "Customs": {}
  }
}

Example Response (expanded by Prospect, Dealer, Product, Brand, and Product Category)

{
  "@odata.context": "http://infinitymarine.aimbase.com/odata/V2/$metadata#Leads(Prospect(),Dealer(),Product(Brand(),ProductCategory()))/$entity",
  "Id": 82540,
  "ExternalId": null,
  "LeadUid": "257a56e7-02a3-47f4-80c5-6dd5681e4f7a",
  "ProspectId": 261417,
  "DealerId": 48,
  "ProductId": 1250,
  "LeadDate": "2025-06-04T10:37:00.293-05:00",
  "ViewedDate": null,
  "Event": "",
  "Score": 25,
  "CreateDate": "2025-06-04T10:37:02.84-05:00",
  "UpdateDate": null,
  "CreateAccountId": 0,
  "UpdateAccountId": null,
  "SentDate": null,
  "Medium": null,
  "Term": null,
  "Content": null,
  "ScoreText": "25",
  "ProspectInterestId": 1,
  "IsActive": true,
  "StagingLeadId": 66535,
  "DealerDistance": 402499,
  "DealerDistanceMiles": 250.101206129,
  "DealerMatchType": "Preassigned",
  "IsQualified": true,
  "FollowUpStatusCode": "Not Contacted",
  "PurchaseStatusCode": "Unknown",
  "LeadTypeCode": "Build a Boat",
  "LeadCategoryCode": "InfinityMarine.com",
  "LeadSourceCode": "Organic",
  "LeadCampaignCode": null,
  "LeadStatusCode": "Pending",
  "ConditionCode": "S",
  "OemManufacturerCode": null,
  "OemDealerNumber": null,
  "DeliveryOption": null,
  "Customs": {
    "PurchaseTimeframe": "Not sure",
    "AppointmentMethod": "Phone",
  },
  "Metadata": {},
  "Prospect": {
    "Id": 261417,
    "ExternalId": null,
    "ProspectUid": "85a797d5-978d-4576-b2ca-96b9f7b35996",
    "ProspectAggregationId": 218696,
    "CompanyId": null,
    "LastName": "Doe",
    "FirstName": "John",
    "Title": null,
    "Address1": "123 Example Blvd.",
    "Address2": null,
    "City": "Dallas ",
    "State": "FL",
    "PostalCode": "75225",
    "ZIP4": null,
    "CompanyName": null,
    "CompanyTitle": null,
    "County": "Dallas",
    "Country": "United States",
    "HomePhone": "(123) 456-7891",
    "WorkPhone": null,
    "Fax": null,
    "Email": "example@rollick.io",
    "PhoneRefused": false,
    "TextRefused": false,
    "MailRefused": false,
    "FIPSCode": null,
    "CensusCode": null,
    "CassCertified": null,
    "CountryCode": "US",
    "MobilePhone": null,
    "AddrStatus": null,
    "AddrError": null,
    "LangCode": null,
    "CassOverride": null,
    "IsActive": true,
    "IsInvalidEmail": false,
    "IsAddressCleaned": false,
    "EmailRefused": false,
    "Score": 45,
    "ScoreText": "45",
    "LegacyCustomerId": null,
    "OriginProspectType": "InfinityMarine.com",
    "CurrentProspectType": "InfinityMarine.com",
    "CompetitiveBrand": null,
    "Latitude": 32.866227,
    "Longitude": -96.784112,
    "IsNurtured": true,
    "HomePhoneNumeric": "11234567891",
    "WorkPhoneNumeric": null,
    "MobilePhoneNumeric": null,
    "CreateDate": "2025-06-04T10:37:02.373-05:00",
    "UpdateDate": null,
    "CreateAccountId": 0,
    "UpdateAccountId": null,
    "Customs": {
      "ExampleProspectCustomField1": "Yes",
      "ExampleProspectCustomField2": "No"
    }
  },
  "Dealer": {
    "Id": 48,
    "Name": "Aaron's Yachts",
    "DealerTypeId": 1014,
    "DealerTypeCode": "S",
    "ManufacturerId": 2,
    "MfgDealerNbr": "4646",
    "MfgDealerSubNbr": null,
    "DealerNbr": "4646",
    "Contact": "Aaron Harris",
    "ContactPreferenceId": null,
    "ContactPreferenceCode": null,
    "EMail": "aaron.harris@infintymarine.com",
    "EmailCC": "sydnie.harris@infintymarine.com",
    "WebsiteUrl": "www.AaronsYachts.com",
    "Address1": "301 Example Parkway",
    "Address2": "",
    "City": "Dallas",
    "State": "TX",
    "PostalCode": "77586",
    "County": null,
    "Country": "United States",
    "CountryCode": "US",
    "Phone": "222-333-4444",
    "Fax": "",
    "TollFree": null,
    "FIPSCode": null,
    "CensusCode": null,
    "GeoResult": null,
    "LangCode": null,
    "IsActive": true,
    "IsPoorPerformer": false,
    "IsLeadHeld": false,
    "IsPsiDisabled": null,
    "IsNurtureStreamDisabled": null,
    "ApplicationContextId": 1,
    "CreateDate": "2015-03-27T09:51:22.397-05:00",
    "UpdateDate": "2017-12-13T09:22:01.547-06:00",
    "CreateAccountId": 0,
    "UpdateAccountId": 1402,
    "LegacyDealerId": null,
    "Latitude": 29.559885,
    "Longitude": -95.039498,
    "DealerGroupId": null,
    "DealerGroupcode": null,
    "SalespersonAssignmentTypeId": 3,
    "SalespersonAssignmentTypeCode": "Standard",
    "TimeZone": null,
    "IsRerouteAwayDisabled": false
  },
  "Product": {
    "Id": 1250,
    "Name": "Uncategorized",
    "ManufacturerPlantId": null,
    "ProductTypeId": null,
    "SkuId": null,
    "Model": null,
    "ModelYear": 0,
    "Code": "Uncategorized",
    "CodeOverride": null,
    "DisplayOrder": 0,
    "IsActive": true,
    "LegacyProductKey": null,
    "ApplicationContextId": 1,
    "CreateDate": "2019-11-28T04:39:49.163-06:00",
    "UpdateDate": "2020-02-17T17:59:03.323-06:00",
    "CreateAccountId": 0,
    "UpdateAccountId": 0,
    "LegacyProductId": null,
    "ProductCategoryId": 661,
    "BrandId": 1,
    "ProductCategoryCode": "   ",
    "ProductTypeCode": null,
    "ProductBrandCode": "IY",
    "ManufacturerPlantCode": null,
    "SkuCode": null,
    "ApplicationContextCode": "B",
    "DealerMustCarryForLocator": null,
    "Brand": {
      "Id": 1,
      "Code": "IY",
      "Name": "Infinity Yachts",
      "IsActive": true,
      "IsDefault": false,
      "ManufacturerCode": "IM"
    },
    "ProductCategory": {
      "Id": 661,
      "ParentId": null,
      "Level": 1,
      "Name": "Yacht",
      "Code": "Y",
      "FlattenedCode": "/",
      "FlattenedName": "BLANK",
      "CreateDate": "2014-08-04T00:00:00-05:00",
      "UpdateDate": null
    }
  }
}