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

# Get a domain

> Returns a domain, including the `verificationCode` and `target` you need for its DNS records. The response can include additional fields not listed here. With `teamID`, you need any permission on the app or bucket.



## OpenAPI

````yaml /spec/paas-domains-disks.yaml get /v1/domains/{domainName}
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/{domainName}:
    get:
      tags:
        - Domains
      summary: Get a domain
      description: >-
        Returns a domain, including the `verificationCode` and `target` you need
        for its DNS records. The response can include additional fields not
        listed here. With `teamID`, you need any permission on the app or
        bucket.
      operationId: getDomain
      parameters:
        - $ref: '#/components/parameters/TeamID'
        - name: domainName
          in: path
          required: true
          schema:
            type: string
          example: www.example.com
      responses:
        '200':
          description: The domain.
          content:
            application/json:
              schema:
                type: object
                properties:
                  domain:
                    $ref: '#/components/schemas/Domain'
              example:
                domain:
                  _id: '000000000000000000000210'
                  name: www.example.com
                  type: PROJECT
                  status: PENDING
                  project:
                    _id: '000000000000000000000050'
                    project_id: my-app
                  verificationCode: 00000000-0000-0000-0000-000000000000
                  CNameRecord: INVALID
                  acmeRecord: INVALID
                  certificatesStatus: DEACTIVE
                  redirectTo: ''
                  redirectStatus: 302
                  behindCdn: false
                  isWildcard: false
                  isRoot: false
                  subdomain: www
                  target: <target-host>
                  created_at: '2026-01-01T08:00:00.000Z'
                  updated_at: '2026-01-01T08:00:00.000Z'
        '400':
          $ref: '#/components/responses/InvalidTeamID'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/TeamForbidden'
        '404':
          $ref: '#/components/responses/DomainNotFound'
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:
    Domain:
      allOf:
        - $ref: '#/components/schemas/DomainSummary'
        - type: object
          properties:
            verificationCode:
              type: string
              description: Value for the `liara-challenge` TXT record.
            target:
              type: string
              description: Host to point the domain's CNAME record at.
            isRoot:
              type: boolean
              description: Whether this is a root domain (for example `example.com`).
            subdomain:
              type: string
              description: The subdomain part, for example `www`.
            issuedAt:
              type: string
              format: date-time
              description: When the current certificate was issued.
            updated_at:
              type: string
              format: date-time
    ObjectID:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: 24-character hexadecimal ID.
    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
    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
    DomainType:
      type: string
      description: >-
        `PROJECT` for an app's domain, `BUCKET` for an object storage bucket's
        domain.
      enum:
        - PROJECT
        - BUCKET
      default: PROJECT
  responses:
    InvalidTeamID:
      description: '`teamID` isn''t a valid ID.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            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
    DomainNotFound:
      description: You have no domain with this name or ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 404
            error: Not Found
            message: Domain not found.
            data: null
  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.