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

# Update test cohort

> Update an existing test cohort.



## OpenAPI

````yaml /v2/buyer-api-v2.yaml put /advertisers/{advertiserId}/test-cohorts/{cohortId}
openapi: 3.0.0
info:
  title: Scope3 Buyer API
  version: 2.0.0
  description: |-
    REST API for advertisers to manage advertisers, campaigns, and reporting.

    ## Authentication

    All endpoints require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer your-api-key
    ```

    ## Base URL

    `https://api.interchange.io/api/v2/buyer`

    ## For AI Agents

    AI agents can use the MCP endpoint at `/mcp/v2/buyer` with three tools:
    - `initialize`: Start an MCP session
    - `api_call`: Make REST API calls
    - `ask_about_capability`: Learn about API features
servers:
  - url: https://api.interchange.io/api/v2/buyer
    description: Production server
security: []
tags:
  - name: Signup
    description: Request reviewed access to Interchange
  - name: Account
    description: Account management, service tokens, and preferences
  - name: Asks
    description: >-
      What you are waiting on Scope3 for — support, product, and supply asks in
      one list
  - name: Advertisers
    description: Manage advertisers
  - name: Product Discovery
    description: Discover and select products
  - name: Campaigns
    description: Manage advertising campaigns
  - name: Creatives
    description: Build, manage, and sync campaign creatives via AdCP Creative Protocol
  - name: Reporting
    description: Access performance metrics
  - name: Event Sources
    description: >-
      Manage event source configurations and log conversion/marketing events for
      attribution
  - name: Property Lists
    description: Validate property lists against AAO registry
  - name: Sales Agents
    description: View and connect sales agents
  - name: Measurement
    description: Measurement sources, records, context, and freshness
  - name: Syndication
    description: Syndicate resources to ADCP agents
  - name: Tasks
    description: Track async operation status
  - name: Buyer Billing
    description: >-
      Consolidated invoicing for buyers — invoices and pending invoice items
      issued by Scope3 across the buyer customer.
  - name: MCP
    description: Model Context Protocol endpoints for AI agents
paths:
  /advertisers/{advertiserId}/test-cohorts/{cohortId}:
    put:
      tags:
        - Measurement
      summary: Update test cohort
      description: Update an existing test cohort.
      operationId: updateTestCohort
      parameters:
        - in: path
          name: cohortId
          schema:
            description: Unique identifier for the test cohort
            example: cohort_abc123
            type: string
            minLength: 1
          required: true
          description: Unique identifier for the test cohort
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTestCohortInput'
      responses:
        '200':
          description: Update test cohort
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestCohortResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateTestCohortInput:
      description: Request body for updating a test cohort (all fields optional)
      type: object
      properties:
        name:
          description: Updated name of the test cohort
          example: West Coast Treatment Group - Updated
          type: string
          minLength: 1
          maxLength: 255
        description:
          description: Updated description of the test cohort
          type: string
          maxLength: 1000
        cohortType:
          description: Updated type classification for the cohort
          type: string
          minLength: 1
        role:
          description: Updated role of the cohort in the test
          type: string
          enum:
            - TREATMENT
            - CONTROL
            - OBSERVATION
        definition:
          description: Updated cohort targeting definition
          allOf:
            - $ref: '#/components/schemas/CohortDefinition'
        estimatedSize:
          description: Updated estimated number of users in this cohort
          type: integer
          minimum: 0
          maximum: 9007199254740991
    TestCohortResponse:
      description: Response containing a single test cohort
      type: object
      properties:
        cohort:
          $ref: '#/components/schemas/TestCohortOutput'
      required:
        - cohort
      additionalProperties: false
    ErrorResponse:
      description: Standard error response
      type: object
      properties:
        data:
          type: string
          nullable: true
          enum:
            - null
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - data
        - error
      additionalProperties: false
    CohortDefinition:
      description: >-
        Flexible definition for cohort targeting criteria. Type is required,
        additional fields vary by type.
      type: object
      properties:
        type:
          description: >-
            Type of cohort definition (e.g., "zip_code", "user_segment",
            "geo_region", "custom")
          example: zip_code
          type: string
          minLength: 1
      required:
        - type
      additionalProperties: {}
    TestCohortOutput:
      description: Test cohort resource representation
      type: object
      properties:
        id:
          description: Unique identifier for the test cohort
          example: cohort_abc123
          type: string
        advertiserId:
          description: Advertiser ID that owns this cohort
          example: '12345'
          type: string
        name:
          description: Name of the test cohort
          example: West Coast Treatment Group
          type: string
        description:
          description: Description of the test cohort
          type: string
        cohortType:
          description: Type classification for the cohort
          example: geographic
          type: string
        role:
          description: Role of the cohort in the test
          type: string
          enum:
            - TREATMENT
            - CONTROL
            - OBSERVATION
        definition:
          description: Cohort targeting definition
          allOf:
            - $ref: '#/components/schemas/CohortDefinition'
        estimatedSize:
          description: Estimated number of users in this cohort
          example: 50000
          type: integer
          minimum: 0
          maximum: 9007199254740991
        isActive:
          description: Whether the cohort is currently active
          type: boolean
        createdAt:
          description: When the cohort was created (ISO 8601)
          example: '2025-01-15T10:30:00Z'
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        updatedAt:
          description: When the cohort was last updated (ISO 8601)
          example: '2025-01-20T14:45:00Z'
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - advertiserId
        - name
        - cohortType
        - role
        - definition
        - isActive
        - createdAt
        - updatedAt
      additionalProperties: false
    ApiError:
      description: Structured error object
      type: object
      properties:
        code:
          description: Machine-readable error code
          type: string
        message:
          description: Human-readable error message
          type: string
        field:
          description: Field path associated with the error
          type: string
        details:
          description: Additional error context
          type: object
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or access token

````