# Delete Instagram account

> DELETE https://api.nabrah.ai/api/ext/omni_v2/instagram/inboxes

Group: Instagram. Page: https://www.nabrah.ai/en/docs/api-reference/instagram/delete-instagram-account

Remove one of the project's Instagram accounts. Its conversations and its customers' contacts are deleted, the agent stops replying on it, and member access to it is removed. Choose the account with `inbox_id`. The response is a boolean indicating whether the removal succeeded.

## Irreversible

Removing an account deletes its conversations and its customers' contacts. Connect it again from the platform to start over.

- **Agents**: An agent that answered on the deleted account stays configured and keeps answering on its other accounts.

Use GET /api/ext/omni_v2/instagram/inboxes to confirm which inbox(es) exist before deleting.

## Choosing the Instagram account

A project can connect more than one Instagram account. `inbox_id` selects the account this call works on.

- **One account**: `inbox_id` is optional; the project's only Instagram account is used.
- **More than one account**: `inbox_id` is required and the call returns 400 without it. An id that is not one of the project's Instagram accounts returns 404. Fields: `inbox_id`.

List the accounts and their ids with GET /api/ext/omni_v2/instagram/inboxes.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Query parameters

- `inbox_id` (string, optional): The `id` of the Instagram account to use, from GET /api/ext/omni_v2/instagram/inboxes. Use `inboxes[].id` (a UUID), not the numeric `inboxes[].inbox_id`. Optional while the project has one Instagram account; required once it has more than one.

## Response

### 200 Successful Response

Content type: `application/json`

```json
false
```

### 422 Validation Error

Content type: `application/json`

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

## Request examples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.nabrah.ai/api/ext/omni_v2/instagram/inboxes' \
  --header 'X-API-Key: <your-api-key>'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/omni_v2/instagram/inboxes"
headers = {"X-API-Key": "<your-api-key>"}

response = requests.delete(url, headers=headers)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.nabrah.ai/api/ext/omni_v2/instagram/inboxes", {
  method: "DELETE",
  headers: { "X-API-Key": "<your-api-key>" },
});

const data = await response.json();
console.log(data);
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://api.nabrah.ai/api/ext/omni_v2/instagram/inboxes", nil)
	req.Header.Set("X-API-Key", "<your-api-key>")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
