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

# Get a domain by name

> Response will contain the requested domain if the caller is authorized to view it



## OpenAPI

````yaml get /org/{org}/domain/{name}
openapi: 3.0.3
info:
  title: Control Plane Core API
  description: Copyright © 2023 Control Plane Corporation. All rights reserved.
  version: 1.0.0
servers:
  - url: https://api.cpln.io
    description: ''
security:
  - {}
  - serviceAccountKey: []
  - jwt: []
externalDocs:
  url: https://docs.controlplane.com/
  description: End-user documentation
paths:
  /org/{org}/domain/{name}:
    get:
      tags:
        - domain
      summary: Get a domain by name
      description: >-
        Response will contain the requested domain if the caller is authorized
        to view it
      parameters:
        - in: path
          name: org
          required: true
          schema:
            type: string
        - in: path
          name: name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/domain'
        '403':
          description: Not found or not allowed to view
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    domain:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        kind:
          type: string
          readOnly: true
        version:
          type: integer
          readOnly: true
        description:
          type: string
          maxLength: 250
        tags:
          type: object
        created:
          type: string
          format: date-time
          readOnly: true
        lastModified:
          type: string
          format: date-time
          readOnly: true
        links:
          type: array
          items:
            $ref: '#/components/schemas/link'
          readOnly: true
        name:
          type: string
          maxLength: 253
        spec:
          type: object
          properties:
            dnsMode:
              type: string
              enum:
                - cname
                - ns
              description: >-
                In 'cname' dnsMode, Control Plane will configure workloads to
                accept traffic for the domain but will not manage DNS records
                for the domain.
                      End users configure CNAME records in their own DNS pointed to the canonical workload endpoint.
                      Currently 'cname' dnsMode requires that a tls.serverCertificate is configured when subdomain based routing is used.
                      In 'ns' dnsMode, Control Plane will manage the subdomains and create all necessary DNS records.
                      End users configure an NS record to forward DNS requests to the Control Plane managed DNS servers.
            gvcLink:
              type: string
              description: >-
                One of gvcLink and routes may be provided. When gvcLink is
                configured each workload in the GVC will receive a subdomain in
                the form ${workload.name}.${domain.name}
            certChallengeType:
              type: string
              enum:
                - http01
                - dns01
            workloadLink:
              type: string
            acceptAllHosts:
              type: boolean
            acceptAllSubdomains:
              type: boolean
            ports:
              type: array
              items:
                type: object
                properties:
                  number:
                    type: number
                  protocol:
                    type: string
                    enum:
                      - http
                      - http2
                      - tcp
                    default: http2
                  routes:
                    type: array
                    items:
                      type: object
                      properties:
                        replacePrefix:
                          type: string
                          description: >-
                            When provided, the URI prefix will be replaced with
                            this string before the request is sent to the
                            workload.
                        regex:
                          type: string
                          description: |-
                            Used to match URI paths.
                            One of prefix OR regex may be provided.
                            Uses the google re2 regex syntax
                        prefix:
                          type: string
                        workloadLink:
                          type: string
                        port:
                          type: integer
                        hostPrefix:
                          type: string
                          description: >-
                            This option allows forwarding traffic for different
                            host headers to different workloads.

                            This will only be used when the target GVC has
                            dedicated load balancing enabled and the Domain is
                            configure for wildcard support.

                            Contact your account manager for details.
                        hostRegex:
                          type: string
                          description: >-
                            A regex to match the host header. 

                            This will only be used when the target GVC has
                            dedicated load balancing enabled and the Domain is
                            configure for wildcard support. 

                            Contact your account manager for details.
                        headers:
                          type: object
                          properties:
                            request:
                              type: object
                              properties:
                                set:
                                  type: object
                                  description: >-
                                    Sets or overrides headers to all http
                                    requests for this route.
                              additionalProperties: false
                              description: Manipulates HTTP headers
                          additionalProperties: false
                          description: >-
                            Modify the headers for all http requests for this
                            route.
                        replica:
                          type: integer
                          description: >-
                            The replica number of a stateful workload to route
                            to. If not provided, traffic will be routed to all
                            replicas.
                        mirror:
                          type: array
                          items:
                            type: object
                            properties:
                              workloadLink:
                                type: string
                                description: The workload to mirror traffic to.
                              port:
                                type: integer
                                description: >-
                                  The port to send mirrored traffic to. If not
                                  provided, traffic will be mirrored to the
                                  first discovered port on the mirrored workload
                              percent:
                                type: number
                                description: >-
                                  The percentage of traffic to mirror to the
                                  specified workload.
                            additionalProperties: false
                            description: >-
                              Mirror a percentage of traffic to another workload
                              for testing or canary purposes.
                        canaries:
                          type: array
                          items:
                            type: object
                            properties:
                              workloadLink:
                                type: string
                                description: >-
                                  The canary workload to route a weighted
                                  percentage of traffic to.
                              port:
                                type: integer
                                description: >-
                                  The port to send canary traffic to. If not
                                  provided, the first configured port on the
                                  workload is used.
                              weight:
                                type: integer
                                description: >-
                                  The percentage of traffic to send to this
                                  canary workload. A weight of 0 disables the
                                  canary so it can be toggled on and off without
                                  removing it.
                            additionalProperties: false
                            description: >-
                              Routes a weighted percentage of traffic to an
                              additional workload. The combined weight of all
                              canaries on a route must not exceed 100; the
                              remaining weight goes to the primary workload. A
                              canary with a weight of 0 is skipped. A canary
                              whose workload is not deployed in a given location
                              is dropped there and its weight returns to the
                              primary workload. HTTP/HTTP2 only.
                          description: >-
                            Split traffic for this route across one or more
                            additional workloads by weight.
                      additionalProperties: false
                    description: A list of mappings to workloads.
                  cors:
                    type: object
                    properties:
                      allowOrigins:
                        type: array
                        items:
                          type: object
                          properties:
                            exact:
                              type: string
                            regex:
                              type: string
                          additionalProperties: false
                      allowMethods:
                        type: array
                        items:
                          type: string
                      allowHeaders:
                        type: array
                        items:
                          type: string
                      exposeHeaders:
                        type: array
                        items:
                          type: string
                      maxAge:
                        type: string
                      allowCredentials:
                        type: boolean
                    additionalProperties: false
                  tls:
                    type: object
                    properties:
                      minProtocolVersion:
                        type: string
                        enum:
                          - TLSV1_3
                          - TLSV1_2
                          - TLSV1_1
                          - TLSV1_0
                        default: TLSV1_2
                      cipherSuites:
                        type: array
                        items:
                          type: string
                          enum:
                            - ECDHE-ECDSA-AES256-GCM-SHA384
                            - ECDHE-ECDSA-CHACHA20-POLY1305
                            - ECDHE-ECDSA-AES128-GCM-SHA256
                            - ECDHE-RSA-AES256-GCM-SHA384
                            - ECDHE-RSA-CHACHA20-POLY1305
                            - ECDHE-RSA-AES128-GCM-SHA256
                            - AES256-GCM-SHA384
                            - AES128-GCM-SHA256
                            - TLS_RSA_WITH_AES_256_GCM_SHA384
                            - TLS_RSA_WITH_AES_128_GCM_SHA256
                            - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
                            - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
                            - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
                            - TLS_CHACHA20_POLY1305_SHA256
                            - TLS_AES_256_GCM_SHA384
                            - TLS_AES_128_GCM_SHA256
                            - DES-CBC3-SHA
                            - ECDHE-RSA-AES128-SHA
                            - ECDHE-RSA-AES256-SHA
                            - AES128-SHA
                            - AES256-SHA
                          default:
                            - ECDHE-ECDSA-AES256-GCM-SHA384
                            - ECDHE-ECDSA-CHACHA20-POLY1305
                            - ECDHE-ECDSA-AES128-GCM-SHA256
                            - ECDHE-RSA-AES256-GCM-SHA384
                            - ECDHE-RSA-CHACHA20-POLY1305
                            - ECDHE-RSA-AES128-GCM-SHA256
                            - AES256-GCM-SHA384
                            - AES128-GCM-SHA256
                      clientCertificate:
                        type: object
                        properties:
                          secretLink:
                            type: string
                            description: >-
                              The secret will include a client certificate
                              authority cert in PEM format used to verify
                              requests which include client certificates. The
                              key subject must match the domain and the key
                              usage properties must be configured for client
                              certificate authorization. The secret type must be
                              keypair.
                        additionalProperties: false
                        description: >-
                          When clientCertificate is defined, requests may
                          optionally supply a client certificate. The
                          certificate details are included in the
                          x-forwarded-client-cert header.
                      serverCertificate:
                        type: object
                        properties:
                          secretLink:
                            type: string
                            description: >-
                              When provided, this is used as the server
                              certificate authority. The secret type must be
                              keypair and the content must be PEM encoded.
                        additionalProperties: false
                        description: >-
                          Configure an optional custom server certificate for
                          the domain. When the port number is 443 and this is
                          not supplied, a certificate is provisioned
                          automatically.
                    additionalProperties: false
                    description: >-
                      Used for TLS connections for this Domain. End users are
                      responsible for certificate updates.
                additionalProperties: false
          additionalProperties: false
        status:
          type: object
          properties:
            endpoints:
              type: array
              items:
                type: object
                properties:
                  url:
                    type: string
                  workloadLink:
                    type: string
                additionalProperties: false
            status:
              type: string
              enum:
                - initializing
                - ready
                - pendingDnsConfig
                - pendingCertificate
                - usedByGvc
                - warning
                - created
                - updated
                - deleted
                - errored
                - ignored
            warning:
              type: string
            statusUpdated:
              type: string
              format: date-time
            locations:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  certificateStatus:
                    type: string
                    enum:
                      - initializing
                      - ready
                      - pendingDnsConfig
                      - pendingCertificate
                      - ignored
                additionalProperties: false
            fingerprint:
              type: string
            dnsConfig:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                  ttl:
                    type: integer
                  host:
                    type: string
                  value:
                    type: string
                additionalProperties: false
          additionalProperties: false
          readOnly: true
      additionalProperties: false
    error:
      type: object
      properties:
        status:
          type: integer
        message:
          type: string
        code:
          type: string
        details:
          type: object
        id:
          type: string
      additionalProperties: false
    link:
      type: object
      properties:
        rel:
          type: string
        href:
          type: string
      additionalProperties: false
  securitySchemes:
    serviceAccountKey:
      type: apiKey
      in: header
      name: Authorization
      description: Service account key can be used as API keys
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: IDP-provided token

````