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

# Retrieve a list of events

> Retrieve a paginated list of events for the authenticated workspace.

<Note>
  Events endpoints require a [Business plan](https://codeqr.io/pricing)
  subscription or higher.
</Note>


## OpenAPI

````yaml get /events
openapi: 3.0.3
info:
  title: CodeQR.io API
  description: >-
    SaaS platform for creating dynamic QR Codes, trackable short links, and
    interactive pages, focused on automation, analytics, and engagement.
  version: 0.0.1
  contact:
    name: CodeQR.io Support
    email: contact@codeqr.io
    url: https://codeqr.io/api
  license:
    name: AGPL-3.0 license
servers:
  - url: https://api.codeqr.io
    description: Production API
security: []
paths:
  /events:
    get:
      tags:
        - Events
      summary: Retrieve a list of events
      description: Retrieve a paginated list of events for the authenticated workspace.
      operationId: listEvents
      parameters:
        - in: query
          name: event
          description: The type of event to retrieve analytics for. Defaults to 'clicks'.
          schema:
            type: string
            enum:
              - clicks
              - leads
              - sales
              - scans
              - views
            default: clicks
            description: The type of event to retrieve analytics for. Defaults to 'clicks'.
        - in: query
          name: domain
          description: The domain of the short link.
          schema:
            type: string
            description: The domain of the short link.
        - in: query
          name: key
          description: The short link slug.
          schema:
            type: string
            description: The short link slug.
        - in: query
          name: linkId
          description: The unique ID of the short link on CodeQR.
          schema:
            type: string
            description: The unique ID of the short link on CodeQR.
        - in: query
          name: qrcodeId
          description: The unique ID of the QR code on CodeQR.
          schema:
            type: string
            description: The unique ID of the QR code on CodeQR.
        - in: query
          name: pageId
          description: The unique ID of the page on CodeQR.
          schema:
            type: string
            description: The unique ID of the page on CodeQR.
        - in: query
          name: externalId
          description: >-
            This is the ID of the link in the your database. Must be prefixed
            with 'ext_' when passed as a query parameter.
          schema:
            type: string
            description: >-
              This is the ID of the link in the your database. Must be prefixed
              with 'ext_' when passed as a query parameter.
        - in: query
          name: interval
          description: >-
            The interval to retrieve events for. Takes precedence over start and
            end. If undefined, defaults to 24h.
          schema:
            type: string
            enum:
              - 24h
              - 7d
              - 30d
              - 90d
              - ytd
              - 1y
              - all
            default: 24h
            description: >-
              The interval to retrieve events for. Takes precedence over start
              and end. If undefined, defaults to 24h.
        - in: query
          name: start
          description: The start date and time when to retrieve analytics from.
          schema:
            type: string
            description: The start date and time when to retrieve analytics from.
        - in: query
          name: end
          description: >-
            The end date and time when to retrieve analytics from. If not
            provided, defaults to the current date.
          schema:
            type: string
            description: >-
              The end date and time when to retrieve analytics from. If not
              provided, defaults to the current date.
        - in: query
          name: timezone
          description: >-
            The IANA time zone code for aligning timeseries granularity (e.g.
            America/New_York). Defaults to UTC.
          schema:
            type: string
            description: >-
              The IANA time zone code for aligning timeseries granularity (e.g.
              America/New_York). Defaults to UTC.
            example: America/New_York
            default: UTC
        - in: query
          name: continent
          description: The continent to retrieve analytics for.
          schema:
            $ref: '#/components/schemas/continentCode'
        - in: query
          name: country
          description: The country to retrieve analytics for.
          schema:
            $ref: '#/components/schemas/countryCode'
        - in: query
          name: city
          description: The city to retrieve analytics for.
          schema:
            type: string
            description: The city to retrieve analytics for.
            example: New York
        - in: query
          name: device
          description: The device to retrieve analytics for.
          schema:
            type: string
            description: The device to retrieve analytics for.
            example: Desktop
        - in: query
          name: browser
          description: The browser to retrieve analytics for.
          schema:
            type: string
            description: The browser to retrieve analytics for.
            example: Chrome
        - in: query
          name: os
          description: The OS to retrieve analytics for.
          schema:
            type: string
            description: The OS to retrieve analytics for.
            example: Windows
        - in: query
          name: referer
          description: The referer to retrieve analytics for.
          schema:
            type: string
            description: The referer to retrieve analytics for.
            example: google.com
        - in: query
          name: url
          description: The URL to retrieve analytics for.
          schema:
            type: string
            description: The URL to retrieve analytics for.
        - in: query
          name: excludeRoot
          description: Whether to exclude the root link from the response.
          schema:
            type: boolean
            description: Whether to exclude the root link from the response.
        - in: query
          name: root
          description: >-
            Filter for root domains. If true, filter for domains only. If false,
            filter for links only. If undefined, return both.
          schema:
            type: boolean
            description: >-
              Filter for root domains. If true, filter for domains only. If
              false, filter for links only. If undefined, return both.
        - in: query
          name: tagId
          description: The tag ID to retrieve analytics for.
          schema:
            type: string
            description: The tag ID to retrieve analytics for.
        - in: query
          name: type
          description: The type of analytics to retrieve.
          schema:
            type: string
            description: The type of analytics to retrieve.
        - in: query
          name: types
          description: The types of analytics to retrieve.
          schema:
            type: string
            description: The types of analytics to retrieve.
        - in: query
          name: page
          schema:
            type: number
            default: 1
        - in: query
          name: limit
          schema:
            type: number
            default: 100
        - in: query
          name: order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - in: query
          name: sortBy
          schema:
            type: string
            enum:
              - timestamp
            default: timestamp
      responses:
        '200':
          description: A list of events
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/ClickEvent'
                    - $ref: '#/components/schemas/LeadEvent'
                    - $ref: '#/components/schemas/SaleEvent'
                  discriminator:
                    propertyName: event
                    mapping:
                      click: '#/components/schemas/ClickEvent'
                      lead: '#/components/schemas/LeadEvent'
                      sale: '#/components/schemas/SaleEvent'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '410':
          $ref: '#/components/responses/410'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      security:
        - token: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Codeqr from '@codeqr/ts';

            const client = new Codeqr({
              apiKey: process.env['CODEQR_API_KEY'], // This is the default and can be omitted
            });

            const events = await client.events.list();

            console.log(events);
components:
  schemas:
    continentCode:
      type: string
      enum:
        - AF
        - AN
        - AS
        - EU
        - NA
        - OC
        - SA
      description: The continent to retrieve analytics for.
    countryCode:
      type: string
      enum:
        - AF
        - AL
        - DZ
        - AS
        - AD
        - AO
        - AI
        - AQ
        - AG
        - AR
        - AM
        - AW
        - AU
        - AT
        - AZ
        - BS
        - BH
        - BD
        - BB
        - BY
        - BE
        - BZ
        - BJ
        - BM
        - BT
        - BO
        - BA
        - BW
        - BV
        - BR
        - IO
        - BN
        - BG
        - BF
        - BI
        - KH
        - CM
        - CA
        - CV
        - KY
        - CF
        - TD
        - CL
        - CN
        - CX
        - CC
        - CO
        - KM
        - CG
        - CD
        - CK
        - CR
        - CI
        - HR
        - CU
        - CY
        - CZ
        - DK
        - DJ
        - DM
        - DO
        - EC
        - EG
        - SV
        - GQ
        - ER
        - EE
        - ET
        - FK
        - FO
        - FJ
        - FI
        - FR
        - GF
        - PF
        - TF
        - GA
        - GM
        - GE
        - DE
        - GH
        - GI
        - GR
        - GL
        - GD
        - GP
        - GU
        - GT
        - GN
        - GW
        - GY
        - HT
        - HM
        - VA
        - HN
        - HK
        - HU
        - IS
        - IN
        - ID
        - IR
        - IQ
        - IE
        - IL
        - IT
        - JM
        - JP
        - JO
        - KZ
        - KE
        - KI
        - KP
        - KR
        - KW
        - KG
        - LA
        - LV
        - LB
        - LS
        - LR
        - LY
        - LI
        - LT
        - LU
        - MO
        - MG
        - MW
        - MY
        - MV
        - ML
        - MT
        - MH
        - MQ
        - MR
        - MU
        - YT
        - MX
        - FM
        - MD
        - MC
        - MN
        - MS
        - MA
        - MZ
        - MM
        - NA
        - NR
        - NP
        - NL
        - NC
        - NZ
        - NI
        - NE
        - NG
        - NU
        - NF
        - MK
        - MP
        - 'NO'
        - OM
        - PK
        - PW
        - PS
        - PA
        - PG
        - PY
        - PE
        - PH
        - PN
        - PL
        - PT
        - PR
        - QA
        - RE
        - RO
        - RU
        - RW
        - SH
        - KN
        - LC
        - PM
        - VC
        - WS
        - SM
        - ST
        - SA
        - SN
        - SC
        - SL
        - SG
        - SK
        - SI
        - SB
        - SO
        - ZA
        - GS
        - ES
        - LK
        - SD
        - SR
        - SJ
        - SZ
        - SE
        - CH
        - SY
        - TW
        - TJ
        - TZ
        - TH
        - TL
        - TG
        - TK
        - TO
        - TT
        - TN
        - TR
        - TM
        - TC
        - TV
        - UG
        - UA
        - AE
        - GB
        - US
        - UM
        - UY
        - UZ
        - VU
        - VE
        - VN
        - VG
        - VI
        - WF
        - EH
        - YE
        - ZM
        - ZW
        - AX
        - BQ
        - CW
        - GG
        - IM
        - JE
        - ME
        - BL
        - MF
        - RS
        - SX
        - SS
        - XK
      description: The country to retrieve analytics for.
    ClickEvent:
      type: object
      properties:
        event:
          type: string
          enum:
            - click
        timestamp:
          type: string
        click:
          type: object
          properties:
            id:
              type: string
            url:
              type: string
            continent:
              type: string
            country:
              type: string
            city:
              type: string
            device:
              type: string
            browser:
              type: string
            os:
              type: string
            referer:
              type: string
            refererUrl:
              type: string
            type:
              type: string
            ip:
              type: string
          required:
            - id
            - url
            - continent
            - country
            - city
            - device
            - browser
            - os
            - referer
            - refererUrl
            - type
            - ip
        link:
          type: object
          properties:
            id:
              type: string
              description: The unique ID of the short link.
            domain:
              type: string
              description: >-
                The domain of the short link. If not provided, the main domain
                of the project will be used (or `codeqr.link` if the project has
                no domains).
            key:
              type: string
              description: >-
                The slug of the short link. If not provided, a random
                7-character slug will be generated.
            url:
              type: string
            archived:
              type: boolean
            expiresAt:
              type: string
            expiredUrl:
              type: string
              nullable: true
              format: uri
              description: The URL to redirect to when the short link expires.
            trackConversion:
              type: boolean
            flexible:
              type: boolean
              default: false
              description: Whether the short link is flexible.
            doIndex:
              type: boolean
            password:
              type: string
              nullable: true
              description: The password required to access the short link destination URL.
            externalId:
              type: string
              nullable: true
              description: This is the ID of the link in your database.
            proxy:
              type: boolean
            title:
              type: string
              nullable: true
              description: >-
                The title of the short link generated via
                `api.codeqr.io/metatags`. Will be used for custom link preview
                if `proxy` is true.
            description:
              type: string
              nullable: true
              description: >-
                The description of the short link generated via
                `api.codeqr.io/metatags`. Will be used for custom link preview
                if `proxy` is true.
            image:
              type: string
              nullable: true
              description: >-
                The image of the short link generated via
                `api.codeqr.io/metatags`. Will be used for custom link preview
                if `proxy` is true.
            video:
              type: string
              nullable: true
              description: The video of the short link.
            rewrite:
              type: boolean
            ios:
              type: string
              nullable: true
              description: >-
                The iOS destination URL for the short link for iOS device
                targeting.
            android:
              type: string
              nullable: true
              description: >-
                The Android destination URL for the short link for Android
                device targeting.
            geo:
              type: object
              nullable: true
              additionalProperties:
                type: string
              description: >-
                Geographic targeting information for the short link in JSON
                format `{[COUNTRY]: https://example.com }`. Learn more:
                https://codeqr.link/geo
            publicStats:
              type: boolean
            tagId:
              type: string
              nullable: true
              description: >-
                [DEPRECATED (use `tags` instead)]: The unique ID of the tag
                assigned to the short link.
              deprecated: true
            tags:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/TagSchema'
              description: The tags assigned to the short link.
            folderId:
              type: string
              nullable: true
              description: The unique ID of the folder assigned to the short link.
            comments:
              type: string
              nullable: true
              description: The comments for the short link.
            notificationToken:
              type: string
              nullable: true
              description: The notification token of the short link.
            shortLink:
              type: string
              format: uri
              description: >-
                The complete URL of the short link, including the https protocol
                (for example, `https://codeqr.link/try`).
            qrCode:
              type: string
              format: uri
              description: >-
                The complete QR code URL for the short link (for example,
                `https://api.codeqr.io/qr?url=https://codeqr.link/try`).
            utm_source:
              type: string
              nullable: true
              description: The UTM source of the short link.
            utm_medium:
              type: string
              nullable: true
              description: The UTM medium of the short link.
            utm_campaign:
              type: string
              nullable: true
              description: The UTM campaign of the short link.
            utm_term:
              type: string
              nullable: true
              description: The UTM term of the short link.
            utm_content:
              type: string
              nullable: true
              description: The UTM content of the short link.
            userId:
              type: string
              nullable: true
            projectId:
              type: string
              description: The ID of the project of the short link.
            clicks:
              type: number
              default: 0
              description: The number of clicks on the short link.
            leads:
              type: number
              default: 0
              description: The number of leads generated by the short link.
            sales:
              type: number
              default: 0
              description: The number of sales generated by the short link.
            saleAmount:
              type: number
              default: 0
              description: The amount of the sale generated by the link.
            lastClicked:
              type: string
            createdAt:
              type: string
            updatedAt:
              type: string
            preRedirection:
              type: boolean
              default: false
              description: Whether the short link has pre-redirection.
            pageId:
              type: string
              nullable: true
              description: The ID of the page to redirect to before the link destination.
            pageUrl:
              type: string
              nullable: true
              description: The URL of the page to redirect to before the link destination.
            isFormMandatory:
              type: boolean
              default: false
              description: If the form is mandatory for the page.
            filled:
              type: boolean
              default: false
              description: Whether the link is filled or not.
          required:
            - id
            - domain
            - key
            - expiredUrl
            - flexible
            - password
            - externalId
            - title
            - description
            - image
            - video
            - ios
            - android
            - geo
            - tagId
            - tags
            - folderId
            - comments
            - notificationToken
            - utm_source
            - utm_medium
            - utm_campaign
            - utm_term
            - utm_content
            - userId
            - projectId
            - clicks
            - leads
            - sales
            - saleAmount
            - lastClicked
            - createdAt
            - updatedAt
            - preRedirection
            - isFormMandatory
            - filled
        click_id:
          type: string
          description: Deprecated. Use `click.id` instead.
          deprecated: true
        link_id:
          type: string
          description: Deprecated. Use `link.id` instead.
          deprecated: true
        domain:
          type: string
          description: Deprecated. Use `link.domain` instead.
          deprecated: true
        key:
          type: string
          description: Deprecated. Use `link.key` instead.
          deprecated: true
        url:
          type: string
          description: Deprecated. Use `click.url` instead.
          deprecated: true
        continent:
          type: string
          description: Deprecated. Use `click.continent` instead.
          deprecated: true
        country:
          type: string
          description: Deprecated. Use `click.country` instead.
          deprecated: true
        city:
          type: string
          description: Deprecated. Use `click.city` instead.
          deprecated: true
        device:
          type: string
          description: Deprecated. Use `click.device` instead.
          deprecated: true
        browser:
          type: string
          description: Deprecated. Use `click.browser` instead.
          deprecated: true
        os:
          type: string
          description: Deprecated. Use `click.os` instead.
          deprecated: true
        type:
          type: string
          description: Deprecated. Use `click.qr` instead.
          deprecated: true
        ip:
          type: string
          description: Deprecated. Use `click.ip` instead.
          deprecated: true
      required:
        - event
        - click
        - link
        - click_id
        - link_id
        - domain
        - key
        - url
        - continent
        - country
        - city
        - device
        - browser
        - os
        - type
        - ip
      title: ClickEvent
    LeadEvent:
      type: object
      properties:
        event:
          type: string
          enum:
            - lead
        timestamp:
          type: string
        eventId:
          type: string
        eventName:
          type: string
        click:
          type: object
          properties:
            id:
              type: string
            url:
              type: string
            continent:
              type: string
            country:
              type: string
            city:
              type: string
            device:
              type: string
            browser:
              type: string
            os:
              type: string
            referer:
              type: string
            refererUrl:
              type: string
            type:
              type: string
            ip:
              type: string
          required:
            - id
            - url
            - continent
            - country
            - city
            - device
            - browser
            - os
            - referer
            - refererUrl
            - type
            - ip
        link: {}
        customer:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            email:
              type: string
            avatar:
              type: string
          required:
            - id
            - name
            - email
            - avatar
        click_id:
          type: string
          description: Deprecated. Use `click.id` instead.
          deprecated: true
        link_id:
          type: string
          description: Deprecated. Use `link.id` instead.
          deprecated: true
        domain:
          type: string
          description: Deprecated. Use `link.domain` instead.
          deprecated: true
        key:
          type: string
          description: Deprecated. Use `link.key` instead.
          deprecated: true
        url:
          type: string
          description: Deprecated. Use `click.url` instead.
          deprecated: true
        continent:
          type: string
          description: Deprecated. Use `click.continent` instead.
          deprecated: true
        country:
          type: string
          description: Deprecated. Use `click.country` instead.
          deprecated: true
        city:
          type: string
          description: Deprecated. Use `click.city` instead.
          deprecated: true
        device:
          type: string
          description: Deprecated. Use `click.device` instead.
          deprecated: true
        browser:
          type: string
          description: Deprecated. Use `click.browser` instead.
          deprecated: true
        os:
          type: string
          description: Deprecated. Use `click.os` instead.
          deprecated: true
        type:
          type: string
          description: Deprecated. Use `click.qr` instead.
          deprecated: true
        ip:
          type: string
          description: Deprecated. Use `click.ip` instead.
          deprecated: true
      required:
        - event
        - eventId
        - eventName
        - click
        - customer
        - click_id
        - link_id
        - domain
        - key
        - url
        - continent
        - country
        - city
        - device
        - browser
        - os
        - type
        - ip
      title: LeadEvent
    SaleEvent:
      type: object
      properties:
        event:
          type: string
          enum:
            - sale
        timestamp:
          type: string
        eventId:
          type: string
        eventName:
          type: string
        link:
          type: object
          properties:
            id:
              type: string
              description: The unique ID of the short link.
            domain:
              type: string
              description: >-
                The domain of the short link. If not provided, the main domain
                of the project will be used (or `codeqr.link` if the project has
                no domains).
            key:
              type: string
              description: >-
                The slug of the short link. If not provided, a random
                7-character slug will be generated.
            url:
              type: string
            archived:
              type: boolean
            expiresAt:
              type: string
            expiredUrl:
              type: string
              nullable: true
              format: uri
              description: The URL to redirect to when the short link expires.
            trackConversion:
              type: boolean
            flexible:
              type: boolean
              default: false
              description: Whether the short link is flexible.
            doIndex:
              type: boolean
            password:
              type: string
              nullable: true
              description: The password required to access the short link destination URL.
            externalId:
              type: string
              nullable: true
              description: This is the ID of the link in your database.
            proxy:
              type: boolean
            title:
              type: string
              nullable: true
              description: >-
                The title of the short link generated via
                `api.codeqr.io/metatags`. Will be used for custom link preview
                if `proxy` is true.
            description:
              type: string
              nullable: true
              description: >-
                The description of the short link generated via
                `api.codeqr.io/metatags`. Will be used for custom link preview
                if `proxy` is true.
            image:
              type: string
              nullable: true
              description: >-
                The image of the short link generated via
                `api.codeqr.io/metatags`. Will be used for custom link preview
                if `proxy` is true.
            video:
              type: string
              nullable: true
              description: The video of the short link.
            rewrite:
              type: boolean
            ios:
              type: string
              nullable: true
              description: >-
                The iOS destination URL for the short link for iOS device
                targeting.
            android:
              type: string
              nullable: true
              description: >-
                The Android destination URL for the short link for Android
                device targeting.
            geo:
              type: object
              nullable: true
              additionalProperties:
                type: string
              description: >-
                Geographic targeting information for the short link in JSON
                format `{[COUNTRY]: https://example.com }`. Learn more:
                https://codeqr.link/geo
            publicStats:
              type: boolean
            tagId:
              type: string
              nullable: true
              description: >-
                [DEPRECATED (use `tags` instead)]: The unique ID of the tag
                assigned to the short link.
              deprecated: true
            tags:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/TagSchema'
              description: The tags assigned to the short link.
            folderId:
              type: string
              nullable: true
              description: The unique ID of the folder assigned to the short link.
            comments:
              type: string
              nullable: true
              description: The comments for the short link.
            notificationToken:
              type: string
              nullable: true
              description: The notification token of the short link.
            shortLink:
              type: string
              format: uri
              description: >-
                The complete URL of the short link, including the https protocol
                (for example, `https://codeqr.link/try`).
            qrCode:
              type: string
              format: uri
              description: >-
                The complete QR code URL for the short link (for example,
                `https://api.codeqr.io/qr?url=https://codeqr.link/try`).
            utm_source:
              type: string
              nullable: true
              description: The UTM source of the short link.
            utm_medium:
              type: string
              nullable: true
              description: The UTM medium of the short link.
            utm_campaign:
              type: string
              nullable: true
              description: The UTM campaign of the short link.
            utm_term:
              type: string
              nullable: true
              description: The UTM term of the short link.
            utm_content:
              type: string
              nullable: true
              description: The UTM content of the short link.
            userId:
              type: string
              nullable: true
            projectId:
              type: string
              description: The ID of the project of the short link.
            clicks:
              type: number
              default: 0
              description: The number of clicks on the short link.
            leads:
              type: number
              default: 0
              description: The number of leads generated by the short link.
            sales:
              type: number
              default: 0
              description: The number of sales generated by the short link.
            saleAmount:
              type: number
              default: 0
              description: The amount of the sale generated by the link.
            lastClicked:
              type: string
            createdAt:
              type: string
            updatedAt:
              type: string
            preRedirection:
              type: boolean
              default: false
              description: Whether the short link has pre-redirection.
            pageId:
              type: string
              nullable: true
              description: The ID of the page to redirect to before the link destination.
            pageUrl:
              type: string
              nullable: true
              description: The URL of the page to redirect to before the link destination.
            isFormMandatory:
              type: boolean
              default: false
              description: If the form is mandatory for the page.
            filled:
              type: boolean
              default: false
              description: Whether the link is filled or not.
          required:
            - id
            - domain
            - key
            - expiredUrl
            - flexible
            - password
            - externalId
            - title
            - description
            - image
            - video
            - ios
            - android
            - geo
            - tagId
            - tags
            - folderId
            - comments
            - notificationToken
            - utm_source
            - utm_medium
            - utm_campaign
            - utm_term
            - utm_content
            - userId
            - projectId
            - clicks
            - leads
            - sales
            - saleAmount
            - lastClicked
            - createdAt
            - updatedAt
            - preRedirection
            - isFormMandatory
            - filled
        click:
          type: object
          properties:
            id:
              type: string
            url:
              type: string
            continent:
              type: string
            country:
              type: string
            city:
              type: string
            device:
              type: string
            browser:
              type: string
            os:
              type: string
            referer:
              type: string
            refererUrl:
              type: string
            type:
              type: string
            ip:
              type: string
          required:
            - id
            - url
            - continent
            - country
            - city
            - device
            - browser
            - os
            - referer
            - refererUrl
            - type
            - ip
        customer:
          type: object
          properties:
            id:
              type: string
              description: >-
                The unique ID of the customer. You may use either the customer's
                `id` on CodeQR (obtained via `/customers` endpoint) or their
                `externalId` (unique ID within your system, prefixed with
                `ext_`, e.g. `ext_123`).
            externalId:
              type: string
              description: Unique identifier for the customer in the client's app.
            name:
              type: string
              description: Name of the customer.
            email:
              type: string
              nullable: true
              description: Email of the customer.
            avatar:
              type: string
              nullable: true
              description: Avatar URL of the customer.
            country:
              type: string
              nullable: true
              description: Country of the customer.
            createdAt:
              type: string
              description: The date the customer was created.
            link:
              type: object
              nullable: true
              properties:
                id:
                  type: string
                  description: The unique ID of the short link.
                domain:
                  type: string
                  description: >-
                    The domain of the short link. If not provided, the main
                    domain of the project will be used (or `codeqr.link` if the
                    project has no domains).
                key:
                  type: string
                  description: >-
                    The slug of the short link. If not provided, a random
                    7-character slug will be generated.
                shortLink:
                  type: string
                  format: uri
                  description: >-
                    The complete URL of the short link, including the https
                    protocol (for example, `https://codeqr.link/try`).
              required:
                - id
                - domain
                - key
            customFields:
              type: object
              nullable: true
              additionalProperties:
                type: string
              description: Custom fields of the customer.
          required:
            - id
            - externalId
            - name
            - createdAt
        sale:
          type: object
          properties:
            amount:
              type: integer
              minimum: 0
              description: >-
                The amount of the sale in cents (for all two-decimal
                currencies). If the sale is in a zero-decimal currency, pass the
                full integer value (e.g. `1437` JPY). Learn more:
                https://d.to/currency
            invoiceId:
              type: string
              nullable: true
              default: null
              description: >-
                The invoice ID of the sale. Can be used as a idempotency key –
                only one sale event can be recorded for a given invoice ID.
            paymentProcessor:
              type: string
              enum:
                - stripe
                - shopify
                - polar
                - paddle
                - revenuecat
                - custom
                - manual
              default: custom
              description: The payment processor via which the sale was made.
          required:
            - amount
            - invoiceId
            - paymentProcessor
        saleAmount:
          type: number
          description: Deprecated. Use `sale.amount` instead.
          deprecated: true
        invoice_id:
          type: string
          description: Deprecated. Use `sale.invoiceId` instead.
          deprecated: true
        payment_processor:
          type: string
          description: Deprecated. Use `sale.paymentProcessor` instead.
        metadata:
          type: string
        click_id:
          type: string
          description: Deprecated. Use `click.id` instead.
          deprecated: true
        link_id:
          type: string
          description: Deprecated. Use `link.id` instead.
          deprecated: true
        domain:
          type: string
          description: Deprecated. Use `link.domain` instead.
          deprecated: true
        key:
          type: string
          description: Deprecated. Use `link.key` instead.
          deprecated: true
        url:
          type: string
          description: Deprecated. Use `click.url` instead.
          deprecated: true
        continent:
          type: string
          description: Deprecated. Use `click.continent` instead.
          deprecated: true
        country:
          type: string
          description: Deprecated. Use `click.country` instead.
          deprecated: true
        city:
          type: string
          description: Deprecated. Use `click.city` instead.
          deprecated: true
        device:
          type: string
          description: Deprecated. Use `click.device` instead.
          deprecated: true
        browser:
          type: string
          description: Deprecated. Use `click.browser` instead.
          deprecated: true
        os:
          type: string
          description: Deprecated. Use `click.os` instead.
          deprecated: true
        type:
          type: string
          description: Deprecated. Use `click.qr` instead.
          deprecated: true
        ip:
          type: string
          description: Deprecated. Use `click.ip` instead.
          deprecated: true
      required:
        - event
        - eventId
        - eventName
        - link
        - click
        - customer
        - sale
        - saleAmount
        - invoice_id
        - payment_processor
        - metadata
        - click_id
        - link_id
        - domain
        - key
        - url
        - continent
        - country
        - city
        - device
        - browser
        - os
        - type
        - ip
      title: SaleEvent
    TagSchema:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the tag.
        name:
          type: string
          description: The name of the tag.
        color:
          type: string
          enum:
            - red
            - yellow
            - green
            - blue
            - purple
            - pink
            - brown
          description: The color of the tag.
      required:
        - id
        - name
        - color
      title: Tag
  responses:
    '400':
      description: >-
        The server cannot or will not process the request due to something that
        is perceived to be a client error (e.g., malformed request syntax,
        invalid request message framing, or deceptive request routing).
      content:
        application/json:
          schema:
            x-speakeasy-name-override: BadRequest
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - bad_request
                    description: A short code indicating the error code returned.
                    example: bad_request
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.codeqr.io/api-reference/errors#bad-request
                required:
                  - code
                  - message
            required:
              - error
    '401':
      description: >-
        Although the HTTP standard specifies "unauthorized", semantically this
        response means "unauthenticated". That is, the client must authenticate
        itself to get the requested response.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Unauthorized
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unauthorized
                    description: A short code indicating the error code returned.
                    example: unauthorized
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.codeqr.io/api-reference/errors#unauthorized
                required:
                  - code
                  - message
            required:
              - error
    '403':
      description: >-
        The client does not have access rights to the content; that is, it is
        unauthorized, so the server is refusing to give the requested resource.
        Unlike 401 Unauthorized, the client's identity is known to the server.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Forbidden
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - forbidden
                    description: A short code indicating the error code returned.
                    example: forbidden
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.codeqr.io/api-reference/errors#forbidden
                required:
                  - code
                  - message
            required:
              - error
    '404':
      description: The server cannot find the requested resource.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: NotFound
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - not_found
                    description: A short code indicating the error code returned.
                    example: not_found
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.codeqr.io/api-reference/errors#not-found
                required:
                  - code
                  - message
            required:
              - error
    '409':
      description: >-
        This response is sent when a request conflicts with the current state of
        the server.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: Conflict
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - conflict
                    description: A short code indicating the error code returned.
                    example: conflict
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.codeqr.io/api-reference/errors#conflict
                required:
                  - code
                  - message
            required:
              - error
    '410':
      description: >-
        This response is sent when the requested content has been permanently
        deleted from server, with no forwarding address.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: InviteExpired
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - invite_expired
                    description: A short code indicating the error code returned.
                    example: invite_expired
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: https://docs.codeqr.io/api-reference/errors#invite-expired
                required:
                  - code
                  - message
            required:
              - error
    '422':
      description: >-
        The request was well-formed but was unable to be followed due to
        semantic errors.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: UnprocessableEntity
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - unprocessable_entity
                    description: A short code indicating the error code returned.
                    example: unprocessable_entity
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.codeqr.io/api-reference/errors#unprocessable-entity
                required:
                  - code
                  - message
            required:
              - error
    '429':
      description: >-
        The user has sent too many requests in a given amount of time ("rate
        limiting")
      content:
        application/json:
          schema:
            x-speakeasy-name-override: RateLimitExceeded
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - rate_limit_exceeded
                    description: A short code indicating the error code returned.
                    example: rate_limit_exceeded
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.codeqr.io/api-reference/errors#rate-limit_exceeded
                required:
                  - code
                  - message
            required:
              - error
    '500':
      description: The server has encountered a situation it does not know how to handle.
      content:
        application/json:
          schema:
            x-speakeasy-name-override: InternalServerError
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - internal_server_error
                    description: A short code indicating the error code returned.
                    example: internal_server_error
                  message:
                    x-speakeasy-error-message: true
                    type: string
                    description: A human readable explanation of what went wrong.
                    example: The requested resource was not found.
                  doc_url:
                    type: string
                    description: >-
                      A link to our documentation with more details about this
                      error code
                    example: >-
                      https://docs.codeqr.io/api-reference/errors#internal-server_error
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    token:
      type: http
      description: Default authentication mechanism
      scheme: bearer

````