openapi: 3.0.1
servers:
  - url: https://api.hubapi.com/
info:
  title: Domains
  version: v3
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/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:
  - description: Operations for fetching domains
    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: []
        - hapikey: []
        - private_apps: []
        - oauth2:
            - cms.domains.write
        - private_apps_legacy: []
        - oauth2_legacy:
            - cms.knowledge_base.settings.write
        - oauth2_legacy:
            - content
      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: []
        - hapikey: []
        - private_apps: []
        - oauth2:
            - cms.domains.write
        - private_apps_legacy: []
        - oauth2_legacy:
            - cms.knowledge_base.settings.write
        - oauth2_legacy:
            - content
      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
          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
          type: object
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          example: An error occurred
          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:
    hapikey:
      in: query
      name: hapikey
      type: apiKey
    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.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
  - Python
  - Ruby
