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

# [Beta] Report Link Users

> Use the `/events/beta/link-users` endpoint to report to Topsort linked opaque user IDs.
This endpoint allows linking two opaque user IDs for attribution purposes. The `from` field represents the original opaque user ID, and the `to` field represents the target opaque user ID to be linked. The request will fail if the `from` and `to` opaque user IDs are the same.
Contact your sales representative to gain access to this endpoint and start using it.




## OpenAPI

````yaml /openapi.json post /v2/events/beta/link-users
openapi: 3.1.0
info:
  title: Topsort Endpoints v2 API Reference
  description: >
    In order for a storefront to be able to run auctions in Topsort and report
    auction-related events back to Topsort,

    both the `/v2/auctions` and `/v2/events` endpoints must be integrated.

    Below are the endpoint and model definitions for each.
  contact:
    email: wicha@topsort.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  x-logo:
    url: https://assets.topsort.com/Topsort_logo_icon_dark.svg
    backgroundColor: '#fff'
    altText: Topsort
  version: 2.0.0
servers:
  - url: https://api.topsort.com
    description: Base API URL
security: []
tags:
  - name: Auctions
    description: >-
      An auction determines which products should be promoted based on the
      vendors' bids.
  - name: Events
    description: >-
      Events are sent to Topsort as part of the attribution and reporting
      journey.
  - name: Toptimize
    description: >
      An out-of-the-box solution for prediction, ranking, retrieval, and other
      elements of ad selection.
  - name: Toppie API
    description: Toppie management API.
  - name: Campaign API
    description: Full-featured campaign management API for banners and sponsored listings.
  - name: Catalog API
    description: Products catalog management API.
  - name: Billing API
    description: Marketplace and Vendor Billing management API.
  - name: Reporting API
    description: Marketplace, Vendor, Campaign, and product reporting API.
  - name: Invitation API
    description: Vendor invitations management API.
  - name: User API
    description: User management API.
  - name: Webhooks API
    description: Webhooks API that allows event-driven automation.
  - name: Assets API
    description: Assets management API.
  - name: Segments Service
    description: Segments Service.
  - name: Forecasting Service
    description: Toptimize Forecasting Service.
  - name: Offsite Ads API
    description: Offsite Ads API that allows to manage offsite ads campaigns.
  - name: Media API
    description: Ad configuration API.
paths:
  /v2/events/beta/link-users:
    post:
      tags:
        - Events
      summary: '[Beta] Report Link Users'
      description: >
        Use the `/events/beta/link-users` endpoint to report to Topsort linked
        opaque user IDs.

        This endpoint allows linking two opaque user IDs for attribution
        purposes. The `from` field represents the original opaque user ID, and
        the `to` field represents the target opaque user ID to be linked. The
        request will fail if the `from` and `to` opaque user IDs are the same.

        Contact your sales representative to gain access to this endpoint and
        start using it.
      operationId: linkUsers
      requestBody:
        description: Request to link multiple user IDs that represent the same user.
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  description: The opaque user ID of the original user account.
                  minLength: 1
                  maxLength: 64
                  examples:
                    - user_abc123
                to:
                  type: string
                  description: The opaque user ID of the target user account to be linked.
                  minLength: 1
                  maxLength: 64
                  examples:
                    - user_xyz789
              required:
                - from
                - to
            examples:
              default:
                value:
                  from: user123
                  to: user456
        required: true
      responses:
        '204':
          description: Users account link was reported successfully.
        '400':
          $ref: '#/components/responses/Topsort_Endpoints_v2_API_Reference_BadRequest'
        '401':
          $ref: >-
            #/components/responses/Topsort_Endpoints_v2_API_Reference_UnauthorizedError
      security:
        - Topsort_Endpoints_v2_API_Reference_HTTPBearer: []
components:
  responses:
    Topsort_Endpoints_v2_API_Reference_BadRequest:
      description: HTTP status codes as registered with IANA.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Topsort_Endpoints_v2_API_Reference_Error'
    Topsort_Endpoints_v2_API_Reference_UnauthorizedError:
      description: Access token is missing or invalid
  schemas:
    Topsort_Endpoints_v2_API_Reference_Error:
      description: >-
        Error response object containing error code, message, and documentation
        URL.
      type: object
      required:
        - errCode
      properties:
        errCode:
          type: string
          description: A short string uniquely identifying the problem.
          enum:
            - bad_request
            - empty_request
            - internal_server_error
            - invalid_api_key
            - invalid_auction_id
            - invalid_demand_source
            - invalid_event_type
            - invalid_external_bid
            - invalid_external_demand_ad_type
            - invalid_promotion_type
            - invalid_session
            - missing_auctions
            - missing_context
            - missing_placement
            - missing_product_id
            - missing_promotion_type
            - missing_purchased_at
            - missing_session
            - missing_slot_id
            - missing_slots
            - no_products
            - no_purchase_items
            - purchase_item_quantity_less_or_equal_than_zero
            - resolved_bid_id_not_found
            - too_few_impressions
            - too_few_slots
            - too_many_auctions
            - too_many_external_bids
            - unauthorized_external_demand
          examples:
            - bad_request
            - no_products
        docUrl:
          type: string
          format: uri
          description: >-
            A link to a documentation page providing more information about the
            error.
          examples:
            - https://api.docs.topsort.com/reference/errors
        message:
          type: string
          description: >
            Human-readable explanation of or details about the error. The string
            for a given error may change over time; code should not parse or
            dispatch based on particular values for this field.
          examples:
            - could not find the provided resolved bid id
  securitySchemes:
    Topsort_Endpoints_v2_API_Reference_HTTPBearer:
      description: >-
        A valid API key generated in Topsort's UI. Use a TSE API key for calls
        to Auctions or Events API.
      scheme: bearer
      type: http

````