Delete Profile
curl --request DELETE \
--url https://api.example.com/api/profiles/{profileId}import requests
url = "https://api.example.com/api/profiles/{profileId}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/api/profiles/{profileId}', 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://api.example.com/api/profiles/{profileId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://api.example.com/api/profiles/{profileId}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/api/profiles/{profileId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/profiles/{profileId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "<string>"
}Profiles
Delete Profile
Delete an existing profile permanently
DELETE
/
api
/
profiles
/
{profileId}
Delete Profile
curl --request DELETE \
--url https://api.example.com/api/profiles/{profileId}import requests
url = "https://api.example.com/api/profiles/{profileId}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/api/profiles/{profileId}', 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://api.example.com/api/profiles/{profileId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://api.example.com/api/profiles/{profileId}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.example.com/api/profiles/{profileId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/profiles/{profileId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"message": "<string>"
}Authentication
This endpoint requires authentication using a JWT token in the Authorization header.Path Parameters
string
required
The unique identifier of the profile to delete
Response
string
required
Success message confirming profile deletion
Example Request
curl -X DELETE https://api.contafy.com/api/profiles/prof_1234567890 \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json"
Example Response
{
"message": "Profile deleted successfully"
}
Error Responses
401 Unauthorized
{
"error": "Unauthorized",
"message": "Invalid or missing authentication token"
}
403 Forbidden
{
"error": "Forbidden",
"message": "You do not have permission to delete this profile"
}
404 Not Found
{
"error": "Not Found",
"message": "Profile not found"
}
409 Conflict
{
"error": "Conflict",
"message": "Cannot delete profile with active invoices. Please archive or transfer invoices first."
}
500 Internal Server Error
{
"error": "Internal Server Error",
"message": "An error occurred while deleting the profile"
}
Important Notes
- Deleting a profile is a permanent action and cannot be undone
- Profiles with active invoices or ongoing transactions may be protected from deletion
- Consider archiving or freezing profiles instead of deleting them to preserve historical data
- All associated data and configurations will be permanently removed