# Backups

Everything about PostgreSQL backups.

## List cluster backups

> Retrieves a list of all PostgreSQL cluster backups.

```json
{"openapi":"3.0.3","info":{"title":"IONOS DBaaS PostgreSQL REST API","version":"1.0.0"},"tags":[{"name":"Backups","description":"Everything about PostgreSQL backups."}],"servers":[{"url":"https://api.ionos.com/databases/postgresql","description":"Production"}],"security":[{"basicAuth":[]},{"tokenAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"You will need to base64 encode the string containing your credentials.\nSeparate your username and password with a colon, i.e.,\nusername:password and send it as 'Authorization' request header. More\ndetails: https://en.wikipedia.org/wiki/Basic_access_authentication.\n"},"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Please provide header value as 'Bearer <token>' and don't forget to add\n'Bearer' HTTP Authorization Scheme before the token.\n"}},"parameters":{"PaginationLimit":{"name":"limit","in":"query","description":"The maximum number of elements to return. Use together with 'offset' for pagination.","required":false,"schema":{"type":"integer","default":100,"maximum":1000,"minimum":1}},"PaginationOffset":{"name":"offset","in":"query","description":"The first element to return. Use together with 'limit' for pagination.","required":false,"schema":{"type":"integer","default":0}}},"schemas":{"ClusterBackupList":{"description":"List of backups.","allOf":[{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ResourceType"},"id":{"$ref":"#/components/schemas/ResourceId"},"items":{"type":"array","items":{"$ref":"#/components/schemas/BackupResponse"}}}},{"$ref":"#/components/schemas/DeprecatedPagination"}]},"ResourceType":{"description":"The type of the resource.","type":"string","enum":["collection","cluster","backup","user","database"]},"ResourceId":{"type":"string","description":"The unique ID of the resource."},"BackupResponse":{"description":"A database backup.","properties":{"type":{"allOf":[{"$ref":"#/components/schemas/ResourceType"}]},"id":{"$ref":"#/components/schemas/ResourceId"},"metadata":{"$ref":"#/components/schemas/BackupMetadata"},"properties":{"$ref":"#/components/schemas/ClusterBackup"}},"type":"object"},"BackupMetadata":{"description":"Metadata of the backup resource.","properties":{"createdDate":{"type":"string","format":"date-time","description":"The ISO 8601 creation timestamp."},"state":{"$ref":"#/components/schemas/State"}},"type":"object"},"State":{"description":"The current status reported back by the cluster.","type":"string","enum":["AVAILABLE","BUSY","DESTROYING","DEGRADED","FAILED","UNKNOWN"]},"ClusterBackup":{"description":"A backup object.","properties":{"id":{"$ref":"#/components/schemas/ResourceId"},"clusterId":{"type":"string","description":"The unique ID of the cluster."},"version":{"type":"string","description":"The PostgreSQL version this backup was created from."},"isActive":{"type":"boolean","description":"Whether a cluster currently backs up data to this backup."},"earliestRecoveryTargetTime":{"type":"string","format":"date-time","description":"The oldest available timestamp to which you can restore."},"size":{"type":"integer","description":"Size of all base backups including the wal size in MB."},"location":{"$ref":"#/components/schemas/BackupLocation"}},"type":"object"},"BackupLocation":{"type":"string","description":"The S3 location where the backups will be stored."},"DeprecatedPagination":{"description":"Pagination information in list responses. DEPRECATED because of misspelled _links attribute.","type":"object","properties":{"offset":{"$ref":"#/components/schemas/PaginationOffset"},"limit":{"$ref":"#/components/schemas/PaginationLimit"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"PaginationOffset":{"description":"The offset specified in the request (if none was specified, the default\noffset is 0).\n","type":"integer","minimum":0,"default":0},"PaginationLimit":{"description":"The limit specified in the request (if none was specified, the default\nlimit is 100).\n","type":"integer","minimum":0,"default":100,"maximum":1000},"PaginationLinks":{"description":"URLs to navigate the different pages.\n","type":"object","properties":{"prev":{"description":"URL (with offset and limit parameters) of the previous page; only\npresent if offset is greater than 0.\n","type":"string","format":"uri","readOnly":true},"self":{"description":"URL (with offset and limit parameters) of the current page.\n","type":"string","format":"uri","readOnly":true},"next":{"description":"URL (with offset and limit parameters) of the next page; only\npresent if offset + limit is less than the total number of elements.\n","type":"string","format":"uri","readOnly":true}}},"ErrorResponse":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"type":"object"},"ErrorMessage":{"properties":{"errorCode":{"type":"string","description":"Application internal error code\n"},"message":{"type":"string","description":"A human readable explanation specific to this occurrence of the\nproblem.\n"}},"type":"object"}},"responses":{"ApiError":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error),\n402 (trial access), 403 (insufficient permissions), 404 (not found),\n405 (unsupported HTTP method), 415 (unsupported content type,\n422 (validation error), 429 (request rate limit exceeded),\n500 (server error), 503 (maintenance)\n","headers":{"Content-Type":{"description":"application/problem+json","schema":{"type":"string","default":"application/problem+json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/clusters/backups":{"get":{"operationId":"clustersBackupsGet","summary":"List cluster backups","description":"Retrieves a list of all PostgreSQL cluster backups.","tags":["Backups"],"parameters":[{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterBackupList"}}}},"default":{"$ref":"#/components/responses/ApiError"}}}}}}
```

