# List the caller's grants

Returns every grant the signed-in user has authorized, newest first, each with the client that holds it, the scopes in force including temporary elevation, when it was last used, and whether it is active, expired, or revoked. Requires a browser session. Scopes stored on a grant that are missing from the current vocabulary are dropped from the response.

GET `/v1/me/grants`

## Authorization

`Authorization` Bearer token · header required

`Authorization: Bearer <token>` with an API key (`sfa_` prefix), an OAuth access token, a session token, or a Space machine credential (`sfm_` prefix).

## Query parameters

`teamId` string

min length 1

## Responses

### 200 Response for status 200

`$schema` string <uri>

Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.

`data` object required

### Show properties

`grants` object[] required

#### Show properties

Array of `object`

- `id` string required
- `name` string required
- `kind` string required
  - Allowed: `agent`, `app`, `cli`, `handoff`, `api-key`, `machine`
- `clientName` string
- `logoUri` string
- `effectiveScopes` string[] required
- `scopes` object[] required

##### Show properties

Array of `object`

- `id` string required
- `label` string required
- `elevatedUntil` string <date-time>

matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$

- `teamScope` object | any required

###### Show properties

Any of:

- object
  - `teamId` string required
  - `teamName` string required

- `owner` object
  - `id` string required
  - `name` string required
  - `email` string <email> required
    
matches ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$

- `teamName` string
- `lastUsedAt` string <date-time> | any required

Show properties

Any of:

- string <date-time>
- any
-

- `lastUsedLabel` string
- `status` string required
  - Allowed: `active`, `expired`, `revoked`
- `createdAt` string <date-time> required

matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$  
- `expiresAt` string <date-time> required

### defaultError. Every 4xx and 5xx response is one RFC 9457 problem document served as `application/problem+json`.

- `$schema` string <uri>
- `type` string required
- `title` string required
- `status` integer required

min -9007199254740991 · max 9007199254740991
- `detail` string required
- `code` string required
- `pointer` string
- `details` object
  - Machine-readable context keyed by the error code.
- `suggestions` string[]
- `next` string[]
- `requestId` string required

## Try it

### Server

Base URL https://api.spacefast.com

Custom base URL Overrides the selected server when set.

### Parameters

- `teamId` query

Send

### Request

#### cURL

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

#### JavaScript

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

#### Python

```python
import requests

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

### Response

#### 200 default

```json
{
  "$schema": "http://example.com",
  "data": {
    "grants": [
      {
        "id": "string",
        "name": "string",
        "kind": "agent",
        "clientName": "string",
        "logoUri": "string",
        "effectiveScopes": [
          "string"
        ],
        "scopes": [
          {
            "id": "string",
            "label": "string",
            "elevatedUntil": "2019-08-24T14:15:22Z"
          }
        ],
        "teamScope": {
          "teamId": "string",
          "teamName": "string"
        },
        "owner": {
          "id": "string",
          "name": "string",
          "email": "user@example.com"
        },
        "teamName": "string",
        "lastUsedAt": "2019-08-24T14:15:22Z",
        "lastUsedLabel": "string",
        "status": "active",
        "createdAt": "2019-08-24T14:15:22Z",
        "expiresAt": "2019-08-24T14:15:22Z"
      }
    ]
  }
}
```

### Error response

```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"
}
```
