---
search:
  tags:
    - console-backup
    - POST
seo:
  description: >-
    Opens the target and writes the marker .tse-backup-target… Reference for the
    POST /api/v1/console-backup/targets endpoint in the TimescaleDB Enterprise
    API.
sidebar:
  label: Add a backup target
  badge: POST
title: Add a backup target
type: openapi-operation
---
Opens the target and writes the marker .tse-backup-target into it, or keeps the marker that is there. Each backup checks the marker first. The console has at most one local target. The credentials of an s3 target are kept encrypted and never returned.

`POST /api/v1/console-backup/targets`

**Request body** (`application/json`, required)

- `kind` (string, required) — local: the backup directory of the console host (TSE\_BACKUP\_DIR). s3: an S3-compatible bucket
- `name` (string, required)
- `secrets` (BackupTargetSecretsBody) — Required for an s3 target
- `settings` (BackupTargetSettingsBody)

Request body example:

```json
{
  "kind": "local",
  "name": "string",
  "secrets": {
    "s3": {
      "access_key_id": "string",
      "secret_access_key": "string",
      "session_token": "string"
    }
  },
  "settings": {
    "s3": {
      "bucket": "string",
      "ca_bundle": "string",
      "endpoint": "string",
      "path_style": true,
      "prefix": "string",
      "region": "string"
    }
  }
}
```

**Responses**

- `200` — OK
- `default` — Error

Response example, 200:

```json
{
  "created_at": "2019-08-24T14:15:22Z",
  "id": "string",
  "kind": "local",
  "name": "string",
  "secrets_set": true,
  "settings": {
    "s3": {
      "bucket": "string",
      "ca_bundle": "string",
      "endpoint": "string",
      "path_style": true,
      "prefix": "string",
      "region": "string"
    }
  },
  "updated_at": "2019-08-24T14:15:22Z"
}
```
