# Keep a stale integrated account

> Source: https://truto.one/docs/api-reference/admin/integrated-accounts/keep/

`POST /integrated-account/{id}/keep`

Resource: **Integrated accounts**

A stale integrated account (`needs_reauth` and unchanged for 7 days) is deleted 30 days after it went stale, and never sooner than 15 days after Truto found it stale, once automatic deletion is on. Keep moves its `delete_after` to 30 days from now. The 15- and 7-day reminders then come again before the new date, and the account can be kept again.
The account stays stale: its calls are still refused with `401` and `truto_error_code: integrated_account_needs_reauth`. Reconnect it to resume them, which also cancels the deletion.
Returns `404` when the account is not stale: never marked, or reconnected or changed since, which ended it.

## Path parameters

- **`id`** _(string, required)_
  The stale integrated account to keep.

## Response body

- **`id`** _(string)_
  The integrated account.
- **`delete_after`** _(string)_
  When the account is now deleted, 30 days from this call. `null` while automatic deletion of stale accounts, or the pausing of stale accounts itself, is off, since nothing deletes the account then. The account itself shows the date again only once its next 15-day reminder has gone out.

## Errors

| Status | Description |
| :----- | :---------- |
| `404` | No such integrated account, or it is not stale. |

## Code examples

### curl

```bash
curl -X POST 'https://api.truto.one/integrated-account/{id}/keep' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.truto.one/integrated-account/{id}/keep', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
});

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

### Python

```python
import requests

url = "https://api.truto.one/integrated-account/{id}/keep"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}

response = requests.post(url, headers=headers, params=params)
print(response.json())
```
