# The next approval waiting on you after this one

> Source: https://elaichi.ai/docs/api-reference/workflows/automation-approval/getnextautomationapproval/

`GET /automation-approval/{id}/next`

Resource: **Workflow Approval** · API: **Workflows**

## Path parameters

- **`id`** _(string, required)_
  Resource id

## Query parameters

- **`automation_id`** _(string)_
- **`owner_user_id`** _(string)_
  Only requests on behalf of this workflow owner.
- **`sort`** _(string)_
  `expiring` (soonest deadline first), `oldest` or `newest` (by when it was raised; the default). A cursor only continues the sort it was made for.
  Allowed: `expiring`, `oldest`, `newest`
- **`q`** _(string)_
  Matches the approval title and message. LIKE wildcards are matched literally. Max 200 characters.

## Response body

- **`next`** _(object,null)_

## Code examples

### curl

```bash
curl -X GET 'https://api.elaichi.ai/automation-approval/<id>/next' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.elaichi.ai/automation-approval/<id>/next', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
});

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

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/automation-approval/<id>/next"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}

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