> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fleetwire.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fleetwire.io/_mcp/server.

# Update customer

PUT https://api.fleetwire.io/api/v2/customers/{id}
Content-Type: application/json

**Scope:** `customers:write`

Changes only the fields you send; send `null` to clear one. A customer must keep an email or a phone. Fires `customer.updated`.

Reference: https://docs.fleetwire.io/api-reference/customers/put-customers-id

## Authentication

- `Authorization` header (bearer token, required) — An API token from **Settings → API tokens** in Fleetwire, sent as `Authorization: Bearer …`. Each token carries scopes: `read` for every GET, plus write scopes such as `bookings:write`.

## Servers

- `https://api.fleetwire.io/api` (Production, default)
- `https://staging.fleetwire.io/api` (Sandbox (Partner API))

## Request

### Path parameters

- `id` (string, required) — Customer ID

### Body (application/json)

This endpoint expects an object.

- `first_name` (string, optional)
- `last_name` (string, optional)
- `email` (string, optional, nullable) — Required when there is no `phone` (on create).
- `phone` (string, optional, nullable) — Required when there is no `email` (on create).
- `dob` (date, optional, nullable) — Date of birth, before today.
- `address_1` (string, optional, nullable)
- `address_2` (string, optional, nullable)
- `city` (string, optional, nullable)
- `state` (string, optional, nullable)
- `postal_code` (string, optional, nullable)
- `country` (string, optional, nullable)

## Response

### 200

OK

- `id` (string, optional)
- `first_name` (string, optional)
- `last_name` (string, optional)
- `email` (string, optional)
- `phone` (string, optional)
- `dob` (string, optional)
- `address` (V2CustomersIdPutResponsesContentApplicationJsonSchemaAddress, optional)
- `source` (string, optional)
- `email_verified_at` (string, optional)
- `identity_verified_at` (string, optional, nullable)
- `bookings_count` (integer, optional)
- `total_spent_in_cents` (integer, optional)
- `last_trip_end` (string, optional)
- `created_at` (string, optional)
- `updated_at` (string, optional)

## Errors

### 401 Unauthorized Error

Missing or invalid token.

- `message` (string, required)

### 403 Forbidden Error

The token doesn't carry the scope this needs, or the plan doesn't include API access.

- `message` (string, required)

### 404 Not Found Error

Not found, or it isn't your company's.

- `message` (string, required)

### 422 Unprocessable Entity Error

The request is invalid.

- `message` (string, required)
- `errors` (map from string to list of string, required) — Each invalid field with its problems.

### 429 Too Many Requests Error

Too many requests. Wait for the `Retry-After` header (seconds).

- `message` (string, required)

## Types

### V2CustomersIdPutResponsesContentApplicationJsonSchemaAddress

- `address_1` (string, optional)
- `address_2` (string, optional, nullable)
- `city` (string, optional)
- `state` (string, optional)
- `postal_code` (string, optional)
- `country` (string, optional)

## Examples

### Updated

**Response**

```json
{
  "id": "r_EXAMPLE1",
  "first_name": "Jordan",
  "last_name": "Rivera",
  "email": "jordan.rivera@example.com",
  "phone": "+13105550142",
  "dob": "1990-04-18",
  "address": {
    "address_1": "100 Example St",
    "address_2": null,
    "city": "Austin",
    "state": "TX",
    "postal_code": "78701",
    "country": "US"
  },
  "source": "direct",
  "email_verified_at": "2026-10-01T14:30:00Z",
  "identity_verified_at": null,
  "bookings_count": 3,
  "total_spent_in_cents": 73250,
  "last_trip_end": "2026-10-12 10:00:00",
  "created_at": "2026-08-12T16:04:26Z",
  "updated_at": "2026-10-12T18:20:01Z"
}
```

**SDK Code**

```python Updated
import requests

url = "https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1"

headers = {"Authorization": "Bearer <token>"}

response = requests.put(url, headers=headers)

print(response.json())
```

```javascript Updated
const url = 'https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1';
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Updated
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1"

	req, _ := http.NewRequest("PUT", url, nil)

	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))

}
```

```ruby Updated
require 'uri'
require 'net/http'

url = URI("https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Updated
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Updated
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Updated
using RestSharp;

var client = new RestClient("https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Updated
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Customers_putCustomersId_example

**Request**

```json
{
  "email": "jordan.rivera@example.com"
}
```

**Response**

```json
{
  "id": "r_EXAMPLE1",
  "first_name": "Jordan",
  "last_name": "Rivera",
  "email": "jordan.rivera@example.com",
  "phone": "+13105550142",
  "dob": "1990-04-18",
  "address": {
    "address_1": "100 Example St",
    "address_2": null,
    "city": "Austin",
    "state": "TX",
    "postal_code": "78701",
    "country": "US"
  },
  "source": "direct",
  "email_verified_at": "2026-10-01T14:30:00Z",
  "identity_verified_at": null,
  "bookings_count": 3,
  "total_spent_in_cents": 73250,
  "last_trip_end": "2026-10-12 10:00:00",
  "created_at": "2026-08-12T16:04:26Z",
  "updated_at": "2026-10-12T18:20:01Z"
}
```

**SDK Code**

```python Customers_putCustomersId_example
import requests

url = "https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1"

payload = { "email": "jordan.rivera@example.com" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Customers_putCustomersId_example
const url = 'https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"email":"jordan.rivera@example.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Customers_putCustomersId_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1"

	payload := strings.NewReader("{\n  \"email\": \"jordan.rivera@example.com\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	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(res)
	fmt.Println(string(body))

}
```

```ruby Customers_putCustomersId_example
require 'uri'
require 'net/http'

url = URI("https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"jordan.rivera@example.com\"\n}"

response = http.request(request)
puts response.read_body
```

```java Customers_putCustomersId_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"jordan.rivera@example.com\"\n}")
  .asString();
```

```php Customers_putCustomersId_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1', [
  'body' => '{
  "email": "jordan.rivera@example.com"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Customers_putCustomersId_example
using RestSharp;

var client = new RestClient("https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"email\": \"jordan.rivera@example.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Customers_putCustomersId_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["email": "jordan.rivera@example.com"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fleetwire.io/api/v2/customers/r_EXAMPLE1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```