# ApiKeyService

> The ApiKeyService methods and their request and response messages.

Source: https://engramsfactory.com/docs/api/api-key/

Generated from [`api_key.proto`](https://github.com/cortexapps/engrams/blob/main/crates/engram-protocol/proto/engram/app/v1/api_key.proto). Every method is
`POST /rpc/engram.app.v1.ApiKeyService/<Method>` with a JSON or protobuf body and an
`x-api-key` header.

## Methods

| Method | Request | Response |
|---|---|---|
| `CreateApiKey` | [`CreateApiKeyRequest`](#createapikeyrequest) | [`CreateApiKeyResponse`](#createapikeyresponse) |
| `ListApiKeys` | [`ListApiKeysRequest`](#listapikeysrequest) | [`ListApiKeysResponse`](#listapikeysresponse) |
| `RevokeApiKey` | [`RevokeApiKeyRequest`](#revokeapikeyrequest) | [`RevokeApiKeyResponse`](#revokeapikeyresponse) |
| `CreateCliKey` | [`CreateCliKeyRequest`](#createclikeyrequest) | [`CreateCliKeyResponse`](#createclikeyresponse) |
| `RevokeCliKey` | [`RevokeCliKeyRequest`](#revokeclikeyrequest) | [`RevokeCliKeyResponse`](#revokeclikeyresponse) |
| `WhoAmI` | [`WhoAmIRequest`](#whoamirequest) | [`WhoAmIResponse`](#whoamiresponse) |

## Messages

### ApiKeyMeta

| Field | Type |
|---|---|
| `id` | `string` |
| `name` | `string` |
| `role` | `string` |
| `start` | `string` |
| `created_at` | `string` |
| `expires_at` | `string` |
| `last_used_at` | `string` |
| `owner_email` | `string` |

### CreateApiKeyRequest

| Field | Type |
|---|---|
| `name` | `string` |
| `role` | `string` |
| `expires_at` | `string` |

### CreateApiKeyResponse

| Field | Type |
|---|---|
| `meta` | [`ApiKeyMeta`](#apikeymeta) |
| `key` | `string` |

### CreateCliKeyRequest

| Field | Type |
|---|---|
| `name` | `string` |

### CreateCliKeyResponse

| Field | Type |
|---|---|
| `meta` | [`ApiKeyMeta`](#apikeymeta) |
| `key` | `string` |

### ListApiKeysRequest

No fields.

### ListApiKeysResponse

| Field | Type |
|---|---|
| `keys` | repeated [`ApiKeyMeta`](#apikeymeta) |

### RevokeApiKeyRequest

| Field | Type |
|---|---|
| `id` | `string` |

### RevokeApiKeyResponse

| Field | Type |
|---|---|
| `revoked` | `bool` |

### RevokeCliKeyRequest

| Field | Type |
|---|---|
| `id` | `string` |

### RevokeCliKeyResponse

| Field | Type |
|---|---|
| `revoked` | `bool` |

### WhoAmIRequest

No fields.

### WhoAmIResponse

| Field | Type |
|---|---|
| `user_id` | `string` |
| `email` | `string` |
| `name` | `string` |
| `role` | `string` |
| `service_account` | `bool` |
