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

# Validate a custom domain for several services

> Run the checks of a custom domain creation or edit for several services, without saving anything.
Returns every conflict, not only the first one. The services of the body are checked against each other as well as against the existing domains.
It takes no lock: a later creation can still fail if the domains change meanwhile.
A service outside the environment returns a 403.




## OpenAPI

````yaml /api-reference/openapi.yaml post /environment/{environmentId}/customDomain/validate
openapi: 3.0.0
info:
  version: 1.0.4
  title: Qovery API
  description: >
    - Qovery is the fastest way to deploy your full-stack apps on any Cloud
    provider.

    - ℹ️ The API is stable and still in development.
  contact:
    name: Qovery Product Team
    url: https://www.qovery.com
    email: support+api+documentation@qovery.com
  x-logo:
    url: https://console.qovery.com/assets/logos/logo-white.svg
    altText: Qovery
servers:
  - url: https://api.qovery.com
security:
  - bearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: Account
  - name: Account Info
  - name: IPs
  - name: Alert Receivers
  - name: Alert Rules
  - name: Admin
  - name: ArgoCD
  - name: Agentic Workflows
  - name: Application
  - name: Application Actions
  - name: Application Build Analysis
  - name: Application Configuration
  - name: Application Database
  - name: Application Deployment Restriction
  - name: Application Deployment History
  - name: Application Environment Variable
  - name: Application Logs
  - name: Application Main Calls
  - name: Application Secret
  - name: Application Annotations Group
  - name: Applications
  - name: AutoscalingPolicy
  - name: Container
  - name: Container Actions
  - name: Container Configuration
  - name: Container Database
  - name: Container Deployment History
  - name: Container Environment Variable
  - name: Container Logs
  - name: Container Main Calls
  - name: Container Registry
  - name: Container Secret
  - name: Container Annotations Group
  - name: Containers
  - name: Deployment Stage Main Calls
  - name: Job
  - name: Job Actions
  - name: Job Build Analysis
  - name: Job Configuration
  - name: Job Database
  - name: Job Deployment Restriction
  - name: Job Deployment History
  - name: Job Environment Variable
  - name: Job Logs
  - name: Job Main Calls
  - name: Job Registry
  - name: Job Secret
  - name: Job Annotations Group
  - name: Jobs
  - name: KedaTriggerAuthentication
  - name: Helm
  - name: Helm Actions
  - name: Helm Configuration
  - name: Helm Database
  - name: Helm Deployment Restriction
  - name: Helm Deployment History
  - name: Helm Logs
  - name: Helm Main Calls
  - name: Helm Repository
  - name: Helms
  - name: Backups
  - name: Billing
  - name: Blueprint Catalog
  - name: Cloud Provider
  - name: Cloud Provider Credentials
  - name: Clusters
  - name: Cluster Deployment History
  - name: Cluster Operator
  - name: Platform Configuration
  - name: Custom Domain
  - name: Container Custom Domain
  - name: LLM Providers
  - name: MCP Servers
  - name: Database
  - name: Database Actions
  - name: Database Application
  - name: Database Container
  - name: Database Deployment History
  - name: Database Main Calls
  - name: Database Annotations Group
  - name: Databases
  - name: Environment
  - name: Environment Actions
  - name: Environment Custom Domain
  - name: Environment Deployment History
  - name: Environment Deployment Rule
  - name: Environment Logs
  - name: Environment Main Calls
  - name: Environment Secret
  - name: Environment Variable
  - name: Environments
  - name: Git
  - name: Github App
  - name: Git repositories
  - name: Members
  - name: Organization
  - name: Organization Account Git Repositories
  - name: Organization Cluster Lock
  - name: Organization Main Calls
  - name: Organization Custom Role
  - name: Organization Custom Domain
  - name: Organization Event
  - name: Organization Api Token
  - name: Organization Policy Api Token
  - name: Organization Webhook
  - name: Organization Annotations Group
  - name: Organization Labels Group
  - name: Organization Enterprise Connection
  - name: Project
  - name: Project Deployment Rule
  - name: Project Environment Variable
  - name: Project Main Calls
  - name: Project Secret
  - name: Projects
  - name: Referral & Rewards
  - name: Secret Manager Access
  - name: Terraforms
  - name: Terraform Main Calls
  - name: Terraform Resources
  - name: Terraform Deployment History
  - name: Terraform Deployment Restriction
  - name: Container Registries
  - name: Helm Repositories
  - name: User Sign Up
  - name: Variable Main Calls
  - name: Helm Custom Domain
  - name: Lifecycle Template Main Calls
  - name: Blueprint Main Calls
