Getting started
Back to home
Getting started

Get a backup schedule

Read one backup policy, its enabled state and recent run status.

GET/api/customer/v1/projects/{projectId}/backups/{policyId}

Path parameters

NameValue
projectIdRequired resource ID from an earlier API response.
policyIdRequired resource ID from an earlier API response.

Example request

Set HCODE_BASE_URL and HCODE_API_KEY as shown in Getting started. Replace resource variables with your own IDs.

curl --request GET "$HCODE_BASE_URL/api/customer/v1/projects/${PROJECT_ID}/backups/${POLICY_ID}" \
  --header "Authorization: Bearer $HCODE_API_KEY"

Response

The JSON shape is defined in the response schema.

Response schema
{
  "type": "object",
  "properties": {
    "backup": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "schedule": {
          "type": "string"
        },
        "databaseId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "prefix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastBackupAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "retentionDays": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "type",
        "schedule"
      ],
      "additionalProperties": true
    }
  },
  "required": [
    "backup"
  ],
  "additionalProperties": true
}

See errors and retries for failure responses.