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

# Delete a customer

DELETE https://my.pivotal.app/api/v1/customers/{id}

Soft delete — the row is hidden from reads but preserved for audit. Idempotent.

Reference: https://docs.pivotal.app/api/reference/pivotal-api/customers/delete-customer

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: openapi
  version: 1.0.0
paths:
  /api/v1/customers/{id}:
    delete:
      operationId: delete-customer
      summary: Delete a customer
      description: >-
        Soft delete — the row is hidden from reads but preserved for audit.
        Idempotent.
      tags:
        - subpackage_customers
      parameters:
        - name: id
          in: path
          description: Numeric display_id or canonical cuid id.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: |
            Send your key in the `Authorization` header. Keys start with
            `pivotal_` (production) or `pivotal_test_` (test mode, no side
            effects on integrations). Rotate keys from
            `/admin/api-keys` — old keys 401 instantly when revoked.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deleted'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
servers:
  - url: https://my.pivotal.app
components:
  schemas:
    DeletedObject:
      type: string
      enum:
        - deleted
      title: DeletedObject
    Deleted:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/DeletedObject'
        id:
          type: string
        display_id:
          type: integer
        deleted:
          type: boolean
      required:
        - object
        - id
        - display_id
        - deleted
      title: Deleted
    ErrorErrorType:
      type: string
      enum:
        - invalid_request_error
        - authentication_error
        - permission_error
        - rate_limit_error
        - not_found
        - conflict
        - internal_error
      title: ErrorErrorType
    ErrorError:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ErrorErrorType'
        code:
          type: string
        message:
          type: string
        field:
          type: string
      required:
        - type
        - code
        - message
      title: ErrorError
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorError'
      required:
        - error
      title: Error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        Send your key in the `Authorization` header. Keys start with
        `pivotal_` (production) or `pivotal_test_` (test mode, no side
        effects on integrations). Rotate keys from
        `/admin/api-keys` — old keys 401 instantly when revoked.

```

## SDK Code Examples

```python
import requests

url = "https://my.pivotal.app/api/v1/customers/42"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://my.pivotal.app/api/v1/customers/42';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

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

```go
package main

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

func main() {

	url := "https://my.pivotal.app/api/v1/customers/42"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("DELETE", 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
require 'uri'
require 'net/http'

url = URI("https://my.pivotal.app/api/v1/customers/42")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

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

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

HttpResponse<String> response = Unirest.delete("https://my.pivotal.app/api/v1/customers/42")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://my.pivotal.app/api/v1/customers/42', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://my.pivotal.app/api/v1/customers/42");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://my.pivotal.app/api/v1/customers/42")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```