# List approvals

Returns the signed-in user’s own approvals. The pending list ranks elevation requests above routine resumes and then orders by newest; `scope=decided` returns the 25 most recent receipts instead. Requires a signed-in session.

## GET `/v1/approvals`

### Authorization

`Authorization` Bearer token · header required

```plaintext
Authorization: Bearer <token>
```

### Query parameters

- `teamId` string  
  min length 1
- `scope` string  
  Allowed: `pending`, `decided`

### Responses

#### 200 Response for status 200
- `$schema` string <uri>  
  Canonical JSON Schema URL for this response body.
- `data` object required  
  Show properties

- `decisions` object[] required  
      Show properties  
      Array of `object`

- `id` string required
        - `title` string required
        - `description` string required
        - `href` string required
        - `kind` string required  
          Allowed: `confirmation`, `elevation`, `resume`
        - `grantId` string required
        - `rationale` string required
        - `requestedScopes` string[] required
        - `status` string  
          Allowed: `approved`, `denied`, `expired`, `completed`, `executing`
        - `decidedAt` string <date-time> | any  
        - `expiresAt` string <date-time> required
        - `createdAt` string <date-time> required

#### default Error
Every 4xx and 5xx response is one RFC 9457 problem document served as `application/problem+json`.
- `$schema` string <uri>  
  Canonical JSON Schema URL for this response body.
- `type` string required  
  URL of the documentation page for this error.
- `title` string required  
  Human-readable name of the error type.
- `status` integer required  
  HTTP status of the response, repeated in the body.
- `detail` string required  
  What went wrong in this request.
- `code` string required  
  Stable snake_case error code.
- `pointer` string  
  RFC 6901 JSON Pointer to the request field or batch entry that failed.
- `details` object
- `suggestions` string[]  
  Recovery steps safe to show to a person.
- `next` string[]  
  Commands or API requests to run next, usable as written.
- `requestId` string required  
  ID of this request, from the `X-Request-Id` header or generated.

## Try it

### Server
Base URL https://api.spacefast.com

### Authorization
Bearer token

### Parameters
- `teamId` query
- `scope` query — pending, decided

## Send

### Request

#### cURL
```bash
curl -X GET "https://api.spacefast.com/v1/approvals" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

#### JavaScript
```javascript
const response = await fetch("https://api.spacefast.com/v1/approvals", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  }
});
```

#### Python
```python
import requests

response = requests.get(
    "https://api.spacefast.com/v1/approvals",
    headers={
        "Authorization": "Bearer YOUR_TOKEN"
    },
)
```

### Response

#### 200 default
```json
{
  "$schema": "http://example.com",
  "data": {
    "decisions": [
      {
        "id": "string",
        "title": "string",
        "description": "string",
        "href": "string",
        "kind": "confirmation",
        "grantId": "string",
        "rationale": "string",
        "requestedScopes": [
          "string"
        ],
        "status": "approved",
        "decidedAt": "2019-08-24T14:15:22Z",
        "expiresAt": "2019-08-24T14:15:22Z",
        "createdAt": "2019-08-24T14:15:22Z"
      }
    ]
  }
}
```

```json
{
  "$schema": "http://example.com",
  "type": "string",
  "title": "string",
  "status": -9007199254740991,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": [
    "string"
  ],
  "next": [
    "string"
  ],
  "requestId": "string"
}
```