## Fetch a cluster backup

> Retrieve a PostgreSQL cluster backup by using its ID. This value can be\
> found when you GET a list of PostgreSQL cluster backups.<br>

```json
{"openapi":"3.0.3","info":{"title":"IONOS DBaaS PostgreSQL REST API","version":"1.0.0"},"tags":[{"name":"Backups","description":"Everything about PostgreSQL backups."}],"servers":[{"url":"https://api.ionos.com/databases/postgresql","description":"Production"}],"security":[{"basicAuth":[]},{"tokenAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"You will need to base64 encode the string containing your credentials.\nSeparate your username and password with a colon, i.e.,\nusername:password and send it as 'Authorization' request header. More\ndetails: https://en.wikipedia.org/wiki/Basic_access_authentication.\n"},"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Please provide header value as 'Bearer <token>' and don't forget to add\n'Bearer' HTTP Authorization Scheme before the token.\n"}},"parameters":{"BackupIdPath":{"name":"backupId","in":"path","description":"The unique ID of the backup.","required":true,"schema":{"type":"string"}}},"schemas":{"BackupResponse":{"description":"A database backup.","properties":{"type":{"allOf":[{"$ref":"#/components/schemas/ResourceType"}]},"id":{"$ref":"#/components/schemas/ResourceId"},"metadata":{"$ref":"#/components/schemas/BackupMetadata"},"properties":{"$ref":"#/components/schemas/ClusterBackup"}},"type":"object"},"ResourceType":{"description":"The type of the resource.","type":"string","enum":["collection","cluster","backup","user","database"]},"ResourceId":{"type":"string","description":"The unique ID of the resource."},"BackupMetadata":{"description":"Metadata of the backup resource.","properties":{"createdDate":{"type":"string","format":"date-time","description":"The ISO 8601 creation timestamp."},"state":{"$ref":"#/components/schemas/State"}},"type":"object"},"State":{"description":"The current status reported back by the cluster.","type":"string","enum":["AVAILABLE","BUSY","DESTROYING","DEGRADED","FAILED","UNKNOWN"]},"ClusterBackup":{"description":"A backup object.","properties":{"id":{"$ref":"#/components/schemas/ResourceId"},"clusterId":{"type":"string","description":"The unique ID of the cluster."},"version":{"type":"string","description":"The PostgreSQL version this backup was created from."},"isActive":{"type":"boolean","description":"Whether a cluster currently backs up data to this backup."},"earliestRecoveryTargetTime":{"type":"string","format":"date-time","description":"The oldest available timestamp to which you can restore."},"size":{"type":"integer","description":"Size of all base backups including the wal size in MB."},"location":{"$ref":"#/components/schemas/BackupLocation"}},"type":"object"},"BackupLocation":{"type":"string","description":"The S3 location where the backups will be stored."},"ErrorResponse":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"type":"object"},"ErrorMessage":{"properties":{"errorCode":{"type":"string","description":"Application internal error code\n"},"message":{"type":"string","description":"A human readable explanation specific to this occurrence of the\nproblem.\n"}},"type":"object"}},"responses":{"ApiError":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error),\n402 (trial access), 403 (insufficient permissions), 404 (not found),\n405 (unsupported HTTP method), 415 (unsupported content type,\n422 (validation error), 429 (request rate limit exceeded),\n500 (server error), 503 (maintenance)\n","headers":{"Content-Type":{"description":"application/problem+json","schema":{"type":"string","default":"application/problem+json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/clusters/backups/{backupId}":{"get":{"operationId":"clustersBackupsFindById","summary":"Fetch a cluster backup","description":"Retrieve a PostgreSQL cluster backup by using its ID. This value can be\nfound when you GET a list of PostgreSQL cluster backups.\n","tags":["Backups"],"parameters":[{"$ref":"#/components/parameters/BackupIdPath"}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackupResponse"}}}},"default":{"$ref":"#/components/responses/ApiError"}}}}}}
```

## List backups of cluster

> Retrieves a list of all backups of the given PostgreSQL cluster.

