Customers
Delete customer
Delete a customer record by ID from your Alvys tenant using the Public API, permanently removing the customer profile, contacts, and associated metadata.
DELETE
/
api
/
p
/
v
{version}
/
customers
/
{id}
Delete customer
curl --request DELETE \
--url https://integrations.alvys.com/api/p/v{version}/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'If-Match: <if-match>'const options = {
method: 'DELETE',
headers: {'If-Match': '<if-match>', Authorization: 'Bearer <token>'}
};
fetch('https://integrations.alvys.com/api/p/v{version}/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/customers/{id}"
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/customers/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://integrations.alvys.com/api/p/v{version}/customers/{id}")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.asString();{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}The Delete Customer endpoint soft-deletes (deactivates) a business company. It sets the customer’s
The following header is required:
Replace
Status to Inactive; the record stays visible on GET and search. To reactivate it, send a PATCH with Status: Active. For more information on how versioning works and how to include it in your requests, please refer to the Versioning page.
This endpoint uses optimistic concurrency. You must send the customer’s current ETag in an If-Match header. The token is returned on the ETag response header of a GET, and in the body of a create/update response. If the token does not match the current record the request fails with 412 Precondition Failed; refetch with GET to obtain a fresh value and retry.
Request Parameters
The following parameters are required in the URL path:| Parameter | Type | Required | Description |
|---|---|---|---|
| version | String | Yes | The version of the API. |
| id | String | Yes | The unique identifier of the customer. |
| Header | Required | Description |
|---|---|---|
| If-Match | Yes | The current ETag of the customer being deleted. |
Example CURL Request
curl --location --request DELETE 'https://integrations.alvys.com/api/p/v1/customers/01fec4d332ed49ff96595c8d4434ea96' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'If-Match: "00000000-0000-0000-0000-000000000002"'
YOUR_ACCESS_TOKEN with your actual Bearer token and If-Match with the customer’s current ETag.
Response
On success the endpoint returns204 No Content with an empty body.
Status Codes
| Status | Meaning |
|---|---|
| 204 | The customer was deactivated. |
| 401 | The request was not authenticated. |
| 403 | The caller lacks permission to delete customers. |
| 404 | No customer with the given id exists. |
| 409 | The operation conflicted with the current state of the record. |
| 412 | The supplied If-Match token did not match the current record. Refetch with GET and retry. |
| 428 | The If-Match header is required but was not provided. |
Rate Limits
All endpoints are subject to rate limits to protect the API from traffic spikes. For detailed information on rate limits, please refer to the Rate Limits section. This page is interactive, allowing you to try a request by completing the fields for the parameters below. As you fill out the parameters, the CURL command on the right side of the page will be automatically updated.Authorizations
OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.
Headers
The customer's current ETag (from a prior GET response header, or the ETag field of a create/update response), for optimistic concurrency. Required; if omitted the request is rejected with 428, and if it does not match the current record with 412.
Path Parameters
API version (e.g., 1.0)
Example:
"1.0"
Response
No Content
⌘I
Delete customer
curl --request DELETE \
--url https://integrations.alvys.com/api/p/v{version}/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'If-Match: <if-match>'const options = {
method: 'DELETE',
headers: {'If-Match': '<if-match>', Authorization: 'Bearer <token>'}
};
fetch('https://integrations.alvys.com/api/p/v{version}/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://integrations.alvys.com/api/p/v{version}/customers/{id}"
headers = {
"If-Match": "<if-match>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://integrations.alvys.com/api/p/v{version}/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"If-Match: <if-match>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://integrations.alvys.com/api/p/v{version}/customers/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("If-Match", "<if-match>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://integrations.alvys.com/api/p/v{version}/customers/{id}")
.header("If-Match", "<if-match>")
.header("Authorization", "Bearer <token>")
.asString();{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}{
"Type": "<string>",
"Title": "<string>",
"Status": 123,
"Detail": "<string>",
"Instance": "<string>"
}