Getting Started
Follow these steps to start integrating with the CarStrel API
Create an API Key
Log in to your CarStrel dashboard and navigate to Integrations → API Keys
- Sign in to your CarStrel account
- Go to Dashboard → Integrations → API Keys
- Click Create API Key
- Choose an environment (Live for production, Test for development)
- Copy your API key - it will only be shown once!
sk_live_abc123...Use for production applications
sk_test_xyz789...Use for development and testing
Make Your First Request
Every external request—including login and sign-up—must include the API key in the x-api-key header
All requests to external endpoints require the x-api-key header (no exceptions: vehicles, auth/register, auth/login, customers, etc.). The API returns JSON responses with a consistent structure.
/external/brands endpoint to test your connection.curl https://api.carstrel.com/external/brands \
-H "x-api-key: sk_live_your_api_key_here"Integrate with Your Application
Use the API in your preferred programming language
# Get all vehicles for sale
curl "https://api.carstrel.com/external/vehicles?listingType=sale&limit=10" \
-H "x-api-key: sk_live_your_api_key"
# Get vehicles with filters
curl "https://api.carstrel.com/external/vehicles?brandId=uuid&minYear=2020&maxPrice=50000" \
-H "x-api-key: sk_live_your_api_key"
# Get a specific vehicle
curl "https://api.carstrel.com/external/vehicles/{vehicleId}" \
-H "x-api-key: sk_live_your_api_key"# Get all brands
curl "https://api.carstrel.com/external/brands" \
-H "x-api-key: sk_live_your_api_key"
# Get models for a brand
curl "https://api.carstrel.com/external/brands/{brandId}/models" \
-H "x-api-key: sk_live_your_api_key"
# Get body types
curl "https://api.carstrel.com/external/body-types" \
-H "x-api-key: sk_live_your_api_key"
# Get vehicle stats
curl "https://api.carstrel.com/external/vehicles/stats/summary" \
-H "x-api-key: sk_live_your_api_key"Authentication
Every request to the external API—including login and sign-up—must include your API key in the x-api-key header. This identifies your organization (the third-party site). For endpoints that require a logged-in customer, also send the customer's JWT in the Authorization: Bearer header.
Request Headers
Two headers are used: the API key is required on all requests; the Bearer token is used for the end-user when they are logged in on your site.
x-api-keyRequired on every external request (vehicles, auth/register, auth/login, customers, etc.). Identifies your organization.
Authorization: BearerThe customer JWT returned from login or register. Send together with x-api-key so the API knows both the integrator and the customer.
# All requests: include x-api-key (including login/sign-up)
curl https://api.carstrel.com/external/vehicles \
-H "x-api-key: sk_live_your_api_key_here"
# After customer logs in on your site: send both headers
curl https://api.carstrel.com/external/auth/me \
-H "x-api-key: sk_live_your_api_key_here" \
-H "Authorization: Bearer eyJhbGc...customer_jwt_token"Error Responses
Missing or invalid API key. Make sure you're including a valid API key in your request headers.
API key doesn't have permission for this resource. Check that your key has the required scopes.
Rate limit exceeded. Implement exponential backoff and retry after the specified time.
{
"statusCode": 401,
"message": "Unauthorized",
"error": "Invalid or missing API key",
"timestamp": "2024-01-15T10:30:00Z"
}Customer Authentication
When users browse your (third-party) site connected to the API via an API key: every request—including register and login—must include the x-api-key header. Register and login return a JWT for the customer. For subsequent requests as that logged-in customer, send both the API key and Authorization: Bearer <customer_jwt>.
How It Works
- 1Register / login — Your site calls
/external/auth/registeror/external/auth/loginwith the x-api-key header (required). The API returns a JWT (access_token, refresh_token) for that customer. - 2Logged-in requests — When the user is logged in on your site, send both
x-api-key(your API key) andAuthorization: Bearer <customer_jwt>so the API knows the integrator and the customer. - 3Customer-only endpoints — e.g.
/external/auth/merequire the customer JWT in addition to the API key.
# Register or login: always send x-api-key
curl -X POST https://api.carstrel.com/external/auth/register \
-H "x-api-key: sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"email": "customer@example.com",
"password": "securepassword123",
"firstName": "John",
"lastName": "Doe"
}'# Customer endpoints: send both API key and customer JWT
curl https://api.carstrel.com/external/auth/me \
-H "x-api-key: sk_live_your_api_key" \
-H "Authorization: Bearer eyJhbGc...customer_jwt"API Endpoints
Base URL: https://api.carstrel.com
Vehicle Metadata
Global vehicle reference data including brands, models, body types, and more.
/external/brandsGet all vehicle brands
Query Parameters
pagePage number (default: 1)
limitItems per page (default: 50)
Example Request
curl https://api.carstrel.com/external/brands \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"message": "data has been received",
"data": [
{
"id": "uuid",
"name": "Toyota",
"slug": "toyota",
"logoUrl": "https://...",
"countryOfOrigin": "Japan",
"models": [
{ "id": "uuid", "name": "Camry", "slug": "camry" }
],
"vehicleCounts": {
"rental": 10,
"sale": 25,
"auction": 5,
"total": 40
}
}
],
"total": 380,
"page": 1,
"limit": 50
}/external/brands/:idGet a specific brand by ID
Example Request
curl https://api.carstrel.com/external/brands/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"name": "Toyota",
"slug": "toyota",
"logoUrl": "https://...",
"countryOfOrigin": "Japan",
"models": [...]
}
}/external/brands/:brandId/modelsGet all models for a specific brand
Example Request
curl https://api.carstrel.com/external/brands/{brandId}/models \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"name": "Camry",
"slug": "camry",
"bodyType": { "id": "...", "name": "Sedan" }
}
]
}/external/modelsGet all vehicle models
Query Parameters
brandIdFilter by brand ID
Example Request
curl https://api.carstrel.com/external/models \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"name": "Camry",
"slug": "camry",
"brand": { "id": "...", "name": "Toyota" },
"bodyType": { "id": "...", "name": "Sedan" }
}
],
"total": 5000
}/external/body-typesGet all body types (Sedan, SUV, Hatchback, etc.)
Example Request
curl https://api.carstrel.com/external/body-types \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"name": "Sedan",
"code": "SEDAN",
"description": "...",
"iconUrl": "https://..."
}
],
"total": 28
}/external/enginesGet all engine configurations
Example Request
curl https://api.carstrel.com/external/engines \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"name": "2.5L 4-Cylinder",
"type": "petrol",
"displacement": "2.5",
"horsepower": 203,
"transmission": "automatic"
}
]
}/external/engine-typesGet engine type enum values
Example Request
curl https://api.carstrel.com/external/engine-types \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": ["PETROL", "DIESEL", "ELECTRIC", "HYBRID", "PLUGIN_HYBRID"]
}/external/transmission-typesGet transmission type enum values
Example Request
curl https://api.carstrel.com/external/transmission-types \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": ["MANUAL", "AUTOMATIC", "CVT", "DCT", "SEMI_AUTOMATIC"]
}/external/drivetrain-typesGet drivetrain type enum values
Example Request
curl https://api.carstrel.com/external/drivetrain-types \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": ["FWD", "RWD", "AWD", "4WD"]
}/external/models/:idGet a specific vehicle model by ID
Example Request
curl https://api.carstrel.com/external/models/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"name": "Camry",
"slug": "camry",
"brand": { "id": "...", "name": "Toyota" },
"bodyType": { "id": "...", "name": "Sedan" }
}
}/external/body-types/:idGet a specific body type by ID
Example Request
curl https://api.carstrel.com/external/body-types/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"name": "Sedan",
"code": "SEDAN",
"description": "...",
"iconUrl": "https://..."
}
}/external/engines/:idGet a specific engine configuration by ID
Example Request
curl https://api.carstrel.com/external/engines/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"name": "2.5L 4-Cylinder",
"type": "petrol",
"displacement": "2.5",
"horsepower": 203,
"transmission": "automatic"
}
}/external/generationsGet all vehicle generations
Query Parameters
pagePage number (default: 1)
limitItems per page (default: 50)
Example Request
curl https://api.carstrel.com/external/generations \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"name": "XV70",
"slug": "xv70",
"model": { "id": "...", "name": "Camry" },
"startYear": 2018,
"endYear": null
}
],
"total": 120
}/external/generations/:idGet a specific generation by ID
Example Request
curl https://api.carstrel.com/external/generations/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"name": "XV70",
"slug": "xv70",
"model": { "id": "...", "name": "Camry" },
"startYear": 2018,
"endYear": null
}
}/external/trimsGet all vehicle trims
Query Parameters
pagePage number (default: 1)
limitItems per page (default: 50)
Example Request
curl https://api.carstrel.com/external/trims \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"name": "XLE",
"slug": "xle",
"model": { "id": "...", "name": "Camry" }
}
],
"total": 800
}/external/trims/:idGet a specific trim by ID
Example Request
curl https://api.carstrel.com/external/trims/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"name": "XLE",
"slug": "xle",
"model": { "id": "...", "name": "Camry" }
}
}Vehicle Listings
Access your organization's vehicle inventory.
/external/vehiclesGet your organization's available vehicles
Query Parameters
pagePage number (default: 1)
limitItems per page (default: 20, max: 100)
brandIdFilter by brand ID
modelIdFilter by model ID
bodyTypeIdFilter by body type ID
minYearMinimum year
maxYearMaximum year
minPriceMinimum price
maxPriceMaximum price
listingTypesale | rental | auction
sortSort field: createdDate (latest), impressionsCount (popularity/views), year, mileage, price, name
orderSort order: asc | desc
Example Request
curl https://api.carstrel.com/external/vehicles \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"name": "2023 Toyota Camry XLE",
"slug": "toyota-camry-2023-abc123",
"description": "Well-maintained sedan...",
"year": 2023,
"mileage": 15000,
"exteriorColor": "Silver",
"interiorColor": "Black",
"listingType": "sale",
"status": "available",
"model": {
"id": "uuid",
"name": "Camry",
"slug": "camry",
"brand": {
"id": "uuid",
"name": "Toyota",
"logoUrl": "https://..."
},
"bodyType": {
"id": "uuid",
"name": "Sedan",
"code": "SEDAN"
}
},
"engine": {
"id": "uuid",
"name": "2.5L 4-Cylinder",
"type": "petrol",
"horsepower": 203,
"transmission": "automatic"
},
"media": [
{
"id": "uuid",
"url": "https://...",
"type": "photo",
"category": "exterior",
"isFeatured": true,
"sortOrder": 1
}
],
"saleOptions": {
"price": 35000,
"isNegotiable": true,
"financingAvailable": true
},
"features": {
"safety": ["ABS", "Airbags"],
"exterior": ["Alloy Wheels"],
"interior": ["Leather Seats"],
"entertainment": ["Bluetooth", "CarPlay"]
},
"pickupDetails": {
"address": "123 Main St, Nairobi",
"locationName": "Nairobi"
},
"createdDate": "2024-01-15T10:30:00Z",
"updatedDate": "2024-01-20T14:15:00Z"
}
],
"total": 25,
"page": 1,
"limit": 20,
"totalPages": 2
}/external/vehicles/:idGet a specific vehicle by ID. Views/impressions are recorded automatically when this endpoint is called (for Syndication reporting). No separate view-count call is required.
Example Request
curl https://api.carstrel.com/external/vehicles/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"name": "2023 Toyota Camry XLE",
// ... full vehicle details
}
}/external/vehicles/stats/summaryGet statistics about your vehicle inventory
Example Request
curl https://api.carstrel.com/external/vehicles/stats/summary \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"totalVehicles": 25,
"availableVehicles": 20,
"byListingType": {
"sale": 15,
"rental": 8,
"auction": 2
},
"byBodyType": {
"Sedan": 10,
"SUV": 8,
"Hatchback": 5,
"Truck": 2
},
"byBrand": {
"Toyota": 8,
"Honda": 6,
"Mercedes-Benz": 4,
"BMW": 3
}
}
}Customer Authentication
Authenticate customers on your external website/app. Customers are automatically linked to your organization.
/external/auth/registerRegister a new customer or link existing user to your organization
Query Parameters
emailCustomer email (required)
passwordPassword, min 8 characters (required)
firstNameFirst name (required)
lastNameLast name (required)
phonePhone numbers { mobile?, whatsapp? }
Example Request
curl https://api.carstrel.com/external/auth/register \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 201,
"data": {
"isNewUser": true,
"isNewCustomer": true,
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "eyJhbGciOiJIUzI1NiIs...",
"expires_in": 3600,
"token_type": "Bearer",
"user": {
"id": "uuid",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe",
"phone": { "mobile": "+1234567890" }
}
}
}/external/auth/loginLogin a customer and automatically link to your organization if not already
Query Parameters
emailCustomer email (required)
passwordPassword (required)
Example Request
curl https://api.carstrel.com/external/auth/login \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"isNewCustomer": false,
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "eyJhbGciOiJIUzI1NiIs...",
"expires_in": 3600,
"token_type": "Bearer",
"user": {
"id": "uuid",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe"
}
}
}/external/auth/meGet current authenticated customer profile
Example Request
curl https://api.carstrel.com/external/auth/me \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"user": {
"id": "uuid",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe",
"phone": { "mobile": "+1234567890" },
"profileImageUrl": "https://..."
},
"customer": {
"customerId": "uuid",
"lifecycleStage": "PROSPECT",
"customerSegment": "new",
"isVip": false,
"totalPurchases": 0,
"totalSpent": 0,
"memberSince": "2024-01-15T10:30:00Z"
}
}
}Customer Management
Manage your organization's customers. All customer data is scoped to your organization.
/external/customersGet all customers linked to your organization
Query Parameters
pagePage number (default: 1)
limitItems per page (default: 20, max: 100)
searchSearch by name or email
segmentFilter by segment: new | regular | vip | at_risk
sortBySort by: createdDate | totalSpent | lastPurchaseDate | leadScore
sortOrderSort order: ASC | DESC
Example Request
curl https://api.carstrel.com/external/customers \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [
{
"id": "uuid",
"user": {
"id": "uuid",
"email": "customer@example.com",
"firstName": "John",
"lastName": "Doe",
"phone": { "mobile": "+1234567890" }
},
"stats": {
"totalPurchases": 3,
"totalSpent": 75000,
"lastPurchaseDate": "2024-01-10T10:30:00Z",
"totalVehiclesPurchased": 2,
"totalVehiclesRented": 1
},
"classification": {
"leadScore": 85,
"lifecycleStage": "CUSTOMER",
"customerSegment": "regular",
"isVip": false
},
"preferences": {
"vehicleTypes": ["SUV", "Sedan"],
"priceRange": { "min": 20000, "max": 50000 }
},
"tags": ["repeat-buyer", "financing-interest"],
"createdDate": "2024-01-15T10:30:00Z"
}
],
"total": 150,
"page": 1,
"limit": 20,
"totalPages": 8
}/external/customers/:idGet a specific customer by ID
Example Request
curl https://api.carstrel.com/external/customers/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"user": { ... },
"stats": { ... },
"classification": { ... },
"preferences": { ... },
"tags": [...],
"notes": "Interested in luxury vehicles"
}
}/external/customers/:idUpdate customer notes, tags, preferences, or VIP status
Query Parameters
notesDealer-specific notes about the customer
tagsArray of string tags
preferencesCustomer preferences object
isVipMark customer as VIP
Example Request
curl https://api.carstrel.com/external/customers/{id} \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"id": "uuid",
"notes": "Updated notes...",
"tags": ["vip", "repeat-buyer"],
"isVip": true,
"customerSegment": "vip"
}
}/external/customers/stats/summaryGet aggregate statistics about your customers
Example Request
curl https://api.carstrel.com/external/customers/stats/summary \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"totalCustomers": 150,
"vipCustomers": 12,
"totalRevenue": 2500000,
"averageSpent": 16667,
"totalTransactions": 280,
"averageLeadScore": 65,
"newCustomersLast30Days": 23,
"segmentBreakdown": {
"new": 45,
"regular": 78,
"vip": 12,
"atRisk": 15
}
}
}Engagement & Forms
Newsletter, contact form, test drives, and content. All require API key authentication.
/external/newsletter/subscribeSubscribe an email to the newsletter
Query Parameters
emailSubscriber email (required)
Example Request
curl https://api.carstrel.com/external/newsletter/subscribe \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": {
"email": "user@example.com",
"subscribed": true
}
}/external/newsletter/unsubscribeUnsubscribe an email from the newsletter
Query Parameters
emailEmail to unsubscribe (required)
Example Request
curl https://api.carstrel.com/external/newsletter/unsubscribe \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"message": "Successfully unsubscribed"
}/external/blogsGet list of blog/content posts
Query Parameters
pagePage number (default: 1)
limitItems per page (default: 20)
Example Request
curl https://api.carstrel.com/external/blogs \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 200,
"data": [],
"total": 0,
"page": 1,
"limit": 20,
"totalPages": 0
}/external/contact/submitSubmit a contact form
Query Parameters
nameSender name (required)
emailSender email (required)
messageMessage body (required)
subjectSubject (optional)
Example Request
curl https://api.carstrel.com/external/contact/submit \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 201,
"data": {
"success": true,
"message": "Message sent",
"referenceId": "uuid"
}
}/external/test-drivesCreate a test drive request
Query Parameters
vehicleIdVehicle ID (required)
nameCustomer name (required)
emailCustomer email (required)
phoneCustomer phone (optional)
preferredDatePreferred date (optional)
Example Request
curl https://api.carstrel.com/external/test-drives \
-H "x-api-key: sk_live_your_api_key"Response
{
"statusCode": 201,
"data": {
"id": "uuid",
"vehicleId": "uuid",
"status": "pending"
}
}