v1
Double column
API
CLI
JS Client

Addons /

Import addon backup

Imports a database from an external archive or existing live database.

Required permission

Project > Addons > General > Update

Path parameters

    • projectId

      string required

      ID of the project

    • addonId

      string required

      ID of the addon

Request body

  • {object}

    Import using a connection string. The database will be imported from the live database located at the connection string's location.

    • name

      string

      The name of the backup. If not provided, a default name will be generated containing the current date.

      min length
      3
      max length
      20
      pattern
      ^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$
    • connectionString

      string required

      A database connection string.

OR
  • {object}

    Import using an external archive. The database will be imported from an existing backup.

    • name

      string

      The name of the backup. If not provided, a default name will be generated containing the current date.

      min length
      3
      max length
      20
      pattern
      ^[a-zA-Z]((-|\s)?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$
    • importUrl

      string required

      A url pointing to an existing backup stored as a GNU zip (.gz) file.

API
CLI
JS Client

POST /v1/projects/{projectId}/addons/{addonId}/import

Example request

Request body
Import using a connection string. The database will be imported from the live database located at the connection string's location.
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"Example Backup","connectionString":"mongodb://mongodb0.example.com:27017"}' \
  http://api.northflank.com/v1/projects/{projectId}/addons/{addonId}/import
OR
Import using an external archive. The database will be imported from an existing backup.
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"Example Backup","importUrl":"https://example.com/backup.db.gz"}' \
  http://api.northflank.com/v1/projects/{projectId}/addons/{addonId}/import

Example response

200 OK

success

© 2022 Northflank Ltd. All rights reserved.