---
title: "Update entity archival configuration"
method: PATCH
path: "/api/v1/entity-archival-config"
tags: ["Entity Archival"]
---

# Update entity archival configuration

`PATCH /api/v1/entity-archival-config`

## Request

- Base URL: `https://api.getcortexapp.com`
- URL: `https://api.getcortexapp.com/api/v1/entity-archival-config`
- Auth: HTTP bearer

Change the workspace's archival settings. Only the fields in the request change. Setting retentionDays requires automatic deletion to be enabled for the workspace. Requires the Edit Settings permission.

## Request body

- EntityArchivalConfigPatch
  - `defaultForNewEntityTypes` TypeArchivalConfigPatch: Settings to change per entity type, keyed by type. Types you leave out keep their settings.
    - `gitOpsAutoArchival` boolean
    - `integrationAutoArchival` boolean
    - `retentionDays` 30 | 60 | 90 | 180 | 365: Days an archived entity is kept before Cortex deletes it. Requires automatic deletion to be enabled for the workspace.
  - `entityTypes` object, required: Settings to change per entity type, keyed by type. Types you leave out keep their settings.
  - `monorepoAutoArchival` boolean: Leave out to keep the current value.

## Response `200`

The workspace's archival settings after the change

- EntityArchivalConfig
  - `defaultForNewEntityTypes` TypeArchivalConfig, required: Settings per entity type, keyed by type. Lists the built-in types and every type with a setting of its own.
    - `gitOpsAutoArchival` boolean, required: Archive entities when their entity YAML file is deleted from Git.
    - `integrationAutoArchival` boolean, required: Archive and unarchive entities based on their existence in the corresponding integrations.
    - `retentionDays` 30 | 60 | 90 | 180 | 365, nullable: Days an archived entity is kept before Cortex deletes it. Null when automatic deletion is not enabled for the workspace.
  - `entityTypes` object, required: Settings per entity type, keyed by type. Lists the built-in types and every type with a setting of its own.
  - `monorepoAutoArchival` boolean, required: Auto-archive and auto-unarchive entities that have a basepath (monorepo entities).

## Other responses

- `400`: An entity type is not one of the workspace's types, or retentionDays is not an allowed value
- `403`: Caller does not have the Edit Settings permission, or retentionDays was sent while automatic deletion is not enabled for the workspace
- `429`: The client has exceeded the rate limit by performing too many requests in a short period. Retry the request after a delay.

## Changes

- **2026-11-03** `a7b058663c95`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/cortex/apis/cortex-api/changes/api/v1/entity-archival-config/patch.md)

---

[API](https://skmtc.dev/cortex/apis/cortex-api.md) - [All operations](https://skmtc.dev/cortex/apis/cortex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cortex/apis/cortex-api/revisions/a7b058663c95?raw)
