curl --request PATCH \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me"
payload = {
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({firstName: 'Emma', lastName: 'Bishop', phone: '+14165550134'})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me', 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://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me",
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([
'firstName' => 'Emma',
'lastName' => 'Bishop',
'phone' => '+14165550134'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me"
payload := strings.NewReader("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "CLIENT_PROFILE",
"clientId": "<string>",
"projectId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"firstNameNormalized": "<string>",
"lastNameNormalized": "<string>",
"fullNameNormalized": "<string>",
"email": "<string>",
"emailNormalized": "<string>",
"invitationStatus": "NONE",
"stripeCustomerId": "<string>",
"stripeAccountId": "<string>",
"active": true,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"addresses": [
{
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"id": "<string>",
"unitNumber": "4B",
"source": "BOOKING",
"latitude": 123,
"longitude": 123
}
],
"phone": "<string>",
"defaultAddressId": "<string>",
"externalId": "<string>",
"externalData": {},
"userId": "<string>",
"notes": "<string>",
"lifetimeSpend": 123,
"orderCount": 123,
"lastPurchaseAt": "<string>",
"lastPaymentMethodId": "<string>",
"lastPayment": {
"type": "CARD",
"brand": "<string>",
"last4": "<string>",
"paidAt": "<string>",
"expMonth": 6,
"expYear": 123
},
"defaultLocale": "<string>"
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}Update the authenticated client's contact details
Changes the signed-in client’s first name, last name and/or phone number in this project. The profile is resolved from the client user JWT, never from the URL, and requires both the API key (x-api-key) and the JWT (Authorization: Bearer). The caller must already be onboarded: POST /clients/me first, or this is a 404.
Send only the fields to change; an omitted field is left unchanged, but a body with nothing to update is a 400. Names are trimmed and must be 1–80 characters: they can be changed but not cleared, so a blank or null name is a 400. The name is the client’s record in this project only (what the business sees on orders, bookings and emails); it does not rename the person’s MarketBox account. Send phone: null (or a blank string) to clear the stored phone. The phone is validated and stored in E.164 form (+14165550134). Send it as E.164, or as a national North American (NANP) number such as (416) 555-0134; numbers outside North America must start with + and the country code, or they are rejected. An invalid number is a 400 and nothing is written.
Call it before creating the order (POST /orders) so booking and order emails use the updated name. The change is also copied to the client’s Stripe customer on the project’s connected account; if that copy fails, the profile is still updated and this still returns 200. Returns the whole profile, with its saved addresses.
curl --request PATCH \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me"
payload = {
"firstName": "Emma",
"lastName": "Bishop",
"phone": "+14165550134"
}
headers = {
"x-api-key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({firstName: 'Emma', lastName: 'Bishop', phone: '+14165550134'})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me', 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://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me",
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([
'firstName' => 'Emma',
'lastName' => 'Bishop',
'phone' => '+14165550134'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me"
payload := strings.NewReader("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me")
.header("x-api-key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/clients/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"Emma\",\n \"lastName\": \"Bishop\",\n \"phone\": \"+14165550134\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "CLIENT_PROFILE",
"clientId": "<string>",
"projectId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"firstNameNormalized": "<string>",
"lastNameNormalized": "<string>",
"fullNameNormalized": "<string>",
"email": "<string>",
"emailNormalized": "<string>",
"invitationStatus": "NONE",
"stripeCustomerId": "<string>",
"stripeAccountId": "<string>",
"active": true,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"addresses": [
{
"addressOneLine": "10 Main St, Toronto, ON M5V 1A1, Canada",
"streetNumber": "10",
"streetName": "Main St",
"city": "Toronto",
"state": "ON",
"country": "CA",
"zipCode": "M5V 1A1",
"id": "<string>",
"unitNumber": "4B",
"source": "BOOKING",
"latitude": 123,
"longitude": 123
}
],
"phone": "<string>",
"defaultAddressId": "<string>",
"externalId": "<string>",
"externalData": {},
"userId": "<string>",
"notes": "<string>",
"lifetimeSpend": 123,
"orderCount": 123,
"lastPurchaseAt": "<string>",
"lastPaymentMethodId": "<string>",
"lastPayment": {
"type": "CARD",
"brand": "<string>",
"last4": "<string>",
"paidAt": "<string>",
"expMonth": 6,
"expYear": 123
},
"defaultLocale": "<string>"
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}Authorizations
API key minted in the MarketBox dashboard. Scope is restricted to the projects you select at creation time. Every route needs the key's standard API access (*) except POST /v1/projects/{projectId}/events, which needs events:write; a key without * is refused with 403 CAPABILITY_NOT_GRANTED.