# Get OAuth API keys

`GET /v1/environments/{environmentId}/apikeys`

Available as MCP tool `get-oauth-keys` (Read).

OAuth API key endpoints allow you to view and manage OAuth API keys for a given environment in your Redox organization. [Learn more about OAuth API keys](https://docs.redoxengine.com/permalink/3P1ee9KftdYEE9uuH9KRNs/#authentication-methods), which is our preferred authentication method.  

You can retrieve, create, update, or delete OAuth API keys.

### Get OAuth API keys

Retrieve a list of any OAuth API keys that have already been configured for the specified environment in your Redox organization.

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `environmentId` | path | string | Yes | Identifies the specific environment that you're operating in or on behalf of. |

## Request example

```bash
curl 'https://api.redoxengine.com/platform/v1/environments/{environmentId}/apikeys' \
--request GET \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json'
```

## Responses

### 200

Contains a payload object with a list of any OAuth API keys configured for the specified environment.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `meta` | object | No |  |
| `meta.version` | string | No | Lists the major and minor version number for the format of the returned payload. The payload format or shape may change between minor versions, like including additional or extended fields in later versions. We include the version data in each response so that you have the option to handle the signaled differences. |
| `payload` | object | No | Contains the payload with details about the requested OAuth API key(s). |
| `payload.apikeys` | Array of object | No | Contains an array of OAuth API Keys. |
| `payload.apikeys[].name` | string | No | Displays the human-readable name of the OAuth API key. |
| `payload.apikeys[].jwksURL` | string | No | Contains the JWKS URL for the OAuth API key. |
| `payload.apikeys[].jwkSet` | object | No | Contains a JSON Web Key Set (JWKS). [See the JWK Set Format spec](https://datatracker.ietf.org/doc/html/rfc7517#section-5) for more details. |
| `payload.apikeys[].jwkSet.keys` | Array of object | No | Contains an array of JWK objects. Each JWK must have a `kid` and `kty`, along with some other properties depending on the key type. [See the JWK spec](https://datatracker.ietf.org/doc/html/rfc7517) for more details. |
| `payload.apikeys[].jwkSet.keys[].kid` | string | Yes | Displays the JWK ID ("Key ID"). |
| `payload.apikeys[].jwkSet.keys[].kty` | string | Yes | Identifies the JWK type ("Key type"). |
| `payload.apikeys[].id` | string | No | Displays the unique identifier (i.e., client ID) of the OAuth API key. |
| `payload.apikeys[].environment` | object | No | Contains metadata about the environment within the associated Redox organization. |
| `payload.apikeys[].environment.id` | string (uuid) | No | Contains the unique identifier of the Redox environment. |
| `payload.apikeys[].environment.environmentFlag` | string | No | Indicates whether the environment is used for development, staging, or production. Possible values: Production, Staging, Development |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "apikeys": [
      {
        "name": "string",
        "jwksURL": "string",
        "jwkSet": {
          "keys": [
            {
              "kid": "string",
              "kty": "string"
            }
          ]
        },
        "id": "string",
        "environment": {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "environmentFlag": "Staging"
        }
      }
    ]
  }
}
```

### 400

Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.id` | string | No | Contains a unique identifier for the given error instance. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Bad Request`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Bad Request",
      "code": "validation.error.bad.request",
      "detail": "Error details",
      "status": 400,
      "transient": false
    }
  }
}
```

### 403

Forbidden

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.errors` | Array of object | No |  |
| `payload.errors[].title` | string | No | Displays the high-level error message, typically something succinct like `Forbidden`. |
| `payload.errors[].code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |

```json
{
  "payload": {
    "errors": [
      {
        "title": "Forbidden",
        "code": "authorization.forbidden"
      }
    ]
  }
}
```

### 500

Internal Server Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Failed in step X`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Internal Server Error",
      "code": "failed.db.lookup",
      "detail": "Error details",
      "status": 500,
      "transient": true
    }
  }
}
```
