For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
CommunityCreate AccountSign in
  • Overview
    • Welcome
    • Authentication
    • Using Environments
  • API Reference
      • GETList data retention policies
      • POSTCreate a data retention policy
      • GETGet a data retention policy
      • PATCHUpdate a data retention policy
      • DELDelete a data retention policy
LogoLogo
LogoLogo
CommunityCreate AccountSign in
API ReferenceData Retention Policies

Create a data retention policy

POST
https://api.x.flatfile.com/v1/data-retention-policies
POST
/v1/data-retention-policies
$curl -X POST https://api.x.flatfile.com/v1/data-retention-policies \
> -H "X-Disable-Hooks: true" \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{
> "type": "lastActivity",
> "period": 5,
> "environmentId": "us_env_YOUR_ID"
>}'
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}
Add a new data retention policy to the space
Was this page helpful?
Previous

Get a data retention policy

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

X-Disable-Hooks"true"Required

Request

This endpoint expects an object.
typeenumRequired
The type of data retention policy on an environment
Allowed values:
periodintegerRequired
environmentIdstringRequired
Environment ID

Response

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

Errors

400
Bad Request Error
404
Not Found Error