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

# Delete Audience

> Archive an audience (soft delete).

Archives the specified audience by setting its status to `archived`. This is a soft delete — the audience data is retained but will no longer appear in the default audience list. Archived audiences can be retrieved by passing `status=archived` to the [List Audiences](/api-reference/v2/audiences/list-audiences) endpoint.

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the audience to archive.
</ParamField>

## Response Fields

<ResponseField name="success" type="boolean">
  Whether the audience was archived successfully.
</ResponseField>

<ResponseField name="archived" type="boolean">
  Confirms the audience has been archived. Always `true` on success.
</ResponseField>

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.tracklysms.com/api/v2/audiences/664f1a2b3c4d5e6f7a8b9c0d" \
    -H "X-Api-Key: trk_your_api_key_here"
  ```

  ```python Python theme={null}
  import requests

  audience_id = "664f1a2b3c4d5e6f7a8b9c0d"

  response = requests.delete(
      f"https://api.tracklysms.com/api/v2/audiences/{audience_id}",
      headers={"X-Api-Key": "trk_your_api_key_here"},
  )

  result = response.json()
  if result["success"]:
      print("Audience archived successfully")
  ```

  ```javascript Node.js theme={null}
  const audienceId = "664f1a2b3c4d5e6f7a8b9c0d";

  const response = await fetch(
    `https://api.tracklysms.com/api/v2/audiences/${audienceId}`,
    {
      method: "DELETE",
      headers: { "X-Api-Key": "trk_your_api_key_here" },
    }
  );

  const result = await response.json();
  if (result.success) {
    console.log("Audience archived successfully");
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 — Success theme={null}
  {
    "success": true,
    "archived": true
  }
  ```

  ```json 404 — Not Found theme={null}
  {
    "error": "Audience not found",
    "code": "not_found"
  }
  ```

  ```json 401 — Unauthorized theme={null}
  {
    "error": "Invalid credentials",
    "code": "invalid_credentials"
  }
  ```
</ResponseExample>

## Error Codes

| HTTP Status | Error Code            | Description                                                                |
| ----------- | --------------------- | -------------------------------------------------------------------------- |
| 401         | `invalid_credentials` | API key is missing or invalid                                              |
| 403         | `account_suspended`   | Your account is suspended. Resolve outstanding billing or contact support. |
| 429         | `rate_limited`        | Request throttled; retry with exponential backoff after the window resets. |
| 404         | `not_found`           | No audience exists with the specified ID                                   |

## Next Steps

<CardGroup cols={2}>
  <Card title="Creating Audiences" icon="users" href="/guides/audiences/creating-audiences">
    Manage audience segments
  </Card>

  <Card title="Create Schedule" icon="calendar" href="/api-reference/v2/schedules/create-schedule">
    Schedule a campaign
  </Card>
</CardGroup>
