---
title: Starts the database export process.
slug: dxp/api/starts-the-database-export-process
docTags: 
createdAt: 2026-06-23T08:29:20.621Z
---

{
  "id": "MFYsCaw9UH9yK-VBIoYlK",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://paasportal.episerver.net/api/v1.0/projects/{projectId}/environments/{environment}/databases/{databaseName}/exports",
    "servers": [
      {
        "url": "https://paasportal.episerver.net/api/v1.0/projects/{projectId}/environments/{environment}/databases/{databaseName}/exports"
      }
    ],
    "name": "Starts the database export process.",
    "description": "<p>When export process is completed, returns a read-only Azure Blob Storage SAS URI of the exported database bacpac file.\r\nBy default, the bacpac file is retained for 24 hours unless otherwise the retention hour is overridden.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "projectId",
          "type": "string<uuid>",
          "description": "Project Id",
          "format": "uuid"
        },
        {
          "kind": "required",
          "name": "environment",
          "type": "string",
          "description": "Environment Name"
        },
        {
          "kind": "required",
          "name": "databaseName",
          "type": "string",
          "description": "<p>Database Name. Valid and accepted values are epicms/epicommerce</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "example": "{\"retentionHours\":72}",
          "description": "Start export database request parameter",
          "customType": "StartExportDatabaseRequestParameters",
          "schema": [
            {
              "name": "retentionHours",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "",
              "format": "int32"
            }
          ],
          "modelRef": "#/components/schemas/StartExportDatabaseRequestParameters",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// OK\n{\n  \"projectId\": \"\",\n  \"databaseName\": \"\",\n  \"databaseDisplayName\": \"\",\n  \"bacpacName\": \"\",\n  \"environment\": \"\",\n  \"status\": \"\",\n  \"downloadLink\": \"\",\n  \"id\": \"\"\n}"
          },
          {
            "label": "response",
            "code": "{\n  \"success\": false,\n  \"errors\": null,\n  \"result\": {\n    \"id\": \"1b22aaf0-5e39-40d5-a0b9-fd15cbb38719\",\n    \"projectId\": \"ad5b41d1-8345-4038-a13e-f82bfe867b6f\",\n    \"databaseName\": \"epicms\",\n    \"databaseDisplayName\": \"epicms\",\n    \"bacpacName\": null,\n    \"environment\": \"Production\",\n    \"status\": \"Started\",\n    \"downloadLink\": null\n  }\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ExportDatabaseResponse",
            "schema": [
              {
                "name": "projectId",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "databaseName",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "databaseDisplayName",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": ""
              },
              {
                "name": "bacpacName",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "environment",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "downloadLink",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              }
            ],
            "modelRef": "#/components/schemas/ExportDatabaseResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "BadRequest",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// BadRequest\n{}"
          },
          {
            "label": "response",
            "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"Project Id is a required field.\"\n  ],\n  \"result\": null\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "BadRequestApiErrorResponseExample",
            "schema": [],
            "modelRef": "#/components/schemas/BadRequestApiErrorResponseExample",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Unauthorized\n{}"
          },
          {
            "label": "response",
            "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"Access is denied for project c943975b-d468-4b85-8e62-5967b9eeeece or environment Preproduction.\"\n  ],\n  \"result\": null\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "UnauthorizedApiErrorResponseExample",
            "schema": [],
            "modelRef": "#/components/schemas/UnauthorizedApiErrorResponseExample",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "NotFound",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// NotFound\n{}"
          },
          {
            "label": "response",
            "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"There is no active project found for project id: c943975b-d468-4b85-8e62-5967b9eeeece.\"\n  ],\n  \"result\": null\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "NotFoundApiErrorResponseExample",
            "schema": [],
            "modelRef": "#/components/schemas/NotFoundApiErrorResponseExample",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "InternalServerError",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// InternalServerError\n{}"
          },
          {
            "label": "response",
            "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"An error occurred while processing the request; Try again later.\"\n  ],\n  \"result\": null\n}"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "InternalServerErrorApiErrorResponseExample",
            "schema": [],
            "modelRef": "#/components/schemas/InternalServerErrorApiErrorResponseExample",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "SSFzgdbcuiLUKvjOT5Ph0",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://paasportal.episerver.net/api/v1.0/projects/{projectId}/environments/{environment}/databases/{databaseName}/exports \\\n     --header 'accept: application/json'"
        },
        {
          "id": "e1CqWsNIQgmRC_wJSjwl7",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://paasportal.episerver.net/api/v1.0/projects/{projectId}/environments/{environment}/databases/{databaseName}/exports\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "__M2XzqXQBfba29Bh9thL",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://paasportal.episerver.net/api/v1.0/projects/{projectId}/environments/{environment}/databases/{databaseName}/exports\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "G3h87dEOoF2aJw72iBeHa",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://paasportal.episerver.net/api/v1.0/projects/{projectId}/environments/{environment}/databases/{databaseName}/exports\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "SSFzgdbcuiLUKvjOT5Ph0"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"projectId\": \"\",\n  \"databaseName\": \"\",\n  \"databaseDisplayName\": \"\",\n  \"bacpacName\": \"\",\n  \"environment\": \"\",\n  \"status\": \"\",\n  \"downloadLink\": \"\",\n  \"id\": \"\"\n}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// OK\n{\n  \"projectId\": \"\",\n  \"databaseName\": \"\",\n  \"databaseDisplayName\": \"\",\n  \"bacpacName\": \"\",\n  \"environment\": \"\",\n  \"status\": \"\",\n  \"downloadLink\": \"\",\n  \"id\": \"\"\n}"
            },
            {
              "label": "response",
              "code": "{\n  \"success\": false,\n  \"errors\": null,\n  \"result\": {\n    \"id\": \"1b22aaf0-5e39-40d5-a0b9-fd15cbb38719\",\n    \"projectId\": \"ad5b41d1-8345-4038-a13e-f82bfe867b6f\",\n    \"databaseName\": \"epicms\",\n    \"databaseDisplayName\": \"epicms\",\n    \"bacpacName\": null,\n    \"environment\": \"Production\",\n    \"status\": \"Started\",\n    \"downloadLink\": null\n  }\n}"
            }
          ]
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// BadRequest\n{}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// BadRequest\n{}"
            },
            {
              "label": "response",
              "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"Project Id is a required field.\"\n  ],\n  \"result\": null\n}"
            }
          ]
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Unauthorized\n{}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Unauthorized\n{}"
            },
            {
              "label": "response",
              "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"Access is denied for project c943975b-d468-4b85-8e62-5967b9eeeece or environment Preproduction.\"\n  ],\n  \"result\": null\n}"
            }
          ]
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// NotFound\n{}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// NotFound\n{}"
            },
            {
              "label": "response",
              "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"There is no active project found for project id: c943975b-d468-4b85-8e62-5967b9eeeece.\"\n  ],\n  \"result\": null\n}"
            }
          ]
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// InternalServerError\n{}",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// InternalServerError\n{}"
            },
            {
              "label": "response",
              "code": "{\n  \"success\": false,\n  \"errors\": [\n    \"An error occurred while processing the request; Try again later.\"\n  ],\n  \"result\": null\n}"
            }
          ]
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}