openapi: 3.0.1
servers:
  - url: https://api.hubapi.com
info:
  title: CMS Domains
  version: v3
  x-hubspot-api-use-case: Retrieve all currently connected domains to see which sites are live in a given account.
  x-hubspot-documentation-banner: NONE
  x-hubspot-introduction: Use the domain management API to return information about the domains connected to a HubSpot account. You can return data for all currently connected domains, or for a single domain by ID.
  x-hubspot-product-tier-requirements:
    cms: STARTER
    marketing: PROFESSIONAL
  x-hubspot-related-documentation:
    - name: Domains Guide
      url: https://hubspot.dev/guides/api/cms/domains
  x-logo:
    url: https://developers.hubspot.com/hubfs/assets/hubspot.com/buzz/HubSpotOpenGraph.png
  x-origin:
    - format: openapi
      url: https://api.hubspot.com/api-catalog-public/v1/apis/cms/v3/domains
      version: "3.0"
  x-providerName: hubapi.com
  x-serviceName: cms
tags:
  - name: Domains
paths:
  /cms/v3/domains/:
    get:
      description: Returns all existing domains that have been created. Results can be limited and filtered by creation or updated date.
      operationId: get-/cms/v3/domains/_getPage
      parameters:
        - description: Only return domains created at this date.
          explode: true
          in: query
          name: createdAt
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Only return domains created after this date.
          explode: true
          in: query
          name: createdAfter
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Only return domains created before this date.
          explode: true
          in: query
          name: createdBefore
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Only return domains updated at this date.
          explode: true
          in: query
          name: updatedAt
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Only return domains updated after this date.
          explode: true
          in: query
          name: updatedAfter
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - description: Only return domains updated before this date.
          explode: true
          in: query
          name: updatedBefore
          required: false
          schema:
            format: date-time
            type: string
          style: form
        - explode: true
          in: query
          name: sort
          required: false
          schema:
            items:
              type: string
            type: array
          style: form
        - description: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
          explode: true
          in: query
          name: after
          required: false
          schema:
            type: string
          style: form
        - description: Maximum number of results per page.
          explode: true
          in: query
          name: limit
          required: false
          schema:
            format: int32
            type: integer
          style: form
        - description: Whether to return only results that have been archived.
          explode: true
          in: query
          name: archived
          required: false
          schema:
            type: boolean
          style: form
      responses:
        "200":
          content:
            application/json:
              example:
                results:
                  - createdAt: 2017-07-24T17:24:09.141Z
                    domain: 234.hs-sites.com
                    expectedCname: 234.group34.sites.hubspot.net
                    id: "1234"
                    isHttpsEnabled: true
                    isHttpsOnly: false
                    isManuallyMarkedAsResolving: false
                    isPrimaryBlogPost: true
                    isPrimaryEmail: false
                    isPrimaryKnowledge: false
                    isPrimaryLandingPage: false
                    isPrimarySitePage: false
                    isResolving: true
                    isUsedForBlogPost: true
                    isUsedForEmail: false
                    isUsedForKnowledge: false
                    isUsedForLandingPage: false
                    isUsedForSitePage: false
                    redirectTo: ""
                    updatedAt: 2017-07-25T18:20:00.000Z
                  - createdAt: 2017-07-11T13:00:52.928Z
                    domain: test.demo.com
                    expectedCname: 234.group34.sites.hubspot.net
                    id: "4321"
                    isHttpsEnabled: true
                    isHttpsOnly: false
                    isManuallyMarkedAsResolving: false
                    isPrimaryBlogPost: true
                    isPrimaryEmail: false
                    isPrimaryKnowledge: false
                    isPrimaryLandingPage: false
                    isPrimarySitePage: false
                    isResolving: true
                    isUsedForBlogPost: true
                    isUsedForEmail: false
                    isUsedForKnowledge: false
                    isUsedForLandingPage: false
                    isUsedForSitePage: false
                    redirectTo: ""
                    updatedAt: 2019-10-08T16:54:57.165Z
                total: 2
              schema:
                $ref: "#/components/schemas/CollectionResponseWithTotalDomainForwardPaging"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2:
            - cms.domains.read
        - private_apps: []
        - private_apps: []
        - oauth2:
            - cms.domains.write
        - oauth2_legacy:
            - cms.knowledge_base.settings.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - cms.knowledge_base.settings.write
        - oauth2_legacy:
            - content
        - private_apps_legacy: []
      summary: Get current domains
      tags:
        - Domains
  /cms/v3/domains/{domainId}:
    get:
      description: Returns a single domains with the id specified.
      operationId: get-/cms/v3/domains/{domainId}_getById
      parameters:
        - description: The unique ID of the domain.
          explode: false
          in: path
          name: domainId
          required: true
          schema:
            type: string
          style: simple
      responses:
        "200":
          content:
            application/json:
              example:
                createdAt: 2017-07-11T13:00:52.928Z
                domain: 99558489.hubspot.com
                expectedCname: 99558489.group39.sites.hubspotqa.net
                id: "3210329704"
                isHttpsEnabled: true
                isHttpsOnly: false
                isManuallyMarkedAsResolving: false
                isPrimaryBlogPost: true
                isPrimaryEmail: false
                isPrimaryKnowledge: false
                isPrimaryLandingPage: false
                isPrimarySitePage: false
                isResolving: true
                isUsedForBlogPost: true
                isUsedForEmail: false
                isUsedForKnowledge: false
                isUsedForLandingPage: false
                isUsedForSitePage: false
                redirectTo: ""
                updatedAt: 2019-10-08T16:54:57.165Z
              schema:
                $ref: "#/components/schemas/Domain"
          description: successful operation
        default:
          $ref: "#/components/responses/Error"
      security:
        - private_apps_legacy: []
        - oauth2:
            - cms.domains.read
        - private_apps: []
        - private_apps: []
        - oauth2:
            - cms.domains.write
        - oauth2_legacy:
            - cms.knowledge_base.settings.read
        - private_apps_legacy: []
        - oauth2_legacy:
            - cms.knowledge_base.settings.write
        - oauth2_legacy:
            - content
        - private_apps_legacy: []
      summary: Get a single domain
      tags:
        - Domains
