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

# report_templates

> sift/report_templates/v1/report_templates.proto

<a name="sift_report_templates_v1_report_templates-proto" />

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

## Services

*RPC methods exposed by this API.*

### ReportTemplateService

| Method               | Request                                                     | Response                                                      | Description                                                                              |
| :------------------- | :---------------------------------------------------------- | :------------------------------------------------------------ | :--------------------------------------------------------------------------------------- |
| GetReportTemplate    | [GetReportTemplateRequest](#getreporttemplaterequest)       | [GetReportTemplateResponse](#getreporttemplateresponse)       | Retrieve a report template.                                                              |
| CreateReportTemplate | [CreateReportTemplateRequest](#createreporttemplaterequest) | [CreateReportTemplateResponse](#createreporttemplateresponse) | Create a report template.                                                                |
| ListReportTemplates  | [ListReportTemplatesRequest](#listreporttemplatesrequest)   | [ListReportTemplatesResponse](#listreporttemplatesresponse)   | List report templates.                                                                   |
| UpdateReportTemplate | [UpdateReportTemplateRequest](#updatereporttemplaterequest) | [UpdateReportTemplateResponse](#updatereporttemplateresponse) | Updates an existing report template using the list of fields specified in `update_mask`. |

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

## Messages

*Data models used across requests/responses.*

### CreateReportTemplateRequest

The request of a call to `ReportTemplateService_CreateReportTemplate` to create a report template.

| Field                                       | Type                                                                            | Label    | Description                                                                       |
| :------------------------------------------ | :------------------------------------------------------------------------------ | :------- | :-------------------------------------------------------------------------------- |
| name                                        | string                                                                          |          |                                                                                   |
| client\_key                                 | string                                                                          | optional |                                                                                   |
| description                                 | string                                                                          | optional |                                                                                   |
| tag\_names                                  | string                                                                          | repeated |                                                                                   |
| organization\_id                            | string                                                                          |          | `organization_id` is only required if your user belongs to multiple organizations |
| oneof rule\_identifiers. rule\_ids          | [CreateReportTemplateRequestRuleIds](#createreporttemplaterequestruleids)       |          |                                                                                   |
| oneof rule\_identifiers. rule\_client\_keys | [CreateReportTemplateRequestClientKeys](#createreporttemplaterequestclientkeys) |          |                                                                                   |
| metadata                                    | [sift.metadata.v1.MetadataValue](#sift-metadata-v1-metadatavalue)               | repeated |                                                                                   |

### CreateReportTemplateRequestClientKeys

Initial template rule order follows server resolution of keys to rules (not client-defined per-key ordering).

| Field              | Type   | Label    | Description |
| :----------------- | :----- | :------- | :---------- |
| rule\_client\_keys | string | repeated |             |

### CreateReportTemplateRequestRuleIds

Initial rule order on the new template: first `rule_id` is `display_order` 0, second is 1, etc.

| Field     | Type   | Label    | Description |
| :-------- | :----- | :------- | :---------- |
| rule\_ids | string | repeated |             |

### CreateReportTemplateResponse

The response of a call to `ReportTemplateService_CreateReportTemplate` to create a report template.

| Field            | Type                              | Label | Description |
| :--------------- | :-------------------------------- | :---- | :---------- |
| report\_template | [ReportTemplate](#reporttemplate) |       |             |

### GetReportTemplateRequest

The request for a call to `ReportTemplateService_GetReportTemplate` to retrieve a report template.
If `report_template_id` is provided then all other arguments will be ignored. The argument `report_template_id`
should not be used together with `client_key`. The `organization_id` argument is only required
if using `client_key` and the user belongs to multiple organizations.

| Field                | Type   | Label | Description |
| :------------------- | :----- | :---- | :---------- |
| report\_template\_id | string |       |             |
| client\_key          | string |       |             |
| organization\_id     | string |       |             |

### GetReportTemplateResponse

The request of a call to `ReportTemplateService_GetReportTemplate` to retrieve a report template.

| Field            | Type                              | Label | Description |
| :--------------- | :-------------------------------- | :---- | :---------- |
| report\_template | [ReportTemplate](#reporttemplate) |       |             |

### ListReportTemplatesRequest

The request for a call to `ReportTemplateService_ListReportTemplates` to retrieve report templates.

| Field             | Type   | Label | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| :---------------- | :----- | :---- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| page\_size        | uint32 |       | The maximum number of report templates to return. The service may return fewer than this value. If unspecified, at most 50 report templates 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 `ListReportTemplates` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListReportTemplates` 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 `report_template_id`, `tag_id`, `tag_name`, `client_key`, `metadata`, `name` 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](/docs/api/grpc/protocol-buffers/report_templates#report_template). Optional. |
| organization\_id  | string |       | This field is only required if your user belongs to multiple organizations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| include\_archived | bool   |       | **Deprecated.** Deprecated. Use `filter` instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| order\_by         | string |       | How to order the retrieved report templates. Formatted as a comma-separated string i.e. "FIELD\_NAME\[ desc],...". Available fields to order\_by are `created_date` and `modified_date`. If left empty, items are ordered by `created_date` in descending order (newest-first). For more information about the format of this field, read [this](https://google.aip.dev/132#ordering) Example: "created\_date desc,modified\_date"                                                                                                                                   |

### ListReportTemplatesResponse

The response of a call to `ReportTemplateService_ListReportTemplatesResponse`.

| Field             | Type                              | Label    | Description |
| :---------------- | :-------------------------------- | :------- | :---------- |
| report\_templates | [ReportTemplate](#reporttemplate) | repeated |             |
| next\_page\_token | string                            |          |             |

### ReportTemplate

| Field                  | Type                                                              | Label    | Description                                                                                                                                                                                                                                            |
| :--------------------- | :---------------------------------------------------------------- | :------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| report\_template\_id   | string                                                            |          |                                                                                                                                                                                                                                                        |
| organization\_id       | string                                                            |          |                                                                                                                                                                                                                                                        |
| client\_key            | string                                                            | optional |                                                                                                                                                                                                                                                        |
| name                   | string                                                            |          |                                                                                                                                                                                                                                                        |
| description            | string                                                            | optional |                                                                                                                                                                                                                                                        |
| archived\_date         | google.protobuf.Timestamp                                         | optional |                                                                                                                                                                                                                                                        |
| created\_by\_user\_id  | string                                                            |          |                                                                                                                                                                                                                                                        |
| modified\_by\_user\_id | string                                                            |          |                                                                                                                                                                                                                                                        |
| created\_date          | google.protobuf.Timestamp                                         |          |                                                                                                                                                                                                                                                        |
| modified\_date         | google.protobuf.Timestamp                                         |          |                                                                                                                                                                                                                                                        |
| rules                  | [ReportTemplateRule](#reporttemplaterule)                         | repeated | Rules on this template. On responses, sort by each rule's `display_order` ascending for execution order. On writes, if `display_order` is omitted on a rule, that rule's position follows the slice order of `rules` (same as explicit orders 0..n-1). |
| tags                   | [ReportTemplateTag](#reporttemplatetag)                           | repeated |                                                                                                                                                                                                                                                        |
| metadata               | [sift.metadata.v1.MetadataValue](#sift-metadata-v1-metadatavalue) | repeated |                                                                                                                                                                                                                                                        |
| is\_archived           | bool                                                              |          | Whether the report template is archived. This is inferred from whether archived\_date is set.                                                                                                                                                          |

### ReportTemplateRule

| Field                 | Type   | Label    | Description                                                                                                                                                                                                            |
| :-------------------- | :----- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| rule\_id              | string |          |                                                                                                                                                                                                                        |
| rule\_version\_id     | string |          |                                                                                                                                                                                                                        |
| rule\_version\_number | uint32 |          |                                                                                                                                                                                                                        |
| client\_key           | string |          |                                                                                                                                                                                                                        |
| display\_order        | uint32 | optional | Zero-based order for this rule on the template. Copied to `ReportRuleSummary.display_order` when creating a report from the template. Lower values indicate earlier position in the template and on generated reports. |

Optional on writes (e.g. `UpdateReportTemplate`): if omitted, servers use the order of entries in `ReportTemplate.rules` (first entry is earliest). On reads, this field is always populated. |

### ReportTemplateTag

| Field     | Type   | Label | Description |
| :-------- | :----- | :---- | :---------- |
| tag\_name | string |       |             |

### UpdateReportTemplateRequest

The request for a call to `ReportTemplateService_UpdateReportTemplate` to update a report template. When updating
tags or rules, the update will perform a full replace. Additionally, when updating rules, only the rule ID or the rule client key
is required, but it is okay to provide both. If some rules contain only client keys and others only rule IDs, they will be consolidated.

| Field            | Type                                                    | Label | Description                                                                                                                                                      |
| :--------------- | :------------------------------------------------------ | :---- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| report\_template | [ReportTemplate](#reporttemplate)                       |       | The report template to update.                                                                                                                                   |
| update\_mask     | [google.protobuf.FieldMask](#google-protobuf-fieldmask) |       | The list of fields to be updated. The fields available to be updated are `name`, `archived_date`, `is_archived`, `description`, `tags`, `rules`, and `metadata`. |

### UpdateReportTemplateResponse

The response of a call to `ReportTemplateService_UpdateReportTemplate`.

| Field            | Type                              | Label | Description |
| :--------------- | :-------------------------------- | :---- | :---------- |
| report\_template | [ReportTemplate](#reporttemplate) |       |             |

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

## Enums

*Allowed constant values used in message fields.*
