Create Lead
curl --request POST \
--url https://uk.api.aiosmedical.com/external/v1/leads \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"data": {
"surname": "Doe",
"forename": "John",
"phone": "+44 7700 900123",
"gender": "Male",
"ethnicity": "White British",
"dateOfBirth": "1990-01-01",
"billingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"shippingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"height": {
"unit": "metric",
"feet": "5",
"inches": "10",
"cm": "178"
},
"weight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"goalWeight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"prescriptionMedication": [
{
"medication": "Metformin",
"reason": "Type 2 Diabetes"
}
],
"surgeries": [
{
"value": "Appendectomy",
"intervalTime": "2 years ago",
"details": "Laparoscopic appendectomy, no complications"
}
],
"weightLossInjections": {
"drugName": "Ozempic",
"strength": "1mg",
"weightPriorToTreatment": "85kg"
},
"allergicReactionToWeightLossInjections": {
"description": "Nausea and dizziness after injection"
},
"medicalConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"healthConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"familyHistoryOfMedicalConditions": {
"value": "Heart disease",
"relation": "Father"
},
"allergyToMedicationOrSupplement": "Penicillin"
}
}
'import requests
url = "https://uk.api.aiosmedical.com/external/v1/leads"
payload = {
"email": "[email protected]",
"data": {
"surname": "Doe",
"forename": "John",
"phone": "+44 7700 900123",
"gender": "Male",
"ethnicity": "White British",
"dateOfBirth": "1990-01-01",
"billingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"shippingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"height": {
"unit": "metric",
"feet": "5",
"inches": "10",
"cm": "178"
},
"weight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"goalWeight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"prescriptionMedication": [
{
"medication": "Metformin",
"reason": "Type 2 Diabetes"
}
],
"surgeries": [
{
"value": "Appendectomy",
"intervalTime": "2 years ago",
"details": "Laparoscopic appendectomy, no complications"
}
],
"weightLossInjections": {
"drugName": "Ozempic",
"strength": "1mg",
"weightPriorToTreatment": "85kg"
},
"allergicReactionToWeightLossInjections": { "description": "Nausea and dizziness after injection" },
"medicalConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"healthConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"familyHistoryOfMedicalConditions": {
"value": "Heart disease",
"relation": "Father"
},
"allergyToMedicationOrSupplement": "Penicillin"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
data: {
surname: 'Doe',
forename: 'John',
phone: '+44 7700 900123',
gender: 'Male',
ethnicity: 'White British',
dateOfBirth: '1990-01-01',
billingAddress: {
addressLine1: '123 High Street',
addressLine2: 'Flat 2B',
city: 'London',
state: 'England',
region: 'Greater London',
zipCode: 'SW1A 1AA'
},
shippingAddress: {
addressLine1: '123 High Street',
addressLine2: 'Flat 2B',
city: 'London',
state: 'England',
region: 'Greater London',
zipCode: 'SW1A 1AA'
},
height: {unit: 'metric', feet: '5', inches: '10', cm: '178'},
weight: {unit: 'metric', kg: '75', stones: '11', pounds: '165'},
goalWeight: {unit: 'metric', kg: '75', stones: '11', pounds: '165'},
prescriptionMedication: [{medication: 'Metformin', reason: 'Type 2 Diabetes'}],
surgeries: [
{
value: 'Appendectomy',
intervalTime: '2 years ago',
details: 'Laparoscopic appendectomy, no complications'
}
],
weightLossInjections: {drugName: 'Ozempic', strength: '1mg', weightPriorToTreatment: '85kg'},
allergicReactionToWeightLossInjections: {description: 'Nausea and dizziness after injection'},
medicalConditions: [
{
condition: 'Diabetes',
desc: 'Type 2 diabetes diagnosed in 2020',
kidneyDiseaseType: 'Chronic kidney disease stage 3'
}
],
healthConditions: [
{
condition: 'Diabetes',
desc: 'Type 2 diabetes diagnosed in 2020',
kidneyDiseaseType: 'Chronic kidney disease stage 3'
}
],
familyHistoryOfMedicalConditions: {value: 'Heart disease', relation: 'Father'},
allergyToMedicationOrSupplement: 'Penicillin'
}
})
};
fetch('https://uk.api.aiosmedical.com/external/v1/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uk.api.aiosmedical.com/external/v1/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'data' => [
'surname' => 'Doe',
'forename' => 'John',
'phone' => '+44 7700 900123',
'gender' => 'Male',
'ethnicity' => 'White British',
'dateOfBirth' => '1990-01-01',
'billingAddress' => [
'addressLine1' => '123 High Street',
'addressLine2' => 'Flat 2B',
'city' => 'London',
'state' => 'England',
'region' => 'Greater London',
'zipCode' => 'SW1A 1AA'
],
'shippingAddress' => [
'addressLine1' => '123 High Street',
'addressLine2' => 'Flat 2B',
'city' => 'London',
'state' => 'England',
'region' => 'Greater London',
'zipCode' => 'SW1A 1AA'
],
'height' => [
'unit' => 'metric',
'feet' => '5',
'inches' => '10',
'cm' => '178'
],
'weight' => [
'unit' => 'metric',
'kg' => '75',
'stones' => '11',
'pounds' => '165'
],
'goalWeight' => [
'unit' => 'metric',
'kg' => '75',
'stones' => '11',
'pounds' => '165'
],
'prescriptionMedication' => [
[
'medication' => 'Metformin',
'reason' => 'Type 2 Diabetes'
]
],
'surgeries' => [
[
'value' => 'Appendectomy',
'intervalTime' => '2 years ago',
'details' => 'Laparoscopic appendectomy, no complications'
]
],
'weightLossInjections' => [
'drugName' => 'Ozempic',
'strength' => '1mg',
'weightPriorToTreatment' => '85kg'
],
'allergicReactionToWeightLossInjections' => [
'description' => 'Nausea and dizziness after injection'
],
'medicalConditions' => [
[
'condition' => 'Diabetes',
'desc' => 'Type 2 diabetes diagnosed in 2020',
'kidneyDiseaseType' => 'Chronic kidney disease stage 3'
]
],
'healthConditions' => [
[
'condition' => 'Diabetes',
'desc' => 'Type 2 diabetes diagnosed in 2020',
'kidneyDiseaseType' => 'Chronic kidney disease stage 3'
]
],
'familyHistoryOfMedicalConditions' => [
'value' => 'Heart disease',
'relation' => 'Father'
],
'allergyToMedicationOrSupplement' => 'Penicillin'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://uk.api.aiosmedical.com/external/v1/leads"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"data\": {\n \"surname\": \"Doe\",\n \"forename\": \"John\",\n \"phone\": \"+44 7700 900123\",\n \"gender\": \"Male\",\n \"ethnicity\": \"White British\",\n \"dateOfBirth\": \"1990-01-01\",\n \"billingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"shippingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"height\": {\n \"unit\": \"metric\",\n \"feet\": \"5\",\n \"inches\": \"10\",\n \"cm\": \"178\"\n },\n \"weight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"goalWeight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"prescriptionMedication\": [\n {\n \"medication\": \"Metformin\",\n \"reason\": \"Type 2 Diabetes\"\n }\n ],\n \"surgeries\": [\n {\n \"value\": \"Appendectomy\",\n \"intervalTime\": \"2 years ago\",\n \"details\": \"Laparoscopic appendectomy, no complications\"\n }\n ],\n \"weightLossInjections\": {\n \"drugName\": \"Ozempic\",\n \"strength\": \"1mg\",\n \"weightPriorToTreatment\": \"85kg\"\n },\n \"allergicReactionToWeightLossInjections\": {\n \"description\": \"Nausea and dizziness after injection\"\n },\n \"medicalConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"healthConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"familyHistoryOfMedicalConditions\": {\n \"value\": \"Heart disease\",\n \"relation\": \"Father\"\n },\n \"allergyToMedicationOrSupplement\": \"Penicillin\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://uk.api.aiosmedical.com/external/v1/leads")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"data\": {\n \"surname\": \"Doe\",\n \"forename\": \"John\",\n \"phone\": \"+44 7700 900123\",\n \"gender\": \"Male\",\n \"ethnicity\": \"White British\",\n \"dateOfBirth\": \"1990-01-01\",\n \"billingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"shippingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"height\": {\n \"unit\": \"metric\",\n \"feet\": \"5\",\n \"inches\": \"10\",\n \"cm\": \"178\"\n },\n \"weight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"goalWeight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"prescriptionMedication\": [\n {\n \"medication\": \"Metformin\",\n \"reason\": \"Type 2 Diabetes\"\n }\n ],\n \"surgeries\": [\n {\n \"value\": \"Appendectomy\",\n \"intervalTime\": \"2 years ago\",\n \"details\": \"Laparoscopic appendectomy, no complications\"\n }\n ],\n \"weightLossInjections\": {\n \"drugName\": \"Ozempic\",\n \"strength\": \"1mg\",\n \"weightPriorToTreatment\": \"85kg\"\n },\n \"allergicReactionToWeightLossInjections\": {\n \"description\": \"Nausea and dizziness after injection\"\n },\n \"medicalConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"healthConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"familyHistoryOfMedicalConditions\": {\n \"value\": \"Heart disease\",\n \"relation\": \"Father\"\n },\n \"allergyToMedicationOrSupplement\": \"Penicillin\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://uk.api.aiosmedical.com/external/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"data\": {\n \"surname\": \"Doe\",\n \"forename\": \"John\",\n \"phone\": \"+44 7700 900123\",\n \"gender\": \"Male\",\n \"ethnicity\": \"White British\",\n \"dateOfBirth\": \"1990-01-01\",\n \"billingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"shippingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"height\": {\n \"unit\": \"metric\",\n \"feet\": \"5\",\n \"inches\": \"10\",\n \"cm\": \"178\"\n },\n \"weight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"goalWeight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"prescriptionMedication\": [\n {\n \"medication\": \"Metformin\",\n \"reason\": \"Type 2 Diabetes\"\n }\n ],\n \"surgeries\": [\n {\n \"value\": \"Appendectomy\",\n \"intervalTime\": \"2 years ago\",\n \"details\": \"Laparoscopic appendectomy, no complications\"\n }\n ],\n \"weightLossInjections\": {\n \"drugName\": \"Ozempic\",\n \"strength\": \"1mg\",\n \"weightPriorToTreatment\": \"85kg\"\n },\n \"allergicReactionToWeightLossInjections\": {\n \"description\": \"Nausea and dizziness after injection\"\n },\n \"medicalConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"healthConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"familyHistoryOfMedicalConditions\": {\n \"value\": \"Heart disease\",\n \"relation\": \"Father\"\n },\n \"allergyToMedicationOrSupplement\": \"Penicillin\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "[email protected]",
"data": {
"name": "John Doe",
"email": "[email protected]",
"phone": "1234567890",
"address": "123 Main St, Anytown, USA"
},
"createdAt": "2025-06-04T12:00:00.000Z"
}{
"status": 400,
"error": {
"message": [
"email must be an email"
],
"error": "Bad Request",
"statusCode": 400
},
"timestamp": "2025-06-04T12:00:00.000Z",
"path": "/external/v1/leads"
}{
"status": 500,
"error": "Internal Server Error",
"timestamp": "2025-06-04T12:00:00.000Z",
"path": "/external/v1/leads"
}Leads
Create Lead
Creates a new lead
POST
/
external
/
v1
/
leads
Create Lead
curl --request POST \
--url https://uk.api.aiosmedical.com/external/v1/leads \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"data": {
"surname": "Doe",
"forename": "John",
"phone": "+44 7700 900123",
"gender": "Male",
"ethnicity": "White British",
"dateOfBirth": "1990-01-01",
"billingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"shippingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"height": {
"unit": "metric",
"feet": "5",
"inches": "10",
"cm": "178"
},
"weight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"goalWeight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"prescriptionMedication": [
{
"medication": "Metformin",
"reason": "Type 2 Diabetes"
}
],
"surgeries": [
{
"value": "Appendectomy",
"intervalTime": "2 years ago",
"details": "Laparoscopic appendectomy, no complications"
}
],
"weightLossInjections": {
"drugName": "Ozempic",
"strength": "1mg",
"weightPriorToTreatment": "85kg"
},
"allergicReactionToWeightLossInjections": {
"description": "Nausea and dizziness after injection"
},
"medicalConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"healthConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"familyHistoryOfMedicalConditions": {
"value": "Heart disease",
"relation": "Father"
},
"allergyToMedicationOrSupplement": "Penicillin"
}
}
'import requests
url = "https://uk.api.aiosmedical.com/external/v1/leads"
payload = {
"email": "[email protected]",
"data": {
"surname": "Doe",
"forename": "John",
"phone": "+44 7700 900123",
"gender": "Male",
"ethnicity": "White British",
"dateOfBirth": "1990-01-01",
"billingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"shippingAddress": {
"addressLine1": "123 High Street",
"addressLine2": "Flat 2B",
"city": "London",
"state": "England",
"region": "Greater London",
"zipCode": "SW1A 1AA"
},
"height": {
"unit": "metric",
"feet": "5",
"inches": "10",
"cm": "178"
},
"weight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"goalWeight": {
"unit": "metric",
"kg": "75",
"stones": "11",
"pounds": "165"
},
"prescriptionMedication": [
{
"medication": "Metformin",
"reason": "Type 2 Diabetes"
}
],
"surgeries": [
{
"value": "Appendectomy",
"intervalTime": "2 years ago",
"details": "Laparoscopic appendectomy, no complications"
}
],
"weightLossInjections": {
"drugName": "Ozempic",
"strength": "1mg",
"weightPriorToTreatment": "85kg"
},
"allergicReactionToWeightLossInjections": { "description": "Nausea and dizziness after injection" },
"medicalConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"healthConditions": [
{
"condition": "Diabetes",
"desc": "Type 2 diabetes diagnosed in 2020",
"kidneyDiseaseType": "Chronic kidney disease stage 3"
}
],
"familyHistoryOfMedicalConditions": {
"value": "Heart disease",
"relation": "Father"
},
"allergyToMedicationOrSupplement": "Penicillin"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
data: {
surname: 'Doe',
forename: 'John',
phone: '+44 7700 900123',
gender: 'Male',
ethnicity: 'White British',
dateOfBirth: '1990-01-01',
billingAddress: {
addressLine1: '123 High Street',
addressLine2: 'Flat 2B',
city: 'London',
state: 'England',
region: 'Greater London',
zipCode: 'SW1A 1AA'
},
shippingAddress: {
addressLine1: '123 High Street',
addressLine2: 'Flat 2B',
city: 'London',
state: 'England',
region: 'Greater London',
zipCode: 'SW1A 1AA'
},
height: {unit: 'metric', feet: '5', inches: '10', cm: '178'},
weight: {unit: 'metric', kg: '75', stones: '11', pounds: '165'},
goalWeight: {unit: 'metric', kg: '75', stones: '11', pounds: '165'},
prescriptionMedication: [{medication: 'Metformin', reason: 'Type 2 Diabetes'}],
surgeries: [
{
value: 'Appendectomy',
intervalTime: '2 years ago',
details: 'Laparoscopic appendectomy, no complications'
}
],
weightLossInjections: {drugName: 'Ozempic', strength: '1mg', weightPriorToTreatment: '85kg'},
allergicReactionToWeightLossInjections: {description: 'Nausea and dizziness after injection'},
medicalConditions: [
{
condition: 'Diabetes',
desc: 'Type 2 diabetes diagnosed in 2020',
kidneyDiseaseType: 'Chronic kidney disease stage 3'
}
],
healthConditions: [
{
condition: 'Diabetes',
desc: 'Type 2 diabetes diagnosed in 2020',
kidneyDiseaseType: 'Chronic kidney disease stage 3'
}
],
familyHistoryOfMedicalConditions: {value: 'Heart disease', relation: 'Father'},
allergyToMedicationOrSupplement: 'Penicillin'
}
})
};
fetch('https://uk.api.aiosmedical.com/external/v1/leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uk.api.aiosmedical.com/external/v1/leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => '[email protected]',
'data' => [
'surname' => 'Doe',
'forename' => 'John',
'phone' => '+44 7700 900123',
'gender' => 'Male',
'ethnicity' => 'White British',
'dateOfBirth' => '1990-01-01',
'billingAddress' => [
'addressLine1' => '123 High Street',
'addressLine2' => 'Flat 2B',
'city' => 'London',
'state' => 'England',
'region' => 'Greater London',
'zipCode' => 'SW1A 1AA'
],
'shippingAddress' => [
'addressLine1' => '123 High Street',
'addressLine2' => 'Flat 2B',
'city' => 'London',
'state' => 'England',
'region' => 'Greater London',
'zipCode' => 'SW1A 1AA'
],
'height' => [
'unit' => 'metric',
'feet' => '5',
'inches' => '10',
'cm' => '178'
],
'weight' => [
'unit' => 'metric',
'kg' => '75',
'stones' => '11',
'pounds' => '165'
],
'goalWeight' => [
'unit' => 'metric',
'kg' => '75',
'stones' => '11',
'pounds' => '165'
],
'prescriptionMedication' => [
[
'medication' => 'Metformin',
'reason' => 'Type 2 Diabetes'
]
],
'surgeries' => [
[
'value' => 'Appendectomy',
'intervalTime' => '2 years ago',
'details' => 'Laparoscopic appendectomy, no complications'
]
],
'weightLossInjections' => [
'drugName' => 'Ozempic',
'strength' => '1mg',
'weightPriorToTreatment' => '85kg'
],
'allergicReactionToWeightLossInjections' => [
'description' => 'Nausea and dizziness after injection'
],
'medicalConditions' => [
[
'condition' => 'Diabetes',
'desc' => 'Type 2 diabetes diagnosed in 2020',
'kidneyDiseaseType' => 'Chronic kidney disease stage 3'
]
],
'healthConditions' => [
[
'condition' => 'Diabetes',
'desc' => 'Type 2 diabetes diagnosed in 2020',
'kidneyDiseaseType' => 'Chronic kidney disease stage 3'
]
],
'familyHistoryOfMedicalConditions' => [
'value' => 'Heart disease',
'relation' => 'Father'
],
'allergyToMedicationOrSupplement' => 'Penicillin'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://uk.api.aiosmedical.com/external/v1/leads"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"data\": {\n \"surname\": \"Doe\",\n \"forename\": \"John\",\n \"phone\": \"+44 7700 900123\",\n \"gender\": \"Male\",\n \"ethnicity\": \"White British\",\n \"dateOfBirth\": \"1990-01-01\",\n \"billingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"shippingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"height\": {\n \"unit\": \"metric\",\n \"feet\": \"5\",\n \"inches\": \"10\",\n \"cm\": \"178\"\n },\n \"weight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"goalWeight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"prescriptionMedication\": [\n {\n \"medication\": \"Metformin\",\n \"reason\": \"Type 2 Diabetes\"\n }\n ],\n \"surgeries\": [\n {\n \"value\": \"Appendectomy\",\n \"intervalTime\": \"2 years ago\",\n \"details\": \"Laparoscopic appendectomy, no complications\"\n }\n ],\n \"weightLossInjections\": {\n \"drugName\": \"Ozempic\",\n \"strength\": \"1mg\",\n \"weightPriorToTreatment\": \"85kg\"\n },\n \"allergicReactionToWeightLossInjections\": {\n \"description\": \"Nausea and dizziness after injection\"\n },\n \"medicalConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"healthConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"familyHistoryOfMedicalConditions\": {\n \"value\": \"Heart disease\",\n \"relation\": \"Father\"\n },\n \"allergyToMedicationOrSupplement\": \"Penicillin\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://uk.api.aiosmedical.com/external/v1/leads")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"data\": {\n \"surname\": \"Doe\",\n \"forename\": \"John\",\n \"phone\": \"+44 7700 900123\",\n \"gender\": \"Male\",\n \"ethnicity\": \"White British\",\n \"dateOfBirth\": \"1990-01-01\",\n \"billingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"shippingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"height\": {\n \"unit\": \"metric\",\n \"feet\": \"5\",\n \"inches\": \"10\",\n \"cm\": \"178\"\n },\n \"weight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"goalWeight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"prescriptionMedication\": [\n {\n \"medication\": \"Metformin\",\n \"reason\": \"Type 2 Diabetes\"\n }\n ],\n \"surgeries\": [\n {\n \"value\": \"Appendectomy\",\n \"intervalTime\": \"2 years ago\",\n \"details\": \"Laparoscopic appendectomy, no complications\"\n }\n ],\n \"weightLossInjections\": {\n \"drugName\": \"Ozempic\",\n \"strength\": \"1mg\",\n \"weightPriorToTreatment\": \"85kg\"\n },\n \"allergicReactionToWeightLossInjections\": {\n \"description\": \"Nausea and dizziness after injection\"\n },\n \"medicalConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"healthConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"familyHistoryOfMedicalConditions\": {\n \"value\": \"Heart disease\",\n \"relation\": \"Father\"\n },\n \"allergyToMedicationOrSupplement\": \"Penicillin\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://uk.api.aiosmedical.com/external/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"data\": {\n \"surname\": \"Doe\",\n \"forename\": \"John\",\n \"phone\": \"+44 7700 900123\",\n \"gender\": \"Male\",\n \"ethnicity\": \"White British\",\n \"dateOfBirth\": \"1990-01-01\",\n \"billingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"shippingAddress\": {\n \"addressLine1\": \"123 High Street\",\n \"addressLine2\": \"Flat 2B\",\n \"city\": \"London\",\n \"state\": \"England\",\n \"region\": \"Greater London\",\n \"zipCode\": \"SW1A 1AA\"\n },\n \"height\": {\n \"unit\": \"metric\",\n \"feet\": \"5\",\n \"inches\": \"10\",\n \"cm\": \"178\"\n },\n \"weight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"goalWeight\": {\n \"unit\": \"metric\",\n \"kg\": \"75\",\n \"stones\": \"11\",\n \"pounds\": \"165\"\n },\n \"prescriptionMedication\": [\n {\n \"medication\": \"Metformin\",\n \"reason\": \"Type 2 Diabetes\"\n }\n ],\n \"surgeries\": [\n {\n \"value\": \"Appendectomy\",\n \"intervalTime\": \"2 years ago\",\n \"details\": \"Laparoscopic appendectomy, no complications\"\n }\n ],\n \"weightLossInjections\": {\n \"drugName\": \"Ozempic\",\n \"strength\": \"1mg\",\n \"weightPriorToTreatment\": \"85kg\"\n },\n \"allergicReactionToWeightLossInjections\": {\n \"description\": \"Nausea and dizziness after injection\"\n },\n \"medicalConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"healthConditions\": [\n {\n \"condition\": \"Diabetes\",\n \"desc\": \"Type 2 diabetes diagnosed in 2020\",\n \"kidneyDiseaseType\": \"Chronic kidney disease stage 3\"\n }\n ],\n \"familyHistoryOfMedicalConditions\": {\n \"value\": \"Heart disease\",\n \"relation\": \"Father\"\n },\n \"allergyToMedicationOrSupplement\": \"Penicillin\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "[email protected]",
"data": {
"name": "John Doe",
"email": "[email protected]",
"phone": "1234567890",
"address": "123 Main St, Anytown, USA"
},
"createdAt": "2025-06-04T12:00:00.000Z"
}{
"status": 400,
"error": {
"message": [
"email must be an email"
],
"error": "Bad Request",
"statusCode": 400
},
"timestamp": "2025-06-04T12:00:00.000Z",
"path": "/external/v1/leads"
}{
"status": 500,
"error": "Internal Server Error",
"timestamp": "2025-06-04T12:00:00.000Z",
"path": "/external/v1/leads"
}Body
application/json
Example:
Show child attributes
Show child attributes
Response
Lead created successfully
Example:
"123e4567-e89b-12d3-a456-426614174000"
Example:
Example:
{
"name": "John Doe",
"email": "[email protected]",
"phone": "1234567890",
"address": "123 Main St, Anytown, USA"
}
Example:
"2025-06-04T12:00:00.000Z"
⌘I