> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.divert.ly/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.divert.ly/_mcp/server.

# List API keys

GET https://api-dev.divert.ly/v1/organizations/{org_id}/apikeys

Key metadata only; secrets are never returned.

Reference: https://docs.divert.ly/api-reference/divertly-api/api-keys/list-api-keys

## Authentication

- `Authorization` header (required) — API key credential, sent as `Key <base64(keyId:secret)>`.

## Servers

- `https://api-dev.divert.ly` (Development, default)
- `https://api.divert.ly` (Production)

## Request

### Path parameters

- `org_id` (string, required)

## Response

### 200

OK

- `body` (list of APIKey, optional)

## Errors

### 400 Bad Request Error

Bad Request - malformed or failed validation

- `error` (string, optional, nullable)
- `meta` (ErrorResponseMeta, optional, nullable)

### 401 Unauthorized Error

Unauthorized - missing, malformed or rejected credentials

- `error` (string, optional, nullable)
- `meta` (ErrorResponseMeta, optional, nullable)

### 403 Forbidden Error

Forbidden - the principal is not permitted to make this request

- `error` (string, optional, nullable)
- `meta` (ErrorResponseMeta, optional, nullable)

### 404 Not Found Error

Not Found - no such resource

- `error` (string, optional, nullable)
- `meta` (ErrorResponseMeta, optional, nullable)

### 429 Too Many Requests Error

Too Many Requests - per-principal rate limit exceeded

- `error` (string, optional, nullable)
- `meta` (ErrorResponseMeta, optional, nullable)

### 500 Internal Server Error

Internal Server Error

- `error` (string, optional, nullable)
- `meta` (ErrorResponseMeta, optional, nullable)

## Types

### APIKey

- `createdAt` (datetime, optional)
- `description` (string, optional)
- `expiryDate` (datetime, optional, nullable)
- `fingerprint` (string, optional)
- `id` (string, optional)
- `keyId` (string, optional)
- `organizationId` (string, optional)
- `roleName` (string, optional)
- `updatedAt` (datetime, optional)

### ErrorResponseMeta

- `errorCode` (enum, optional)
  - Allowed values: `E1000`, `E1001`, `E1002`, `E1003`, `E1010`, `E1020`, `E1030`, `E1035`, `E1036`, `E1040`, `E1060`, `E1070`, `E1080`, `E1082`, `E1083`, `E1090`, `E1100`, `E1110`, `E1120`, `E1130`, `E1140`, `E1150`, `E1160`, `E1170`, `E1171`, `E1180`, `E1190`, `E1200`, `E1210`, `E1220`, `E1230`, `E1231`, `E1240`, `E1250`, `E1260`, `E1270`, `E1280`, `E1290`, `E1300`, `E1310`, `E1320`, `E1325`, `E1330`, `E1335`, `E1340`, `E1350`, `E1360`, `E1365`, `E1370`, `E1380`, `E1390`, `E1395`, `E1400`, `E1410`, `E1420`, `E1430`, `E1440`, `E1450`, `E1460`, `E1470`, `E1480`, `E1490`, `E1500`, `E1510`, `E1520`, `E1530`, `E1540`, `E1550`, `E1560`, `E1570`, `E1571`, `E1580`, `E1590`, `E1600`, `E1610`, `E1620`, `E1630`, `E1636`, `E1640`, `E1650`, `E1660`, `E1670`, `E1680`, `E1690`, `E1700`, `E1710`, `E1720`, `E1730`, `E1740`, `E1750`, `E1800`, `E1801`, `E1802`, `E1810`, `E1820`, `E1830`, `E1850`, `E1900`, `E1950`, `E2000`, `E2100`, `E2110`, `E2120`, `E2130`, `E2140`, `E2150`, `E2160`, `E2170`, `E2180`, `E3190`, `E3200`, `E3210`, `E3220`, `E3230`, `E3240`, `E3250`, `E3300`, `E3310`, `E3400`, `E3410`, `E3420`, `E3430`, `E3440`, `E3450`, `E3460`, `E3470`, `E3480`, `E3490`, `E3510`, `E3520`, `E3530`, `E3540`, `E3550`, `E3560`, `E3570`, `E3580`

## Examples

**Response**

```json
{
  "body": [
    {
      "createdAt": "2024-01-15T09:30:00Z",
      "description": "string",
      "expiryDate": "2024-01-15T09:30:00Z",
      "fingerprint": "string",
      "id": "string",
      "keyId": "string",
      "organizationId": "string",
      "roleName": "string",
      "updatedAt": "2024-01-15T09:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api-dev.divert.ly/v1/organizations/org_id/apikeys"

headers = {"Authorization": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://api-dev.divert.ly/v1/organizations/org_id/apikeys';
const options = {method: 'GET', headers: {Authorization: '<apiKey>'}};

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-dev.divert.ly/v1/organizations/org_id/apikeys"

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

	req.Header.Add("Authorization", "<apiKey>")

	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-dev.divert.ly/v1/organizations/org_id/apikeys")

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

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

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-dev.divert.ly/v1/organizations/org_id/apikeys")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-dev.divert.ly/v1/organizations/org_id/apikeys', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-dev.divert.ly/v1/organizations/org_id/apikeys");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-dev.divert.ly/v1/organizations/org_id/apikeys")! 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()
```