Update a user profile
PATCH /v2/users/profile
Updates the first name, last name, or phone number of the existing user identified by the bearer token. This endpoint does not create a user or accept a user ID in the path or request body.
Security
| Name | In | Description |
|---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
This endpoint requires a user access token with the connect:users:update_profile scope. A client_credentials token and the broader connect:users scope alone are not sufficient.
To get a user access token, your OAuth application must be configured for the external_user_assertion grant and the connect:users:update_profile scope. Send a request to POST /v2/oauth/token with these form parameters:
grant_type:external_user_assertionclient_idandclient_secret: your application credentials. Keep the client secret on your server.assertion: Base64-encoded JSON containing{"external_user_id":"<provider_uid>"}, whereprovider_uididentifies an existing user in your integration. The assertion is not a JSON Web Token (JWT).scope:connect:users:update_profile
The grant does not create users.
Parameters
None.Request
Omitted, empty-string, and null fields preserve the existing values. You can't clear a field with this endpoint. Send a JSON object. An empty object ({}) returns the current profile without changing it, but an empty HTTP request body is invalid.
| Field | Type | Required | Description |
|---|---|---|---|
first_name | string | New first name. Omitted, empty, or null values preserve the existing value. | |
last_name | string | New last name. Omitted, empty, or null values preserve the existing value. | |
phone_number | string | New phone number. Use E.164 format, such as +14155550123. Spaces and dashes are removed. Omitted, empty, or null values preserve the existing value. |
Request examples
- cURL
- Java
- Python
- Go
- Node.js
curl --request PATCH \
--url https://connect.instacart.com/v2/users/profile \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"first_name": "Jane",
"last_name": "Doe",
"phone_number": "+1 415-555-0123"
}'
HttpResponse<String> response = Unirest.patch("https://connect.instacart.com/v2/users/profile")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer <token>")
.body("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"phone_number\": \"+1 415-555-0123\"\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
payload = "{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"phone_number\": \"+1 415-555-0123\"\n}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "Bearer <token>"
}
conn.request("PATCH", "/v2/users/profile", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://connect.instacart.com/v2/users/profile"
payload := strings.NewReader("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"phone_number\": \"+1 415-555-0123\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'connect.instacart.com',
port: null,
path: '/v2/users/profile',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer <token>'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({first_name: 'Jane', last_name: 'Doe', phone_number: '+1 415-555-0123'}));
req.end();
Response
A successful request returns the first_name, last_name, and phone_number fields directly, without a data wrapper.
| Field | Type | Required | Description |
|---|---|---|---|
first_name | string | The user's first name after the update. | |
last_name | string | The user's last name after the update. | |
phone_number | string | The user's phone number after the update. |
Response examples
The default rate limit is 50 requests per 10 seconds per user for this endpoint. Your integration's settings can differ. A rate-limited request returns HTTP 429 with the plain-text body Too many requests, please try again later. instead of a Connect JSON error.
200 Success
200User profile updated
{
"first_name": "Jane",
"last_name": "Doe",
"phone_number": "+14155550123"
}
4XX Errors
Error responses return either a single error or multiple errors.
| HTTP Code | Cause | Error Message | Error Code | Error Meta |
|---|---|---|---|---|
400 | invalidRequestBody | "invalid request body" | 1001 | Not applicable |
400 | invalidFirstName | "First name is invalid" | 1001 | {"key":"first_name"} |
400 | invalidPhone | "Phone is invalid" | 1001 | {"key":"phone"} |
401 | unauthorized | "Unauthorized" | null | Not applicable |
403 | forbidden | "Forbidden" | null | Not applicable |
403 | userNotActive | "User Not Active" | null | Not applicable |
404 | userNotFound | "User not found" | 4000 | Not applicable |
Server errors
HTTP 500: Internal server error
An internal server error returns error code 5000. The response omits the top-level meta field.
{
"error": {
"message": "Sorry, an unexpected error has occurred. Our team has been notified. Please try again later.",
"code": 5000
}
}
HTTP 503: Service unavailable
When a downstream service times out or is unavailable, the response returns error code 5003 and includes an empty top-level meta object.
{
"error": {
"message": "Sorry, an unexpected error has occurred. Our team has been notified. Please try again later.",
"code": 5003
},
"meta": {}
}