paths:
  /environment/{environmentId}/customDomain/validate:
    post:
      tags:
        - Environment Custom Domain
      summary: Validate a custom domain for several services
      description: >
        Run the checks of a custom domain creation or edit for several services,
        without saving anything.

        Returns every conflict, not only the first one. The services of the body
        are checked against each other as well as against the existing domains.

        It takes no lock: a later creation can still fail if the domains change
        meanwhile.

        A service outside the environment returns a 403.
      operationId: validateEnvironmentCustomDomain
      parameters:
        - $ref: '#/components/parameters/environmentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomDomainValidationRequest'
      responses:
        '200':
          description: >-
            The conflicts of the request. An empty `errors` list means the
            domain can be saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomDomainErrorsResponse'
        '400':
          $ref: '#/components/responses/CustomDomainConflict'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
components:
  parameters:
    environmentId:
      name: environmentId
      in: path
      description: Environment ID
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    CustomDomainValidationRequest:
      allOf:
        - $ref: '#/components/schemas/EnvironmentCustomDomainRequest'
        - type: object
          properties:
            original_domain:
              type: string
              nullable: true
              description: >-
                The current name of a domain being edited, so the rows the
                services hold for it are ignored. Null or absent for a new
                domain.
              example: old.domain.tld
    CustomDomainErrorsResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          description: Every conflict of the request. Empty when the domain can be saved.
          items:
            $ref: '#/components/schemas/CustomDomainErrorResponse'
    EnvironmentCustomDomainRequest:
      type: object
      description: The full state of a custom domain name of an environment.
      required:
        - domain
        - services
      properties:
        domain:
          type: string
          description: The domain name.
          example: my.domain.tld
        generate_certificate:
          type: boolean
          default: true
          description: >-
            Whether Qovery generates a certificate for the domain. Set it to
            `false` when a CDN or another party manages the certificate.
        use_cdn:
          type: boolean
          default: false
          description: >-
            Whether the domain is behind a CDN. If `true`, Qovery only checks
            that the domain points to an IP; otherwise it checks that the domain
            resolves to the service load balancer.
        services:
          type: array
          description: >-
            Every service the domain routes to, each with one `/` route served
            by its default port. Between 1 and 50 services; more than one only
            when the environment `routing_capabilities.can_share` is `true`.
          minItems: 1
          maxItems: 50
          items:
            $ref: '#/components/schemas/CustomDomainServiceRequest'
    CustomDomainErrorResponse:
      type: object
      description: >-
        One reason a service cannot hold the custom domain, to show under the
        request field it blames.
      required:
        - code
        - field
        - path
        - service_id
        - conflicting_service
        - message
      properties:
        code:
          $ref: '#/components/schemas/CustomDomainErrorCodeEnum'
        field:
          type: string
          description: >-
            The request field to blame, named as on the wire, such as `domain`,
            `path`, `port_id`, `generate_certificate` or `use_cdn`.
          example: path
        path:
          type: string
          nullable: true
          description: The path in conflict. Null when the error is not about a path.
          example: /cable
        service_id:
          type: string
          format: uuid
          description: Id of the service of the request that cannot hold the domain.
        conflicting_service:
          allOf:
            - $ref: '#/components/schemas/CustomDomainServiceResponse'
          nullable: true
          description: >-
            The service of the same environment the domain conflicts with. Null
            when the conflict is with another environment, which the caller may
            not have access to.
        message:
          type: string
          description: A message to show to the user.
          example: /cable already goes to anycable on this domain.
    CustomDomainProblemResponse:
      type: object
      description: >-
        A problem detail (RFC 9457). `errors` is set when the custom domain
        conflicts with other domains.
      properties:
        type:
          type: string
        title:
          type: string
          example: Bad Request
        status:
          type: integer
          example: 400
        detail:
          type: string
          description: All the error messages, joined.
        instance:
          type: string
          description: The path of the request.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/CustomDomainErrorResponse'
    CustomDomainServiceRequest:
      type: object
      required:
        - id
        - type
      properties:
        id:
          type: string
          format: uuid
          description: Id of the service. It must belong to the environment.
        type:
          allOf:
            - $ref: '#/components/schemas/ServiceTypeEnum'
          description: >-
            Type of the service. Only `APPLICATION`, `CONTAINER` and `HELM`
            services have custom domains.
    CustomDomainErrorCodeEnum:
      type: string
      description: >
        Why a service cannot hold the custom domain.

        * `PATH_ALREADY_ROUTED`: another service already routes this path on the
        domain.

        * `GRPC_HOSTNAME_SHARED`: a gRPC port would share the hostname; gRPC has
        no path selection.

        * `SETTINGS_MISMATCH`: `generate_certificate` or `use_cdn` differs from
        the other services on the domain.

        * `DOMAIN_IN_OTHER_ENVIRONMENT`: the name, or a hostname it serves, is
        already used in another environment of the organization.

        * `DOMAIN_ALREADY_ON_SERVICE`: the service already has this domain.

        * `ROUTING_MODE_NOT_SHAREABLE`: the domain is already used and the
        routing mode of the environment cannot share it.
      enum:
        - PATH_ALREADY_ROUTED
        - GRPC_HOSTNAME_SHARED
        - SETTINGS_MISMATCH
        - DOMAIN_IN_OTHER_ENVIRONMENT
        - DOMAIN_ALREADY_ON_SERVICE
        - ROUTING_MODE_NOT_SHAREABLE
    CustomDomainServiceResponse:
      type: object
      required:
        - id
        - type
        - name
      properties:
        id:
          type: string
          format: uuid
          description: Id of the service.
        type:
          allOf:
            - $ref: '#/components/schemas/ServiceTypeEnum'
          description: >-
            Type of the service. Only `APPLICATION`, `CONTAINER` and `HELM`
            services have custom domains.
        name:
          type: string
          description: Name of the service.
    ServiceTypeEnum:
      type: string
      x-stoplight:
        id: d66063cd29913
      description: type of the service (application, database, job, ...)
      enum:
        - APPLICATION
        - DATABASE
        - CONTAINER
        - JOB
        - HELM
        - TERRAFORM
        - ARGOCD_APP
        - AGENTIC_WORKFLOW
  responses:
    '401':
      description: Access token is missing or invalid
    '403':
      description: Access forbidden
    '404':
      description: Resource not found
    CustomDomainConflict:
      description: >-
        Bad request. When the custom domain conflicts with other domains,
        `errors` lists every conflict.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/CustomDomainProblemResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT tokens should be used with OIDC account (human to machine). JWT
        tokens used by the Qovery console to communicate with the API have a
        TTL. Curl Example ' curl https://console.qovery.com/organization -H
        "Authorization: Bearer $qovery_token" '
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Token API are generated by Qovery to manage machine to machine
        interaction and do not have a TTL. Curl Example ' curl
        https://console.qovery.com/organization -H "Authorization: Token
        $qovery_token" '

````

## Related topics

- [Create a custom domain for several services](https://www.qovery.com/docs/api-reference/environment-custom-domain/create-a-custom-domain-for-several-services.md)
- [Delete a custom domain of several services](https://www.qovery.com/docs/api-reference/environment-custom-domain/delete-a-custom-domain-of-several-services.md)
- [Edit a custom domain of several services](https://www.qovery.com/docs/api-reference/environment-custom-domain/edit-a-custom-domain-of-several-services.md)
- [Delete custom domains of several environments](https://www.qovery.com/docs/api-reference/organization-custom-domain/delete-custom-domains-of-several-environments.md)
- [Customizing Preview URL with Qovery CLI](https://www.qovery.com/docs/getting-started/guides/advanced-tutorials/customizing-preview-url-with-qovery-cli.md)


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