> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.agentmail.to/llms.txt. For full content including API reference and SDK examples, see https://docs.agentmail.to/llms-full.txt.

# List API Keys

GET https://api.agentmail.to/v0/pods/{pod_id}/api-keys

**CLI:**

```bash
agentmail pods api-keys list --pod-id <pod_id>
```

Reference: https://docs.agentmail.to/api-reference/pods/api-keys/list

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.agentmail.to` (prod, default)
- `https://x402.api.agentmail.to` (prod-x402)
- `https://mpp.api.agentmail.to` (prod-mpp)
- `https://api.agentmail.eu` (eu-prod)

## Request

### Path parameters

- `pod_id` (string, required) — ID of pod.

### Query parameters

- `limit` (integer, optional) — Limit of number of items returned.
- `page_token` (string, optional) — Page token for pagination.

## Response

### 200

- `count` (integer, required) — Number of items returned.
- `api_keys` (list of object or object, required) — Every credential family, ordered by `created_at`. `type` restricts to one family.
  - Bearer API Key
    - `type` ("bearer", required)
    - `api_key_id` (string, required) — ID of api key.
    - `prefix` (string, required) — Prefix of api key.
    - `name` (string, required) — Name of api key.
    - `created_at` (datetime, required) — Time at which api key was created.
    - `updated_at` (datetime, required) — Time at which api key was last updated.
    - `pod_id` (string, optional) — Pod ID the api key is scoped to. If set, the key can only access resources within this pod.
    - `inbox_id` (string, optional) — Inbox ID the api key is scoped to. If set, the key can only access resources within this inbox.
    - `used_at` (datetime, optional) — Time at which api key was last used.
    - `permissions` (object, optional) — Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.
      - `inbox_read` (boolean, optional) — Read inbox details.
      - `inbox_create` (boolean, optional) — Create new inboxes.
      - `inbox_update` (boolean, optional) — Update inbox settings.
      - `inbox_delete` (boolean, optional) — Delete inboxes.
      - `message_read` (boolean, optional) — Read messages. Also required to read threads.
      - `message_send` (boolean, optional) — Send messages.
      - `message_update` (boolean, optional) — Update message labels. Also required to update threads.
      - `message_delete` (boolean, optional) — Delete messages. Also required to delete threads.
      - `label_spam_read` (boolean, optional) — Access messages labeled spam.
      - `label_blocked_read` (boolean, optional) — Access messages labeled blocked.
      - `label_unauthenticated_read` (boolean, optional) — Access messages labeled unauthenticated.
      - `label_trash_read` (boolean, optional) — Access messages labeled trash.
      - `draft_read` (boolean, optional) — Read drafts.
      - `draft_create` (boolean, optional) — Create drafts.
      - `draft_update` (boolean, optional) — Update drafts.
      - `draft_delete` (boolean, optional) — Delete drafts.
      - `draft_send` (boolean, optional) — Send drafts.
      - `webhook_read` (boolean, optional) — Read webhook configurations.
      - `webhook_create` (boolean, optional) — Create webhooks.
      - `webhook_update` (boolean, optional) — Update webhooks.
      - `webhook_delete` (boolean, optional) — Delete webhooks.
      - `domain_read` (boolean, optional) — Read domain details.
      - `domain_create` (boolean, optional) — Create domains.
      - `domain_update` (boolean, optional) — Update domains.
      - `domain_delete` (boolean, optional) — Delete domains.
      - `list_entry_read` (boolean, optional) — Read list entries.
      - `list_entry_create` (boolean, optional) — Create list entries.
      - `list_entry_delete` (boolean, optional) — Delete list entries.
      - `metrics_read` (boolean, optional) — Read metrics.
      - `api_key_read` (boolean, optional) — Read API keys.
      - `api_key_create` (boolean, optional) — Create API keys.
      - `api_key_update` (boolean, optional) — Update API keys.
      - `api_key_delete` (boolean, optional) — Delete API keys.
      - `provider_connect` (boolean, optional) — Sign in to providers as an inbox: connect a provider, authorize an inbox, and mint the sign-in keys. Omitted on a new bearer key means false, whatever else the key holds.
      - `provider_share_owner` (boolean, optional) — Share the organization owner's name and email with providers at sign-in. One permission for both values.
      - `account_update` (boolean, optional) — Update accounts: disable or re-enable an inbox's sign-in at a provider. Reading accounts needs only `inbox_read`.
      - `pod_read` (boolean, optional) — Read pods.
      - `pod_create` (boolean, optional) — Create pods.
      - `pod_delete` (boolean, optional) — Delete pods.
    - `expires_at` (datetime, optional) — Time at which api key expires. Omitted when it does not expire.
  - Public Key Credential
    - `type` ("public_key", required)
    - `api_key_id` (string, required) — ID of api key.
    - `name` (string, required) — Name of api key.
    - `permissions` (object, required) — Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.
      - `inbox_read` (boolean, optional) — Read inbox details.
      - `inbox_create` (boolean, optional) — Create new inboxes.
      - `inbox_update` (boolean, optional) — Update inbox settings.
      - `inbox_delete` (boolean, optional) — Delete inboxes.
      - `message_read` (boolean, optional) — Read messages. Also required to read threads.
      - `message_send` (boolean, optional) — Send messages.
      - `message_update` (boolean, optional) — Update message labels. Also required to update threads.
      - `message_delete` (boolean, optional) — Delete messages. Also required to delete threads.
      - `label_spam_read` (boolean, optional) — Access messages labeled spam.
      - `label_blocked_read` (boolean, optional) — Access messages labeled blocked.
      - `label_unauthenticated_read` (boolean, optional) — Access messages labeled unauthenticated.
      - `label_trash_read` (boolean, optional) — Access messages labeled trash.
      - `draft_read` (boolean, optional) — Read drafts.
      - `draft_create` (boolean, optional) — Create drafts.
      - `draft_update` (boolean, optional) — Update drafts.
      - `draft_delete` (boolean, optional) — Delete drafts.
      - `draft_send` (boolean, optional) — Send drafts.
      - `webhook_read` (boolean, optional) — Read webhook configurations.
      - `webhook_create` (boolean, optional) — Create webhooks.
      - `webhook_update` (boolean, optional) — Update webhooks.
      - `webhook_delete` (boolean, optional) — Delete webhooks.
      - `domain_read` (boolean, optional) — Read domain details.
      - `domain_create` (boolean, optional) — Create domains.
      - `domain_update` (boolean, optional) — Update domains.
      - `domain_delete` (boolean, optional) — Delete domains.
      - `list_entry_read` (boolean, optional) — Read list entries.
      - `list_entry_create` (boolean, optional) — Create list entries.
      - `list_entry_delete` (boolean, optional) — Delete list entries.
      - `metrics_read` (boolean, optional) — Read metrics.
      - `api_key_read` (boolean, optional) — Read API keys.
      - `api_key_create` (boolean, optional) — Create API keys.
      - `api_key_update` (boolean, optional) — Update API keys.
      - `api_key_delete` (boolean, optional) — Delete API keys.
      - `provider_connect` (boolean, optional) — Sign in to providers as an inbox: connect a provider, authorize an inbox, and mint the sign-in keys. Omitted on a new bearer key means false, whatever else the key holds.
      - `provider_share_owner` (boolean, optional) — Share the organization owner's name and email with providers at sign-in. One permission for both values.
      - `account_update` (boolean, optional) — Update accounts: disable or re-enable an inbox's sign-in at a provider. Reading accounts needs only `inbox_read`.
      - `pod_read` (boolean, optional) — Read pods.
      - `pod_create` (boolean, optional) — Create pods.
      - `pod_delete` (boolean, optional) — Delete pods.
    - `created_by` (object, required) — The bearer API key that created the credential. Provenance only; the credential outlives it.
      - `api_key_id` (string, required) — ID of api key.
    - `created_at` (datetime, required) — Time at which api key was created.
    - `updated_at` (datetime, required) — Time at which api key was last updated.
    - `client_id` (string, optional) — Caller-chosen alias for a public key, unique within the organization and reusable after deletion. Accepted in place of `api_key_id` on get, update, and delete. Registration is idempotent on it: the same alias returns the existing key, a conflicting one returns `409`. URL-safe; no slash or `@`.
    - `public_key` (object, optional) — Registered public key material and its server-computed RFC 7638 thumbprint.
      - `jwk` (object, required) — A public P-256 JWK. The object accepts exactly `kty`, `crv`, `x`, and `y`. Private key material such as `d`, embedded key IDs, and all other members are rejected. The server also rejects coordinates that are not a point on P-256.
        - `kty` ("EC", required)
        - `crv` ("P-256", required)
        - `x` (string, required) — A 32-byte P-256 coordinate encoded as unpadded base64url.
        - `y` (string, required) — A 32-byte P-256 coordinate encoded as unpadded base64url.
      - `fingerprint` (string, required) — RFC 7638 SHA-256 JWK thumbprint encoded as unpadded base64url.
    - `pod_id` (string, optional) — Pod ID the api key is scoped to. If set, the key can only access resources within this pod.
    - `inbox_id` (string, optional) — Inbox ID the api key is scoped to. If set, the key can only access resources within this inbox.
    - `status` (enum, optional) — Lifecycle of a sign-in key: `pending` until the client finishes creating it on the AgentID page, `active` once it can sign in as the inbox. Absent on a registered key.
      - Allowed values: `pending`, `active`
    - `used_at` (datetime, optional) — Time at which api key was last used.
    - `expires_at` (datetime, optional) — Time at which api key expires. Omitted when it does not expire.
