> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# api_keys

> sift/api_keys/v2/api_keys.proto

<a name="sift_api_keys_v2_api_keys-proto" />

<a name="sift_api_keys_v2_api_keys-proto-services" />

## Services

*RPC methods exposed by this API.*

### ApiKeyService

| Method             | Request                                                 | Response                                                  | Description |
| :----------------- | :------------------------------------------------------ | :-------------------------------------------------------- | :---------- |
| ListApiKeys        | [ListApiKeysRequest](#listapikeysrequest)               | [ListApiKeysResponse](#listapikeysresponse)               |             |
| CreateApiKey       | [CreateApiKeyRequest](#createapikeyrequest)             | [CreateApiKeyResponse](#createapikeyresponse)             |             |
| DeleteApiKey       | [DeleteApiKeyRequest](#deleteapikeyrequest)             | [DeleteApiKeyResponse](#deleteapikeyresponse)             |             |
| ApiKeyOrganization | [ApiKeyOrganizationRequest](#apikeyorganizationrequest) | [ApiKeyOrganizationResponse](#apikeyorganizationresponse) |             |

<a name="sift_api_keys_v2_api_keys-proto-messages" />

## Messages

*Data models used across requests/responses.*

### ApiKey

| Field                 | Type                      | Label | Description |
| :-------------------- | :------------------------ | :---- | :---------- |
| api\_key\_id          | string                    |       |             |
| name                  | string                    |       |             |
| created\_date         | google.protobuf.Timestamp |       |             |
| created\_by\_user\_id | string                    |       |             |
| user\_id              | string                    |       |             |

### ApiKeyOrganizationRequest

*This message has no fields.*

### ApiKeyOrganizationResponse

| Field        | Type                                                                  | Label | Description |
| :----------- | :-------------------------------------------------------------------- | :---- | :---------- |
| organization | [sift.common.type.v1.Organization](#sift-common-type-v1-organization) |       |             |

### CreateApiKeyRequest

The request for a call to ApiKeyService.CreateApiKey.

| Field    | Type   | Label | Description                                                                                                                                                                                                                                                                                                                                                     |
| :------- | :----- | :---- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name     | string |       | The name for the new ApiKey. Required.                                                                                                                                                                                                                                                                                                                          |
| user\_id | string |       | The id of the user the new key will authenticate as. Must equal the id of the calling user; creating an API key on behalf of another user is no longer supported and the service will return INVALID\_ARGUMENT if the values differ. The field is retained for backwards compatibility with existing clients and may be marked deprecated in a future revision. |

### CreateApiKeyResponse

| Field    | Type                            | Label | Description |
| :------- | :------------------------------ | :---- | :---------- |
| api\_key | [CreatedApiKey](#createdapikey) |       |             |

### CreatedApiKey

CreatedApiKey includes the key, which will only be returned on creation, so having a separate type makes the "never return the key a second time" semantics clear

| Field                 | Type                      | Label | Description |
| :-------------------- | :------------------------ | :---- | :---------- |
| api\_key\_id          | string                    |       |             |
| name                  | string                    |       |             |
| key                   | string                    |       |             |
| created\_date         | google.protobuf.Timestamp |       |             |
| created\_by\_user\_id | string                    |       |             |
| user\_id              | string                    |       |             |

### DeleteApiKeyRequest

The request for a call to ApiKeyService.DeleteApiKey.

| Field        | Type   | Label | Description |
| :----------- | :----- | :---- | :---------- |
| api\_key\_id | string |       |             |

### DeleteApiKeyResponse

*This message has no fields.*

### ListApiKeysRequest

The request for a call to ApiKeyService.ListApiKeys.

| Field       | Type   | Label | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| :---------- | :----- | :---- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page\_size  | uint32 |       | The maximum number of api keys to return. The service may return fewer than this value. The maximum value is 1000; values above 1000 will be coerced to 1000.                                                                                                                                                                                                                                                                                                                                                  |
| page\_token | string |       | A page token, received from a previous `ListApiKeys` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListApiKeys` must match the call that provided the page token.                                                                                                                                                                                                                                                                                     |
| filter      | string |       | A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. Available fields to filter by are `api_key_id`, `user_id`, `created_by_user_id`, and `name`. For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions). For more information about the fields used for filtering, please refer to [this definition](/docs/api/grpc/protocol-buffers/channels#channel). Optional. |
| order\_by   | string |       | How to order the retrieved channels. Formatted as a comma-separated string i.e. "FIELD\_NAME\[ desc],...". Available fields to order\_by are `name` and `created_date`. If left empty, items are ordered by `created_date` in ascending order (oldest-first). For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) Example: "name desc,created\_date"                                                                                                         |

### ListApiKeysResponse

The result of a call to ApiKeyService.ListApiKeys.

| Field             | Type              | Label    | Description |
| :---------------- | :---------------- | :------- | :---------- |
| api\_keys         | [ApiKey](#apikey) | repeated |             |
| next\_page\_token | string            |          |             |

<a name="sift_api_keys_v2_api_keys-proto-enums" />

## Enums

*Allowed constant values used in message fields.*
