Data Retention Policies

Create a data retention policy

POST
Add a new data retention policy to the space

Request

This endpoint expects an object.
type
enumRequired
The type of data retention policy on an environment
Allowed values: lastActivitysinceCreated
period
integerRequired
environmentId
stringRequired
Environment ID

Response

This endpoint returns an object
data
object
A data retention policy belonging to an environment

Errors

POST
$curl -X POST https://api.x.flatfile.com/v1/data-retention-policies \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "type": "lastActivity",
> "period": 5,
> "environmentId": "us_env_YOUR_ID"
>}'
Response
1{
2 "data": {
3 "createdAt": "2023-11-15T19:31:33.015Z",
4 "environmentId": "us_env_YOUR_ID",
5 "id": "us_drp_YOUR_ID",
6 "period": 5,
7 "type": "lastActivity",
8 "updatedAt": "2023-11-15T19:31:33.015Z"
9 }
10}