> ## 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.

# metadata

> sift/metadata/v1/metadata.proto

<a name="sift_metadata_v1_metadata-proto" />

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

## Services

*RPC methods exposed by this API.*

### MetadataService

| Method                  | Request                                                           | Response                                                            | Description                |
| :---------------------- | :---------------------------------------------------------------- | :------------------------------------------------------------------ | :------------------------- |
| CreateMetadataKey       | [CreateMetadataKeyRequest](#createmetadatakeyrequest)             | [CreateMetadataKeyResponse](#createmetadatakeyresponse)             | Create a metadata key.     |
| CreateMetadataValue     | [CreateMetadataValueRequest](#createmetadatavaluerequest)         | [CreateMetadataValueResponse](#createmetadatavalueresponse)         | Create a metadata value.   |
| ListMetadataKeys        | [ListMetadataKeysRequest](#listmetadatakeysrequest)               | [ListMetadataKeysResponse](#listmetadatakeysresponse)               | List metadata keys.        |
| ListMetadataValues      | [ListMetadataValuesRequest](#listmetadatavaluesrequest)           | [ListMetadataValuesResponse](#listmetadatavaluesresponse)           | List metadata values.      |
| ArchiveMetadataKeys     | [ArchiveMetadataKeysRequest](#archivemetadatakeysrequest)         | [ArchiveMetadataKeysResponse](#archivemetadatakeysresponse)         | Archive metadata keys.     |
| ArchiveMetadataValues   | [ArchiveMetadataValuesRequest](#archivemetadatavaluesrequest)     | [ArchiveMetadataValuesResponse](#archivemetadatavaluesresponse)     | Archive metadata values.   |
| UnarchiveMetadataKeys   | [UnarchiveMetadataKeysRequest](#unarchivemetadatakeysrequest)     | [UnarchiveMetadataKeysResponse](#unarchivemetadatakeysresponse)     | Unarchive metadata keys.   |
| UnarchiveMetadataValues | [UnarchiveMetadataValuesRequest](#unarchivemetadatavaluesrequest) | [UnarchiveMetadataValuesResponse](#unarchivemetadatavaluesresponse) | Unarchive metadata values. |
| DeleteMetadataKeys      | [DeleteMetadataKeysRequest](#deletemetadatakeysrequest)           | [DeleteMetadataKeysResponse](#deletemetadatakeysresponse)           | Delete metadata keys.      |
| DeleteMetadataValues    | [DeleteMetadataValuesRequest](#deletemetadatavaluesrequest)       | [DeleteMetadataValuesResponse](#deletemetadatavaluesresponse)       | Delete metadata values.    |
| ListMetadataUsage       | [ListMetadataUsageRequest](#listmetadatausagerequest)             | [ListMetadataUsageResponse](#listmetadatausageresponse)             | List metadata key usage.   |

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

## Messages

*Data models used across requests/responses.*

### ArchiveMetadataKeysRequest

| Field          | Type                        | Label    | Description |
| :------------- | :-------------------------- | :------- | :---------- |
| metadata\_keys | [MetadataKey](#metadatakey) | repeated |             |

### ArchiveMetadataKeysResponse

*This message has no fields.*

### ArchiveMetadataValuesRequest

| Field            | Type                            | Label    | Description |
| :--------------- | :------------------------------ | :------- | :---------- |
| metadata\_values | [MetadataValue](#metadatavalue) | repeated |             |

### ArchiveMetadataValuesResponse

*This message has no fields.*

### CreateMetadataKeyRequest

The request of a call to `MetadataService_CreateMetadataKey` to create a metadata key.

| Field         | Type                        | Label | Description |
| :------------ | :-------------------------- | :---- | :---------- |
| metadata\_key | [MetadataKey](#metadatakey) |       |             |

### CreateMetadataKeyResponse

The response of a call to `MetadataService_CreateMetadataKey` to create a metadata key.

| Field         | Type                        | Label | Description |
| :------------ | :-------------------------- | :---- | :---------- |
| metadata\_key | [MetadataKey](#metadatakey) |       |             |

### CreateMetadataValueRequest

The request of a call to `MetadataService_CreateMetadataValue` to create a metadata value.

| Field           | Type                            | Label | Description |
| :-------------- | :------------------------------ | :---- | :---------- |
| metadata\_value | [MetadataValue](#metadatavalue) |       |             |

### CreateMetadataValueResponse

The response of a call to `MetadataService_CreateMetadataValue` to create a metadata value.

| Field           | Type                            | Label | Description |
| :-------------- | :------------------------------ | :---- | :---------- |
| metadata\_value | [MetadataValue](#metadatavalue) |       |             |

### DeleteMetadataKeysRequest

| Field          | Type                        | Label    | Description |
| :------------- | :-------------------------- | :------- | :---------- |
| metadata\_keys | [MetadataKey](#metadatakey) | repeated |             |

### DeleteMetadataKeysResponse

*This message has no fields.*

### DeleteMetadataValuesRequest

| Field            | Type                            | Label    | Description |
| :--------------- | :------------------------------ | :------- | :---------- |
| metadata\_values | [MetadataValue](#metadatavalue) | repeated |             |

### DeleteMetadataValuesResponse

*This message has no fields.*

### ListMetadataKeysRequest

The request for a call to `MetadataService_ListMetadataKeys` to retrieve metadata keys.

| Field       | Type   | Label | Description                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| :---------- | :----- | :---- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page\_size  | uint32 |       | The maximum number of metadata keys to return. The service may return fewer than this value. If unspecified, at most 50 metadata keys will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. Optional.                                                                                                                                                                                                      |
| page\_token | string |       | A page token, received from a previous `ListMetadataKeys` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMetadataKeys` must match the call that provided the page token. Optional.                                                                                                                                                                                               |
| filter      | string |       | A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. Available fields to filter by are: `name`, `archived_date`, and `is_archived`. 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. Optional. |
| order\_by   | string |       | How to order the retrieved metadata keys. Formatted as a comma-separated string i.e. "FIELD\_NAME\[ desc],...". Available fields to order\_by are `created_date` and `name`. 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: "created\_date desc,modified\_date"                        |

### ListMetadataKeysResponse

The response of a call to `MetadataService_ListMetadataKeysResponse`.

| Field             | Type                        | Label    | Description |
| :---------------- | :-------------------------- | :------- | :---------- |
| metadata\_keys    | [MetadataKey](#metadatakey) | repeated |             |
| next\_page\_token | string                      |          |             |

### ListMetadataUsageRequest

| Field       | Type   | Label | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| :---------- | :----- | :---- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page\_size  | uint32 |       | The maximum number of metadata key usages to return. The service may return fewer than this value. If unspecified, at most 50 metadata key usages will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. Optional.                                                                                                                                                                                                                                            |
| page\_token | string |       | A page token, received from a previous `ListMetadataUsage` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMetadataUsage` must match the call that provided the page token. Optional.                                                                                                                                                                                                                                               |
| filter      | string |       | A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. Available fields to filter by are: `entity_name`, `entity_type`, `key_name`,`value_string`, `value_number`, and `value_boolean`. 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. Optional. |
| order\_by   | string |       | How to order the retrieved metadata key usages. Formatted as a comma-separated string i.e. "FIELD\_NAME\[ desc],...". Available fields to order\_by are `created_date`, `entity_id` and `entity_type`. 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: "created\_date desc"                                                               |

### ListMetadataUsageResponse

| Field             | Type                            | Label    | Description |
| :---------------- | :------------------------------ | :------- | :---------- |
| metadata\_usages  | [MetadataUsage](#metadatausage) | repeated |             |
| next\_page\_token | string                          |          |             |

### ListMetadataValuesRequest

| Field               | Type   | Label | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| :------------------ | :----- | :---- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| page\_size          | uint32 |       | The maximum number of metadata values to return. The service may return fewer than this value. If unspecified, at most 50 metadata values will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. Optional.                                                                                                                                                                                                                                           |
| page\_token         | string |       | A page token, received from a previous `ListMetadataValues` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListMetadataValues` must match the call that provided the page token. Optional.                                                                                                                                                                                                                                    |
| filter              | string |       | A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string. Available fields to filter by are: `value_string`, `value_number`, `value_boolean`, `archived_date`, and `is_archived`. 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. Optional. |
| order\_by           | string |       | How to order the retrieved metadata keys. Formatted as a comma-separated string i.e. "FIELD\_NAME\[ desc],...". Available fields to order\_by are `created_date` and `name`. 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: "created\_date desc,modified\_date"                                                                 |
| metadata\_key\_name | string |       | The name of the metadata key to list values for.                                                                                                                                                                                                                                                                                                                                                                                                                                      |

### ListMetadataValuesResponse

| Field             | Type                            | Label    | Description |
| :---------------- | :------------------------------ | :------- | :---------- |
| metadata\_values  | [MetadataValue](#metadatavalue) | repeated |             |
| next\_page\_token | string                          |          |             |

### MetadataKey

| Field               | Type                                                              | Label | Description                                                                                                                                                                                          |
| :------------------ | :---------------------------------------------------------------- | :---- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name                | string                                                            |       |                                                                                                                                                                                                      |
| type                | [MetadataKeyType](#metadatakeytype)                               |       |                                                                                                                                                                                                      |
| archived\_date      | google.protobuf.Timestamp                                         |       |                                                                                                                                                                                                      |
| is\_archived        | bool                                                              |       | Whether the metadata key is archived. This is inferred from whether archived\_date is set.                                                                                                           |
| filter\_field\_type | [sift.common.v1.FilterFieldType](#sift-common-v1-filterfieldtype) |       | The filter field type this key maps to, so a client can build a CEL filter against it (`metadata["<name>"]`) and resolve its operators and functions from FilterGrammarService. Derived from `type`. |

### MetadataRelationValue

| Field          | Type   | Label | Description |
| :------------- | :----- | :---- | :---------- |
| resource\_type | string |       |             |
| resource\_id   | string |       |             |

### MetadataUsage

| Field        | Type                            | Label | Description                                                      |
| :----------- | :------------------------------ | :---- | :--------------------------------------------------------------- |
| entity\_id   | string                          |       | The ID of the entity. For example assetId, runId, reportId, etc. |
| entity\_type | string                          |       | The type of the entity. For example asset, run, report, etc.     |
| value        | [MetadataValue](#metadatavalue) |       | The value of the metadata key on this entity.                    |

### MetadataValue

| Field                        | Type                                            | Label | Description                                                                                  |
| :--------------------------- | :---------------------------------------------- | :---- | :------------------------------------------------------------------------------------------- |
| key                          | [MetadataKey](#metadatakey)                     |       |                                                                                              |
| oneof value. string\_value   | string                                          |       |                                                                                              |
| oneof value. number\_value   | double                                          |       |                                                                                              |
| oneof value. boolean\_value  | bool                                            |       |                                                                                              |
| oneof value. relation\_value | [MetadataRelationValue](#metadatarelationvalue) |       |                                                                                              |
| archived\_date               | google.protobuf.Timestamp                       |       |                                                                                              |
| is\_archived                 | bool                                            |       | Whether the metadata value is archived. This is inferred from whether archived\_date is set. |

### UnarchiveMetadataKeysRequest

| Field             | Type                        | Label    | Description |
| :---------------- | :-------------------------- | :------- | :---------- |
| metadata\_keys    | [MetadataKey](#metadatakey) | repeated |             |
| unarchive\_values | bool                        |          |             |

### UnarchiveMetadataKeysResponse

*This message has no fields.*

### UnarchiveMetadataValuesRequest

| Field            | Type                            | Label    | Description |
| :--------------- | :------------------------------ | :------- | :---------- |
| metadata\_values | [MetadataValue](#metadatavalue) | repeated |             |

### UnarchiveMetadataValuesResponse

*This message has no fields.*

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

## Enums

*Allowed constant values used in message fields.*

### MetadataKeyType

Metadata key type.

| Name                             | Number | Description                                                             |
| :------------------------------- | :----- | :---------------------------------------------------------------------- |
| METADATA\_KEY\_TYPE\_UNSPECIFIED | 0      |                                                                         |
| METADATA\_KEY\_TYPE\_STRING      | 1      | string                                                                  |
| METADATA\_KEY\_TYPE\_NUMBER      | 2      | number                                                                  |
| METADATA\_KEY\_TYPE\_BOOLEAN     | 3      | boolean                                                                 |
| METADATA\_KEY\_TYPE\_RELATION    | 4      | relation — references another resource by UUID (e.g. folder membership) |
