> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a User Profile

> Permanently delete a User Profile you own and all associated posts by Profile Key or title. Learn about rate limits and how deletion affects billing.

Delete a user profile you are the owner of. The Profile Key in the header parameter is the User Profile to be deleted.

> [!WARNING]
>
> Deleting a user profile permanently removes the profile and all associated posts—this action is
> irreversible and cannot be undone. You can delete up to 8 user profiles per second, so please
> stagger your API calls when performing bulk deletions to stay within rate limits.

> [!NOTE]
>
> Each monthly billing period is charged on the highest number of user profiles reached on any
> single day of that period, and never on fewer than the minimum included in your plan — deleting
> profiles while you are at that minimum does not lower the charge. That high-water mark only ever
> rises: deleting a profile stops later days from pushing it higher, but it cannot bring down a
> figure the period has already reached, so once your peak is behind you the saving lands in your
> next billing cycle. This does not apply to the Launch plan, which has a flat price, or to custom
> and Enterprise agreements, whose own terms apply. To see your daily user profile counts, call
> [Get User Profiles](https://www.ayrshare.com/docs/apis/profiles/get-profiles.md) with `actionLog` set to `true`.

## Header Parameters

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string` *required*

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## Body Parameters

**title** `string` *required* (default: 0)

Title of the User Profile to delete. Must be present if `profileKey` is not passed. `title` is
case-sensitive and must match the User Profile title.

```javascript cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-H 'Profile-Key: PROFILE_KEY' \
-X DELETE https://api.ayrshare.com/api/profiles
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";
const profileKey = "PROFILE_KEY";

fetch("https://api.ayrshare.com/api/profiles", {
      method: "DELETE",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${API_KEY}`,
        "Profile-Key": profileKey
      }
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

payload = {}
headers = {'Content-Type': 'application/json',
        'Authorization': 'Bearer API_KEY', 'Profile-Key': 'PROFILE_KEY'}

r = requests.delete('https://api.ayrshare.com/api/profiles',
    json=payload,
    headers=headers)

print(r.json())
```

```php PHP theme={"system"}
<?php

$url = 'https://api.ayrshare.com/api/profiles';
$apiKey = 'API_KEY';        // Replace with your actual API key
$profileKey = 'PROFILE_KEY'; // Replace with your actual Profile key

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'Authorization: Bearer ' . $apiKey,
        'Profile-Key: ' . $profileKey
    ],
]);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
} else {
    echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}

curl_close($curl);
```

```csharp C# theme={"system"}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        using var client = new HttpClient();

        var requestUri = "https://api.ayrshare.com/api/profiles";
        var bearerToken = "Bearer API_KEY";
        var profileKey = "PROFILE_KEY";

        using var request = new HttpRequestMessage(HttpMethod.Delete, requestUri);
        request.Headers.Add("Authorization", bearerToken);
        request.Headers.Add("Profile-Key", profileKey);

        try
        {
            using var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            var responseBody = await response.Content.ReadAsStringAsync();
            Console.WriteLine(responseBody);
        }
        catch (HttpRequestException e)
        {
            Console.WriteLine($"Error: {e.Message}");
        }
    }
}
```

```javascript 200: Success theme={"system"}
{
    "status": "success",
    "refId": "823nd82nd92jsnn2932"
}
```

```javascript 500: Error Deleting theme={"system"}
{
    "action": "delete",
    "status": "error",
    "code": 147,
    "message": "Error deleting profile."
}
```

```javascript 403: Profile Key Not Found theme={"system"}
{
    "action": "post",
    "status": "error",
    "code": 144,
    "message": "Some profiles not found. Please verify the Profile Keys."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.