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

# Retention policy assignments resources

A Retention Policy Assignment is a relation between a policy and folder or enterprise. Creating an assignment puts a retention on all the file versions that belong to that folder or enterprise.

## Files under retention

A list of files under retention.

<Accordion title="Attributes and example">
  | Property      | Type                                                         | Required | Description                                                                                                                                                                            |
  | ------------- | ------------------------------------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `limit`       | `integer`                                                    | No       | The limit that was used for these entries. This will be the same as the `limit` query parameter unless that value exceeded the maximum value allowed. The maximum value varies by API. |
  | `next_marker` | `string`                                                     | No       | The marker for the start of the next page of results. Can be `null`.                                                                                                                   |
  | `prev_marker` | `string`                                                     | No       | The marker for the start of the previous page of results. Can be `null`.                                                                                                               |
  | `entries`     | array of [File (Mini)](/reference/files-resources#file-mini) | No       | A list of files.                                                                                                                                                                       |

  ```json Example theme={null}
  {
    "limit": 1000,
    "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
    "prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih",
    "entries": [
      {
        "id": "12345",
        "etag": "1",
        "type": "file",
        "sequence_id": "3",
        "name": "Contract.pdf",
        "sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
        "file_version": {
          "id": "12345",
          "type": "file_version",
          "sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
        }
      }
    ]
  }
  ```
</Accordion>

## Retention policy assignment

A retention assignment represents a rule specifying the files a retention policy retains. Assignments can retain files based on their folder or metadata, or hold all files in the enterprise.

<Accordion title="Attributes and example">
  | Property           | Type                                                                                     | Required | Description                                                                                                                                                    |
  | ------------------ | ---------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `id`               | `string`                                                                                 | Yes      | The unique identifier for a retention policy assignment.                                                                                                       |
  | `type`             | `enum<string>`                                                                           | Yes      | The value will always be `retention_policy_assignment`. Available options: `retention_policy_assignment`.                                                      |
  | `retention_policy` | [Retention policy (Mini)](/reference/retention-policies-resources#retention-policy-mini) | No       | A mini representation of a retention policy object that has been assigned to the content.                                                                      |
  | `assigned_to`      | `object`                                                                                 | No       | The `type` and `id` of the content that is under retention. The `type` can either be `folder` `enterprise`, or `metadata_template`.                            |
  | `filter_fields`    | array of `object`                                                                        | No       | An array of field objects. Values are only returned if the `assigned_to` type is `metadata_template`. Otherwise, the array is blank. Can be `null`.            |
  | `assigned_by`      | [User (Mini)](/reference/users-resources#user-mini)                                      | No       | A mini user object representing the user that created the retention policy assignment.                                                                         |
  | `assigned_at`      | `string`                                                                                 | No       | When the retention policy assignment object was created.                                                                                                       |
  | `start_date_field` | `string`                                                                                 | No       | The date the retention policy assignment begins. If the `assigned_to` type is `metadata_template`, this field can be a date field's metadata attribute key id. |

  ```json Example theme={null}
  {
    "id": "11446498",
    "type": "retention_policy_assignment",
    "retention_policy": {
      "id": "12345",
      "type": "retention_policy",
      "policy_name": "Some Policy Name",
      "retention_length": "365",
      "disposition_action": "permanently_delete",
      "max_extension_length": "365"
    },
    "assigned_to": {
      "id": "a983f69f-e85f-4ph4-9f46-4afdf9c1af65",
      "type": "metadata_template"
    },
    "filter_fields": [
      {
        "field": "a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4",
        "value": "0c27b756-0p87-4fe0-a43a-59fb661ccc4e"
      }
    ],
    "assigned_by": {
      "id": "11446498",
      "type": "user",
      "name": "Aaron Levie",
      "login": "ceo@example.com"
    },
    "assigned_at": "2012-12-12T10:53:43-08:00",
    "start_date_field": "upload_date"
  }
  ```
</Accordion>

## Retention policy assignments

A list of retention policy assignments.

<Accordion title="Attributes and example">
  | Property      | Type                                                                 | Required | Description                                                                                                                                                                            |
  | ------------- | -------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `entries`     | array of [Retention policy assignment](#retention-policy-assignment) | No       | A list of retention policy assignments.                                                                                                                                                |
  | `limit`       | `integer`                                                            | No       | The limit that was used for these entries. This will be the same as the `limit` query parameter unless that value exceeded the maximum value allowed. The maximum value varies by API. |
  | `next_marker` | `string`                                                             | No       | The marker for the start of the next page of results. Can be `null`.                                                                                                                   |

  ```json Example theme={null}
  {
    "entries": [
      {
        "id": "11446498",
        "type": "retention_policy_assignment",
        "retention_policy": {
          "id": "12345",
          "type": "retention_policy",
          "policy_name": "Some Policy Name",
          "retention_length": "365",
          "disposition_action": "permanently_delete",
          "max_extension_length": "365"
        },
        "assigned_to": {
          "id": "a983f69f-e85f-4ph4-9f46-4afdf9c1af65",
          "type": "metadata_template"
        },
        "filter_fields": [
          {
            "field": "a0f4ee4e-1dc1-4h90-a8a9-aef55fc681d4",
            "value": "0c27b756-0p87-4fe0-a43a-59fb661ccc4e"
          }
        ],
        "assigned_by": {
          "id": "11446498",
          "type": "user",
          "name": "Aaron Levie",
          "login": "ceo@example.com"
        },
        "assigned_at": "2012-12-12T10:53:43-08:00",
        "start_date_field": "upload_date"
      }
    ],
    "limit": 1000,
    "next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii"
  }
  ```
</Accordion>
