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

# Collect user behavior events

> Endpoint for collecting user behavior events.



## OpenAPI

````yaml https://swish.app/api/2026-07/.well-known/openapi post /collect
openapi: 3.0.0
info:
  title: Swish API
  description: >-
    The Swish API provides endpoints for managing profiles, lists, items,
    subscriptions, notifications, orders, etc. All endpoints require
    authentication using a Bearer token. Responses follow a consistent structure
    with a `data` wrapper for successful responses and standardized error
    formats.
  version: 2026-07
  contact: {}
servers:
  - url: https://swish.app/api/2026-07
security: []
tags: []
paths:
  /collect:
    post:
      tags:
        - Tracking
      summary: Collect user behavior events
      description: Endpoint for collecting user behavior events.
      operationId: TrackingController_collect
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrackingEventRequest'
      responses:
        '204':
          description: Event tracked successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: Validation failed
                              error:
                                type: string
                                example: Bad Request
                              statusCode:
                                type: number
                                example: 400
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: Failed to authenticate request
                              error:
                                type: string
                                example: Unauthorized
                              statusCode:
                                type: number
                                example: 401
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: >-
                                  You do not have permission to access this
                                  resource
                              error:
                                type: string
                                example: Forbidden
                              statusCode:
                                type: number
                                example: 403
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: The requested resource was not found
                              error:
                                type: string
                                example: Not Found
                              statusCode:
                                type: number
                                example: 404
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: An unexpected error occurred
                              error:
                                type: string
                                example: Internal Server Error
                              statusCode:
                                type: number
                                example: 500
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
      security:
        - bearer: []
        - Swish API key: []
components:
  schemas:
    TrackingEventRequest:
      type: object
      properties:
        evn:
          type: string
          description: Event name
          example: add_to_wishlist
        ccy:
          type: string
          description: Currency code
          example: USD
        val:
          type: number
          description: Monetary value associated with the event
          example: 29.99
        tid:
          type: string
          description: Transaction ID
          example: txn_abc123
        chn:
          type: string
          description: Channel
          example: Website
        sur:
          type: string
          description: Surface where the event occurred
          example: Swish Drawer
        cnt:
          type: string
          description: Content section
          example: Recently saved
        cmp:
          type: string
          description: Campaign identifier
          example: summer_sale_2025
        mct:
          type: string
          description: Market context type
          example: country
        mcv:
          type: string
          description: Market context value
          example: US
        lng:
          type: string
          description: Language code
          example: en
        pls:
          type: string
          description: Product list ID (Shopify collection ID)
          example: gid://shopify/Collection/123456
        pln:
          type: string
          description: Product list name
          example: Summer Collection
        lid:
          type: string
          description: Swish list ID
          example: 67a61d5561e4f9de302c02a1
        lnm:
          type: string
          description: Swish list name
          example: My Favorites
        src:
          type: string
          description: Source of the event
          example: product
        itm:
          description: Array of items associated with the event
          type: array
          items:
            $ref: '#/components/schemas/TrackingEventItem'
      required:
        - evn
    ErrorResponse:
      type: object
      properties:
        error:
          description: Error details
          allOf:
            - $ref: '#/components/schemas/Error'
      required:
        - error
    Error:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Something went wrong
        error:
          type: string
          description: The error type
          example: Not Found
        statusCode:
          type: number
          description: The HTTP status code of the error
          example: 404
        requestId:
          type: string
          description: The ID of the request that caused the error
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - message
        - error
        - statusCode
        - requestId
    TrackingEventItem:
      type: object
      properties:
        iid:
          type: string
          description: Swish item ID
          example: 67a61d5561e4f9de302c02a1
        pid:
          type: string
          description: Product ID
          example: '123456789'
        pnm:
          type: string
          description: Product name
          example: Classic T-Shirt
        pvi:
          type: string
          description: Product variant ID
          example: '987654321'
        pvn:
          type: string
          description: Product variant name
          example: Large / Blue
        ven:
          type: string
          description: Vendor name
          example: Nike
        img:
          type: string
          description: Image URL
          example: https://cdn.shopify.com/image.jpg
        sku:
          type: string
          description: Variant SKU
          example: SKU-12345
        pcg:
          type: string
          description: Product taxonomy category
          example: Apparel & Accessories > Clothing > Shirts
        pty:
          type: string
          description: Product type
          example: T-Shirt
        pli:
          type: number
          description: Product list index/position
          example: 0
        cpn:
          type: string
          description: Coupon code
          example: SUMMER20
        prc:
          type: number
          description: Price
          example: 29.99
        cap:
          type: number
          description: Compare at price
          example: 39.99
        qty:
          type: number
          description: Quantity
          example: 1
        dsc:
          type: number
          description: Discount amount
          example: 10
  securitySchemes:
    Swish API key:
      scheme: Bearer
      bearerFormat: JWT
      type: http
      description: Enter your JWT token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.