- `next_page_token` (string, optional) — Page token for pagination.

## Errors

### 404 Not Found Error

- `name` (string, required) — Name of error.
- `message` (string, required) — Error message.
- `code` (string, optional) — Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.
- `fix` (string, optional) — The concrete next action that resolves the error.
- `docs` (string, optional) — Link to the error reference entry for this code.

## Examples

**Response**

```json
{
  "count": 1,
  "api_keys": [
    {
      "type": "bearer",
      "api_key_id": "api_key_id",
      "prefix": "prefix",
      "name": "name",
      "pod_id": "pod_id",
      "inbox_id": "inbox_id",
      "used_at": "2024-01-15T09:30:00Z",
      "permissions": {
        "inbox_read": true,
        "inbox_create": true,
        "inbox_update": true,
        "inbox_delete": true,
        "message_read": true,
        "message_send": true,
        "message_update": true,
        "message_delete": true,
        "label_spam_read": true,
        "label_blocked_read": true,
        "label_unauthenticated_read": true,
        "label_trash_read": true,
        "draft_read": true,
        "draft_create": true,
        "draft_update": true,
        "draft_delete": true,
        "draft_send": true,
        "webhook_read": true,
        "webhook_create": true,
        "webhook_update": true,
        "webhook_delete": true,
        "domain_read": true,
        "domain_create": true,
        "domain_update": true,
        "domain_delete": true,
        "list_entry_read": true,
        "list_entry_create": true,
        "list_entry_delete": true,
        "metrics_read": true,
        "api_key_read": true,
        "api_key_create": true,
        "api_key_update": true,
        "api_key_delete": true,
        "provider_connect": true,
        "provider_share_owner": true,
        "account_update": true,
        "pod_read": true,
        "pod_create": true,
        "pod_delete": true
      },
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "expires_at": "2024-01-15T09:30:00Z"
    },
    {
      "type": "bearer",
      "api_key_id": "api_key_id",
      "prefix": "prefix",
      "name": "name",
      "pod_id": "pod_id",
      "inbox_id": "inbox_id",
      "used_at": "2024-01-15T09:30:00Z",
      "permissions": {
        "inbox_read": true,
        "inbox_create": true,
        "inbox_update": true,
        "inbox_delete": true,
        "message_read": true,
        "message_send": true,
        "message_update": true,
        "message_delete": true,
        "label_spam_read": true,
        "label_blocked_read": true,
        "label_unauthenticated_read": true,
        "label_trash_read": true,
        "draft_read": true,
        "draft_create": true,
        "draft_update": true,
        "draft_delete": true,
        "draft_send": true,
        "webhook_read": true,
        "webhook_create": true,
        "webhook_update": true,
        "webhook_delete": true,
        "domain_read": true,
        "domain_create": true,
        "domain_update": true,
        "domain_delete": true,
        "list_entry_read": true,
        "list_entry_create": true,
        "list_entry_delete": true,
        "metrics_read": true,
        "api_key_read": true,
        "api_key_create": true,
        "api_key_update": true,
        "api_key_delete": true,
        "provider_connect": true,
        "provider_share_owner": true,
        "account_update": true,
        "pod_read": true,
        "pod_create": true,
        "pod_delete": true
      },
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "expires_at": "2024-01-15T09:30:00Z"
    }
  ],
  "next_page_token": "next_page_token"
}
```

**SDK Code**

```python
import requests

url = "https://api.agentmail.to/v0/pods/pod_id/api-keys"

headers = {"Authorization": "Bearer <api_key>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.agentmail.to/v0/pods/pod_id/api-keys';
const options = {method: 'GET', headers: {Authorization: 'Bearer <api_key>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.agentmail.to/v0/pods/pod_id/api-keys"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <api_key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.agentmail.to/v0/pods/pod_id/api-keys")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <api_key>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/pods/pod_id/api-keys")
  .header("Authorization", "Bearer <api_key>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.agentmail.to/v0/pods/pod_id/api-keys', [
  'headers' => [
    'Authorization' => 'Bearer <api_key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.agentmail.to/v0/pods/pod_id/api-keys");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <api_key>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <api_key>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/pods/pod_id/api-keys")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```