> ## Documentation Index
> Fetch the complete documentation index at: https://developers.liara.ir/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore a disk backup

> Restores one of a disk's backups onto a disk of the same app or of another of your apps. The target disk's current contents are replaced. Team permission: `manage`.



## OpenAPI

````yaml /spec/paas-domains-disks.yaml post /v2/projects/{projectID}/disks/{name}/restore
openapi: 3.0.1
info:
  title: Domains & Disks
  version: 1.0.0
  description: |
    Connect custom domains to your apps and object storage buckets, and
    manage your apps' persistent disks, their backups and FTP access.

    ## Connecting a domain

    1. Add the domain with `POST /v1/domains`.
    2. Get its details with `GET /v1/domains/{domainName}` and create these
       DNS records at your DNS provider:
       - **Ownership:** a `TXT` record on `liara-challenge.<domain>` with the
         domain's `verificationCode`. You can skip it if the root domain is a
         zone managed in Liara DNS.
       - **Routing:** a `CNAME` record from the domain to its `target`. For a
         wildcard domain `*.example.com`, the check uses
         `__liara__.example.com`, which a wildcard record covers.
       - **Certificates through DNS validation** (needed for wildcard
         domains): a `CNAME` record from `_acme-challenge.<domain>` to
         `<domain-with-dashes>._acme-challenge.liara.cloud`, for example
         `_acme-challenge.example.com` → `example-com._acme-challenge.liara.cloud`.
    3. Check the records with `GET /v1/domains/{domainID}/check`. The domain
       becomes `ACTIVE` once ownership is verified.
    4. Request an SSL certificate with `POST /v1/domains/provision-ssl-certs`.

    ## Identifying an app

    Some disk endpoints identify the app by its **name** (`project_id`) and
    others by its **ID** (`projectID`, the app's `_id`). Each endpoint says
    which one it expects.

    ## Team permissions

    With `teamID`, each endpoint needs one of the permissions it lists on the
    app (or bucket) involved. A permission from your role or a resource
    permission on that app both count.
servers:
  - url: https://api.liara.ir
security:
  - bearerAuth: []
tags:
  - name: Domains
    description: Add, verify and remove custom domains.
  - name: Domain SSL & Redirects
    description: SSL certificates and redirects for custom domains.
  - name: Disks
    description: Create, resize and delete persistent disks.
  - name: Disk Backups
    description: Back up disks, download backups and restore them.
  - name: FTP Access
    description: FTP accounts for reading and writing disk files.
paths:
  /v2/projects/{projectID}/disks/{name}/restore:
    post:
      tags:
        - Disk Backups
      summary: Restore a disk backup
      description: >-
        Restores one of a disk's backups onto a disk of the same app or of
        another of your apps. The target disk's current contents are replaced.
        Team permission: `manage`.
      operationId: restoreDiskBackup
      parameters:
        - $ref: '#/components/parameters/TeamID'
        - name: projectID
          in: path
          required: true
          description: ID of the app that owns the backed-up disk.
          schema:
            $ref: '#/components/schemas/ObjectID'
        - name: name
          in: path
          required: true
          description: Name of the backed-up disk.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - backupName
                - targetProjectID
                - targetDiskName
              properties:
                backupName:
                  type: string
                  maxLength: 100
                  description: The backup's `name` from the backups list.
                targetProjectID:
                  type: string
                  pattern: ^[0-9a-fA-F]{24}$
                  description: ID of the app to restore into.
                targetDiskName:
                  $ref: '#/components/schemas/DiskName'
            example:
              backupName: daily/2026-01-01T03-00-00-1767222000000.tar
              targetProjectID: '000000000000000000000050'
              targetDiskName: uploads
      responses:
        '200':
          description: The restore started. The response body is empty.
        '400':
          $ref: '#/components/responses/ValidationOrTeamIDError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/TeamForbidden'
        '404':
          description: An app, disk or the backup doesn't exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 404
                error: Not Found
                message: Backup not found.
                data: null
components:
  parameters:
    TeamID:
      name: teamID
      in: query
      required: false
      description: >-
        Run the request in the context of a team you belong to, instead of your
        personal account.
      schema:
        $ref: '#/components/schemas/ObjectID'
      example: '000000000000000000000002'
  schemas:
    ObjectID:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: 24-character hexadecimal ID.
    DiskName:
      type: string
      minLength: 3
      pattern: ^[a-z0-9][a-z0-9\-]+[a-z0-9]$
      description: Lowercase letters, digits and hyphens; can't start or end with a hyphen.
    Error:
      type: object
      description: Standard error body.
      properties:
        statusCode:
          type: integer
        error:
          type: string
          description: HTTP status text.
        message:
          type: string
          description: What went wrong.
        data:
          type: object
          nullable: true
          description: >-
            Extra details. When present, `code` is a stable, machine-readable
            error code.
          properties:
            code:
              type: string
    AuthError:
      type: object
      description: Error body returned when the API token is rejected.
      properties:
        error:
          type: string
  responses:
    ValidationOrTeamIDError:
      description: >-
        The body or a parameter is invalid (`message` says which), or `teamID`
        isn't a valid ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            validation:
              summary: Invalid body
              value:
                statusCode: 400
                error: Bad Request
                message: '"size" must be greater than or equal to 0.1'
            invalidTeamID:
              summary: Invalid team ID
              value:
                statusCode: 400
                error: Bad Request
                message: Invalid team ID.
                data: null
    Unauthorized:
      description: The API token is missing, invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            error: Unauthorized.
    TeamForbidden:
      description: >-
        With `teamID`: you aren't a member of the team (`team_not_found`), or
        you don't have the required permission (`no_permission`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            teamNotFound:
              summary: Not a team member
              value:
                statusCode: 403
                error: Forbidden
                message: Team not found
                data:
                  code: team_not_found
            noPermission:
              summary: Missing permission
              value:
                statusCode: 403
                error: Forbidden
                message: You do not have permission to access this resource.
                data:
                  code: no_permission
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your API token as `Authorization: Bearer <api-token>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.