Portabase Logo
Portabase DashboardAPIDatabases

Create or update the retention policy of a database

The database must have its own backup schedule.

PUT
/databases/{id}/retention-policy

The database must have its own backup schedule.

Authorization

apiKeyAuth
headerx-api-key<token>

API key generated from the Portabase dashboard. Pass as the x-api-key header.

Path Parameters

id*string
Formatuuid

Request Body

application/json
  1. body
type?string
Value in"count""days""gfs"
count*number
Range1 <= value <= 100
days*number
Range1 <= value <= 3650
gfs*

Response Body

Retention policy

application/json
  1. response
data*|null
Example Request
curl -X PUT 'https://portabase.example.com/api/v1/databases/123e4567-e89b-12d3-a456-426614174000/retention-policy' \  -H 'Content-Type: application/json' \  -d '{  "count": 1,  "days": 1,  "gfs": {    "hourly": 0,    "daily": 1,    "weekly": 0,    "monthly": 0,    "yearly": 0  }}'
Example Response
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "databaseId": "d0f4f849-8ecf-4909-96bf-7953790e45f9",    "projectId": "5a8591dd-4039-49df-9202-96385ba3eff8",    "type": "count",    "count": -2147483648,    "days": -2147483648,    "gfsHourly": -2147483648,    "gfsDaily": -2147483648,    "gfsWeekly": -2147483648,    "gfsMonthly": -2147483648,    "gfsYearly": -2147483648,    "updatedAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z",    "deletedAt": "2019-08-24T14:15:22Z"  }}