components:
  responses:
    Error:
      content:
        "*/*":
          schema:
            $ref: "#/components/schemas/Error"
      description: An error occurred.
  schemas:
    CollectionResponseWithTotalDomainForwardPaging:
      properties:
        paging:
          $ref: "#/components/schemas/ForwardPaging"
        results:
          items:
            $ref: "#/components/schemas/Domain"
          type: array
        total:
          format: int32
          type: integer
      required:
        - results
        - total
      type: object
    Domain:
      properties:
        correctCname:
          type: string
        created:
          format: date-time
          type: string
        domain:
          description: The actual domain or sub-domain. e.g. www.hubspot.com
          type: string
        id:
          description: The unique ID of this domain.
          type: string
        isResolving:
          description: Whether the DNS for this domain is optimally configured for use with HubSpot.
          type: boolean
        isSslEnabled:
          type: boolean
        isSslOnly:
          type: boolean
        isUsedForBlogPost:
          description: Whether the domain is used for CMS blog posts.
          type: boolean
        isUsedForEmail:
          description: Whether the domain is used for CMS email web pages.
          type: boolean
        isUsedForKnowledge:
          description: Whether the domain is used for CMS knowledge pages.
          type: boolean
        isUsedForLandingPage:
          description: Whether the domain is used for CMS landing pages.
          type: boolean
        isUsedForSitePage:
          description: Whether the domain is used for CMS site pages.
          type: boolean
        manuallyMarkedAsResolving:
          type: boolean
        primaryBlogPost:
          type: boolean
        primaryEmail:
          type: boolean
        primaryKnowledge:
          type: boolean
        primaryLandingPage:
          type: boolean
        primarySitePage:
          type: boolean
        secondaryToDomain:
          type: string
        updated:
          format: date-time
          type: string
      required:
        - domain
        - id
        - isResolving
        - isUsedForBlogPost
        - isUsedForEmail
        - isUsedForKnowledge
        - isUsedForLandingPage
        - isUsedForSitePage
      type: object
    Error:
      example:
        category: VALIDATION_ERROR
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
        message: Invalid input (details will vary based on the error)
      properties:
        category:
          description: The error category
          example: VALIDATION_ERROR
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            invalidPropertyName:
              - propertyValue
            missingScopes:
              - scope1
              - scope2
          type: object
        correlationId:
          description: A unique identifier for the request. Include this value with any error reports or support tickets
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
          format: uuid
          type: string
        errors:
          description: further information about the error
          items:
            $ref: "#/components/schemas/ErrorDetail"
          type: array
        links:
          additionalProperties:
            type: string
          description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps
          example:
            knowledge-base: https://www.hubspot.com/products/service/knowledge-base
          type: object
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          example: Invalid input (details will vary based on the error)
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - category
        - correlationId
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: The status code associated with the error detail
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            missingScopes:
              - scope1
              - scope2
          type: object
        in:
          description: The name of the field or parameter in which the error was found.
          type: string
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - message
      type: object
    ForwardPaging:
      properties:
        next:
          $ref: "#/components/schemas/NextPage"
      type: object
    NextPage:
      properties:
        after:
          type: string
        link:
          type: string
      required:
        - after
      type: object
  securitySchemes:
    oauth2:
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          scopes:
            cms.domains.read: Read domains.
            cms.domains.write: Create or update domains.
          tokenUrl: https://api.hubapi.com/oauth/v1/token
      type: oauth2
    oauth2_legacy:
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          scopes:
            cms.knowledge_base.settings.read: View knowledge base settings
            cms.knowledge_base.settings.write: Update knowledge base settings
            content: Read from and write to my Content
          tokenUrl: https://api.hubapi.com/oauth/v1/token
      type: oauth2
    private_apps:
      in: header
      name: private-app
      type: apiKey
    private_apps_legacy:
      in: header
      name: private-app-legacy
      type: apiKey
x-hubspot-available-client-libraries:
  - PHP
  - Node
  - Ruby
  - Python
x-hubspot-documentation-banner: NONE
x-hubspot-product-tier-requirements:
  cms: STARTER
  marketing: PROFESSIONAL
