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

# Log Conversion

> This endpoint allows a client to log a conversion event for a specific contact within an organisation.
It checks if the contact exists in the organisation before logging the conversion in the background.

### Body Parameters

- `conversion` (`SubmitConversionV2`): JSON object containing the conversion event details such as contact info and conversion type.

### Authentication

- This endpoint requires a valid API key associated with the organisation to be passed via the request headers.

### Response

- **202 Accepted**: If the conversion event is successfully queued for logging in the background.
- **200 OK**: If the contact is not associated with the organisation, no conversion is logged, but the request is acknowledged.
- **401 Unauthorized**: If the API key is invalid or missing, access is denied.

### Example Usage

```bash
curl -X POST "https://services.meetchase.ai/api/v2/conversions"
    -H "X-API-Key: <YOUR_API_KEY>"
    -d '{
        "email": "user@example.com",
        "conversion_type": "purchase",
        "conversion_data": {
            "item": "premium_subscription",
            "price": 99.99
        }
    }'
```



## OpenAPI

````yaml POST /api/v2/conversions
openapi: 3.1.0
info:
  title: ChaseLabs API
  version: 0.1.0
servers:
  - url: https://services.meetchase.ai
security: []
paths:
  /api/v2/conversions:
    post:
      tags:
        - Public API Routes
        - Conversion Routes
      summary: Insert Conversion V2
      description: >-
        This endpoint allows a client to log a conversion event for a specific
        contact within an organisation.

        It checks if the contact exists in the organisation before logging the
        conversion in the background.


        ### Body Parameters


        - `conversion` (`SubmitConversionV2`): JSON object containing the
        conversion event details such as contact info and conversion type.


        ### Authentication


        - This endpoint requires a valid API key associated with the
        organisation to be passed via the request headers.


        ### Response


        - **202 Accepted**: If the conversion event is successfully queued for
        logging in the background.

        - **200 OK**: If the contact is not associated with the organisation, no
        conversion is logged, but the request is acknowledged.

        - **401 Unauthorized**: If the API key is invalid or missing, access is
        denied.


        ### Example Usage


        ```bash

        curl -X POST "https://services.meetchase.ai/api/v2/conversions"
            -H "X-API-Key: <YOUR_API_KEY>"
            -d '{
                "email": "user@example.com",
                "conversion_type": "purchase",
                "conversion_data": {
                    "item": "premium_subscription",
                    "price": 99.99
                }
            }'
        ```
      operationId: insert_conversion_v2_api_v2_conversions_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitConversionV2'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - API Key: []
components:
  schemas:
    SubmitConversionV2:
      properties:
        email:
          type: string
          format: email
          title: Email
          description: The email address of the person or entity tied to the conversion.
        conversion_type:
          anyOf:
            - type: string
              maxLength: 63
            - type: 'null'
          title: Conversion Type
          description: >-
            An optional short descriptive string to identify the type of
            conversion. This field is useful when tracking different conversion
            types, e.g., 'Sign-up', 'Purchase'. Max length is 63 characters.
          example: sign-up
        conversion_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Conversion Data
          description: >-
            Optional JSON object that can hold additional data related to the
            conversion, if required.
      type: object
      required:
        - email
      title: SubmitConversionV2
      description: >-
        This model is used when submitting a new conversion event, such as when
        a user signs up or makes a purchase.


        - `email` (`str`): The email address of the individual or entity
        associated with the conversion event.

        - `conversion_type` (`str`, _optional_): An optional string representing
        the type of conversion. This field is useful when tracking different
        conversion types, e.g., 'Sign-up', 'Purchase'. Max length is 63
        characters.

        - `conversion_data` (`dict`, _optional_): An optional JSON/dict object
        that contains any additional optional data tied to the conversion event,
        if required.


        #### Example Usage


        ```json

        {
            "email": "hazel@example.com"
            "conversion_type": "sign-up",
            "conversion_data": {
                "product": "premium-subscription",
                "price": 99.99
            }
        }

        ```
      examples:
        - conversion_data:
            price: 99.99
            product: premium-subscription
          conversion_type: sign-up
          email: user@example.com
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    API Key:
      type: apiKey
      description: Key used to authenticate user API requests.
      in: header
      name: X-API-Key

````