> ## 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.

# List domains

> Lists your domains, newest first. Without `type`, all of your domains are returned; with `teamID`, only app domains are returned unless you send `type=BUCKET`, and only for resources you have access to.



## OpenAPI

````yaml /spec/paas-domains-disks.yaml get /v1/domains
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:
  /v1/domains:
    get:
      tags:
        - Domains
      summary: List domains
      description: >-
        Lists your domains, newest first. Without `type`, all of your domains
        are returned; with `teamID`, only app domains are returned unless you
        send `type=BUCKET`, and only for resources you have access to.
      operationId: listDomains
      parameters:
        - $ref: '#/components/parameters/TeamID'
        - name: type
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/DomainType'
        - name: project
          in: query
          required: false
          description: Only list domains of this app (by name).
          schema:
            type: string
        - name: bucket
          in: query
          required: false
          description: Only list domains of this bucket (by name).
          schema:
            type: string
        - name: domain
          in: query
          required: false
          description: >-
            Only list domains whose name contains this text (letters, digits and
            dots).
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: Page number, starting at 1. Use it together with `count`.
          schema:
            type: integer
            minimum: 1
        - name: count
          in: query
          required: false
          description: Domains per page. Without it, all matching domains are returned.
          schema:
            type: integer
            minimum: 1
      responses:
        '200':
          description: Your domains.
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  domains:
                    type: array
                    items:
                      $ref: '#/components/schemas/DomainSummary'
              example:
                total: 1
                domains:
                  - _id: '000000000000000000000210'
                    name: www.example.com
                    type: PROJECT
                    status: ACTIVE
                    project:
                      _id: '000000000000000000000050'
                      project_id: my-app
                    CNameRecord: VALID
                    acmeRecord: INVALID
                    certificatesStatus: ACTIVE
                    redirectTo: ''
                    redirectStatus: 302
                    behindCdn: false
                    isWildcard: false
                    created_at: '2026-01-01T08:00:00.000Z'
        '400':
          $ref: '#/components/responses/ValidationOrTeamIDError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/TeamForbidden'
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:
    DomainType:
      type: string
      description: >-
        `PROJECT` for an app's domain, `BUCKET` for an object storage bucket's
        domain.
      enum:
        - PROJECT
        - BUCKET
      default: PROJECT
    DomainSummary:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        type:
          $ref: '#/components/schemas/DomainType'
        status:
          type: string
          description: '`ACTIVE` once ownership is verified, `PENDING` before that.'
          enum:
            - PENDING
            - ACTIVE
        project:
          type: object
          nullable: true
          description: The app, for app domains.
          properties:
            _id:
              type: string
            project_id:
              type: string
              description: The app's name.
        bucket:
          type: object
          nullable: true
          description: The bucket, for bucket domains.
          properties:
            _id:
              type: string
            name:
              type: string
        CNameRecord:
          type: string
          description: Result of the last routing check.
          enum:
            - VALID
            - INVALID
        acmeRecord:
          type: string
          description: Result of the last check of the `_acme-challenge` record.
          enum:
            - VALID
            - INVALID
        certificatesStatus:
          type: string
          enum:
            - DEACTIVE
            - REQUESTING
            - ACTIVE
        redirectTo:
          type: string
          description: URL the domain redirects to, or empty.
        redirectStatus:
          type: integer
          enum:
            - 301
            - 302
        behindCdn:
          type: boolean
          description: >-
            Whether the domain routes correctly but resolves to a different IP,
            for example because it's behind a CDN.
        isWildcard:
          type: boolean
        created_at:
          type: string
          format: date-time
    ObjectID:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: 24-character hexadecimal ID.
    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.