```json
{"openapi":"3.0.3","info":{"title":"IONOS DBaaS PostgreSQL REST API","version":"1.0.0"},"tags":[{"name":"Backups","description":"Everything about PostgreSQL backups."}],"servers":[{"url":"https://api.ionos.com/databases/postgresql","description":"Production"}],"security":[{"basicAuth":[]},{"tokenAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"You will need to base64 encode the string containing your credentials.\nSeparate your username and password with a colon, i.e.,\nusername:password and send it as 'Authorization' request header. More\ndetails: https://en.wikipedia.org/wiki/Basic_access_authentication.\n"},"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Please provide header value as 'Bearer <token>' and don't forget to add\n'Bearer' HTTP Authorization Scheme before the token.\n"}},"parameters":{"PaginationLimit":{"name":"limit","in":"query","description":"The maximum number of elements to return. Use together with 'offset' for pagination.","required":false,"schema":{"type":"integer","default":100,"maximum":1000,"minimum":1}},"PaginationOffset":{"name":"offset","in":"query","description":"The first element to return. Use together with 'limit' for pagination.","required":false,"schema":{"type":"integer","default":0}},"ClusterIdPath":{"name":"clusterId","in":"path","description":"The unique ID of the cluster.","required":true,"schema":{"type":"string"}}},"schemas":{"ClusterBackupList":{"description":"List of backups.","allOf":[{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ResourceType"},"id":{"$ref":"#/components/schemas/ResourceId"},"items":{"type":"array","items":{"$ref":"#/components/schemas/BackupResponse"}}}},{"$ref":"#/components/schemas/DeprecatedPagination"}]},"ResourceType":{"description":"The type of the resource.","type":"string","enum":["collection","cluster","backup","user","database"]},"ResourceId":{"type":"string","description":"The unique ID of the resource."},"BackupResponse":{"description":"A database backup.","properties":{"type":{"allOf":[{"$ref":"#/components/schemas/ResourceType"}]},"id":{"$ref":"#/components/schemas/ResourceId"},"metadata":{"$ref":"#/components/schemas/BackupMetadata"},"properties":{"$ref":"#/components/schemas/ClusterBackup"}},"type":"object"},"BackupMetadata":{"description":"Metadata of the backup resource.","properties":{"createdDate":{"type":"string","format":"date-time","description":"The ISO 8601 creation timestamp."},"state":{"$ref":"#/components/schemas/State"}},"type":"object"},"State":{"description":"The current status reported back by the cluster.","type":"string","enum":["AVAILABLE","BUSY","DESTROYING","DEGRADED","FAILED","UNKNOWN"]},"ClusterBackup":{"description":"A backup object.","properties":{"id":{"$ref":"#/components/schemas/ResourceId"},"clusterId":{"type":"string","description":"The unique ID of the cluster."},"version":{"type":"string","description":"The PostgreSQL version this backup was created from."},"isActive":{"type":"boolean","description":"Whether a cluster currently backs up data to this backup."},"earliestRecoveryTargetTime":{"type":"string","format":"date-time","description":"The oldest available timestamp to which you can restore."},"size":{"type":"integer","description":"Size of all base backups including the wal size in MB."},"location":{"$ref":"#/components/schemas/BackupLocation"}},"type":"object"},"BackupLocation":{"type":"string","description":"The S3 location where the backups will be stored."},"DeprecatedPagination":{"description":"Pagination information in list responses. DEPRECATED because of misspelled _links attribute.","type":"object","properties":{"offset":{"$ref":"#/components/schemas/PaginationOffset"},"limit":{"$ref":"#/components/schemas/PaginationLimit"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"PaginationOffset":{"description":"The offset specified in the request (if none was specified, the default\noffset is 0).\n","type":"integer","minimum":0,"default":0},"PaginationLimit":{"description":"The limit specified in the request (if none was specified, the default\nlimit is 100).\n","type":"integer","minimum":0,"default":100,"maximum":1000},"PaginationLinks":{"description":"URLs to navigate the different pages.\n","type":"object","properties":{"prev":{"description":"URL (with offset and limit parameters) of the previous page; only\npresent if offset is greater than 0.\n","type":"string","format":"uri","readOnly":true},"self":{"description":"URL (with offset and limit parameters) of the current page.\n","type":"string","format":"uri","readOnly":true},"next":{"description":"URL (with offset and limit parameters) of the next page; only\npresent if offset + limit is less than the total number of elements.\n","type":"string","format":"uri","readOnly":true}}},"ErrorResponse":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"type":"object"},"ErrorMessage":{"properties":{"errorCode":{"type":"string","description":"Application internal error code\n"},"message":{"type":"string","description":"A human readable explanation specific to this occurrence of the\nproblem.\n"}},"type":"object"}},"responses":{"ApiError":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error),\n402 (trial access), 403 (insufficient permissions), 404 (not found),\n405 (unsupported HTTP method), 415 (unsupported content type,\n422 (validation error), 429 (request rate limit exceeded),\n500 (server error), 503 (maintenance)\n","headers":{"Content-Type":{"description":"application/problem+json","schema":{"type":"string","default":"application/problem+json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/clusters/{clusterId}/backups":{"get":{"operationId":"clusterBackupsGet","summary":"List backups of cluster","description":"Retrieves a list of all backups of the given PostgreSQL cluster.","tags":["Backups"],"parameters":[{"$ref":"#/components/parameters/PaginationLimit"},{"$ref":"#/components/parameters/PaginationOffset"},{"$ref":"#/components/parameters/ClusterIdPath"}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterBackupList"}}}},"default":{"$ref":"#/components/responses/ApiError"}}}}}}
```
