Update profile
curl --request PATCH \
--url https://fit.kleep.ai/v1/profiles/{profile_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Kleep-Retailer: <kleep-retailer>' \
--data '
{
"measurements": {
"height_cm": 170
}
}
'import requests
url = "https://fit.kleep.ai/v1/profiles/{profile_id}"
payload = { "measurements": { "height_cm": 170 } }
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Kleep-Retailer': '<kleep-retailer>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({measurements: {height_cm: 170}})
};
fetch('https://fit.kleep.ai/v1/profiles/{profile_id}', 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://fit.kleep.ai/v1/profiles/{profile_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'measurements' => [
'height_cm' => 170
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Kleep-Retailer: <kleep-retailer>"
],
]);
$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://fit.kleep.ai/v1/profiles/{profile_id}"
payload := strings.NewReader("{\n \"measurements\": {\n \"height_cm\": 170\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://fit.kleep.ai/v1/profiles/{profile_id}")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"measurements\": {\n \"height_cm\": 170\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/profiles/{profile_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"measurements\": {\n \"height_cm\": 170\n }\n}"
response = http.request(request)
puts response.read_body{
"profile_id": "<string>",
"measurements": {
"gender": "female",
"age": 34,
"height_cm": 168,
"weight_kg": 61,
"body_shape": {
"stomach": "medium",
"hips": "wide"
}
},
"customer_id": "<string>",
"source": "conversation",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "profile_not_found",
"message": "No profile prf_x"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Partner API reference
Update profile
Correct answers (“actually I’m 170 cm”). Send only the fields that change.
PATCH
/
profiles
/
{profile_id}
Update profile
curl --request PATCH \
--url https://fit.kleep.ai/v1/profiles/{profile_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Kleep-Retailer: <kleep-retailer>' \
--data '
{
"measurements": {
"height_cm": 170
}
}
'import requests
url = "https://fit.kleep.ai/v1/profiles/{profile_id}"
payload = { "measurements": { "height_cm": 170 } }
headers = {
"Kleep-Retailer": "<kleep-retailer>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Kleep-Retailer': '<kleep-retailer>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({measurements: {height_cm: 170}})
};
fetch('https://fit.kleep.ai/v1/profiles/{profile_id}', 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://fit.kleep.ai/v1/profiles/{profile_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'measurements' => [
'height_cm' => 170
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Kleep-Retailer: <kleep-retailer>"
],
]);
$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://fit.kleep.ai/v1/profiles/{profile_id}"
payload := strings.NewReader("{\n \"measurements\": {\n \"height_cm\": 170\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Kleep-Retailer", "<kleep-retailer>")
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://fit.kleep.ai/v1/profiles/{profile_id}")
.header("Kleep-Retailer", "<kleep-retailer>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"measurements\": {\n \"height_cm\": 170\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://fit.kleep.ai/v1/profiles/{profile_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Kleep-Retailer"] = '<kleep-retailer>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"measurements\": {\n \"height_cm\": 170\n }\n}"
response = http.request(request)
puts response.read_body{
"profile_id": "<string>",
"measurements": {
"gender": "female",
"age": 34,
"height_cm": 168,
"weight_kg": 61,
"body_shape": {
"stomach": "medium",
"hips": "wide"
}
},
"customer_id": "<string>",
"source": "conversation",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "retailer_not_enabled",
"message": "Retailer 9b1f… has not enabled this partner"
}
}{
"error": {
"code": "profile_not_found",
"message": "No profile prf_x"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}Authorizations
Your partner API key: kp_live_… in production, kp_test_… on the sandbox retailer.
Headers
The retailer's Kleep public_id. Every call is scoped to one retailer.
Path Parameters
Body
application/json
Response
Updated.
What the shopper tells you in the conversation. Convert imperial units before sending.
Show child attributes
Show child attributes
Example:
{
"gender": "female",
"age": 34,
"height_cm": 168,
"weight_kg": 61,
"body_shape": { "stomach": "medium", "hips": "wide" }
}
Where the profile was created.
Available options:
conversation, website_questionnaire, body_scan 