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

> Delete a user profile you are the owner of.

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/docs/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

<PlansAvailable plans={["business"]} maxPackRequired={false} />

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.
</Warning>

<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](/docs/apis/profiles/get-profiles) with `actionLog` set to `true`.
</Note>

## Header Parameters

<HeaderAPI profileKeyRequired={true} />

## Body Parameters

<ParamField body="title" type="string" default="0" required>
  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.
</ParamField>

<RequestExample>
  ```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}");
          }
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```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."
  }
  ```
</ResponseExample>
