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

---
id: e60706c6-b511-4655-afed-611f055b1a03
---

# End an active A/B test

> End an A/B test for a landing page in your HubSpot account. This operation finalizes the test and applies the winning variation, if applicable. Use this endpoint when you want to conclude an A/B test and implement the results.

> [accordion] Supported products

> [accordion] Required Scopes


## OpenAPI

````yaml specs/2027-03-beta/cms-pages-v2027-03-beta.json POST /cms/pages/2027-03-beta/landing-pages/ab-test/end
openapi: 3.0.1
info:
  title: CMS Pages
  description: Basepom for all HubSpot Projects
  version: 2027-03-beta
  x-hubspot-product-tier-requirements:
    marketing: FREE
    sales: FREE
    service: FREE
    cms: FREE
    commerce: FREE
    crmHub: FREE
    dataHub: FREE
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Advanced
  - name: Basic
  - name: Batch
paths:
  /cms/pages/2027-03-beta/landing-pages/ab-test/end:
    post:
      tags:
        - Advanced
      summary: End AB Test
      description: >-
        End an A/B test for a landing page in your HubSpot account. This
        operation finalizes the test and applies the winning variation, if
        applicable. Use this endpoint when you want to conclude an A/B test and
        implement the results.
      operationId: >-
        post-/cms/pages/2027-03-beta/landing-pages/ab-test/end_/cms/pages/2027-03-beta/landing-pages/ab-test/end
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AbTestEndRequestVNext'
        required: true
      responses:
        '204':
          description: No content
          content: {}
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - content
components:
  schemas:
    AbTestEndRequestVNext:
      required:
        - abTestId
        - winnerId
      type: object
      properties:
        abTestId:
          type: string
          description: The unique identifier for the A/B test that is being ended.
        winnerId:
          type: string
          description: >-
            The unique identifier for the variation that is selected as the
            winner of the A/B test.
    Error:
      required:
        - category
        - correlationId
        - message
      type: object
      properties:
        category:
          type: string
          description: A string representing the general category of the error.
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >-
            A map containing additional context or metadata related to the
            error.
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: >-
            A string that serves as a unique identifier for the request, useful
            for tracking and debugging.
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: An array of objects detailing specific errors that occurred.
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: >-
            An array of objects providing URLs to related resources or
            documentation about the error.
        message:
          type: string
          description: A string providing a human-readable description of the error.
          example: An error occurred
        subCategory:
          type: string
          description: >-
            A string providing a more specific classification of the error
            within its category.
      description: >-
        Represents an error response returned by the API when an operation
        fails. This component is used in various endpoints to provide detailed
        information about the error encountered.
      example:
        message: Invalid input (details will vary based on the error)
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        category: VALIDATION_ERROR
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
    ErrorDetail:
      required:
        - message
      type: object
      properties:
        code:
          type: string
          description: A specific code representing the type of error.
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >-
            Additional context or parameters related to the error, often
            provided as a map of key-value pairs.
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: >-
            The location in the request where the error occurred, such as
            'query' or 'body'.
        message:
          type: string
          description: A descriptive message explaining the error.
        subCategory:
          type: string
          description: >-
            A more specific classification of the error within a broader
            category.
      description: >-
        Represents detailed information about an error that occurred in the API.
        This component is used to provide additional context and specifics about
        errors, typically as part of an error response.
  responses:
    Error:
      description: An error occurred.
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          tokenUrl: https://api.hubapi.com/oauth/v1/token
          scopes:
            cms.pages.landing_pages.read: ''
            cms.pages.site_pages.read: ''
            content: ''
            marketplace_validation: ''
      x-hubspot-app-availability:
        cms.pages.landing_pages.read:
          user:
            - public
            - private
          developer: true
        cms.pages.site_pages.read:
          user:
            - public
            - private
          developer: true
        content:
          portal:
            - public
            - private
          developer: false
        marketplace_validation:
          developer: true

````