# Create Domain Source: https://docs.taap.it/api-reference/domains/create POST https://api.taap.it/v1/domains Create a new custom domain for your workspace Add a custom domain for branded deeplinks. **Request:** ```bash cURL theme={null} curl -X POST 'https://api.taap.it/v1/domains' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "domain": "links.yourcompany.com", "description": "Custom domain for marketing links" }' ``` **Response:** ```json theme={null} { "id": "domain_987654321", "created_at": "2024-01-15T10:30:00Z", "domain": "links.yourcompany.com" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Request Parameters The custom domain name (e.g., "links.yourcompany.com") Optional description for the domain ## Response Fields Unique identifier for the created domain ISO 8601 timestamp when the domain was created The custom domain name # Delete Domain Source: https://docs.taap.it/api-reference/domains/delete DELETE https://api.taap.it/v1/domains/{domain_id} Remove a domain from your account **Request:** ```bash cURL theme={null} curl -X DELETE 'https://api.taap.it/v1/domains/domain_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "message": "Domain deleted successfully" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the domain to delete # Retrieve Domain Source: https://docs.taap.it/api-reference/domains/get GET https://api.taap.it/v1/domains/{domain_id} Retrieve details for a specific domain **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/domains/domain_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "id": "domain_987654321", "domain": "links.yourcompany.com", "description": "Custom domain for marketing links", "is_verified": true, "created_at": "2024-01-15T10:30:00Z" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the domain ## Response Fields Unique identifier for the domain The custom domain name Description of the domain Whether the domain is verified ISO 8601 timestamp when the domain was created # List Domains Source: https://docs.taap.it/api-reference/domains/list GET https://api.taap.it/v1/domains Retrieve a paginated list of domains **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/domains?sort_by=created_at&sort_order=desc&page=1&page_size=20&cursor=eyJpZCI6ImRvbWFpbl85ODc2NTQzMjEifQ==' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "items": [ { "id": "domain_987654321", "domain": "links.yourcompany.com", "is_verified": true, "created_at": "2024-01-15T10:30:00Z" } ], "page": 1, "page_size": 10, "has_next": false } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Query Parameters ### Pagination Parameters Cursor for pagination (use for efficient pagination) Page number (starts from 1) Number of items per page (maximum 100) ### Sorting Parameters Field to sort by (e.g., "created\_at", "updated\_at", "domain") Sort order: "asc" for ascending or "desc" for descending # Track Lead Source: https://docs.taap.it/api-reference/events/lead POST /api/events/lead Create a lead conversion event ## Endpoint ``` POST https://track.taap.it/api/events/lead ``` ## Authentication Use your secret API key: ```bash theme={null} Authorization: Bearer taapit_sk_xxxxxxxxxxxx ``` Use your publishable key: ```bash theme={null} X-Publishable-Key: taapit_pk_xxxxxxxxxxxx ``` ## Request Body | Field | Type | Required | Description | | ---------------------- | ------ | -------- | --------------------------------------------- | | `trackingId` | string | ✓ | The `ta_tid` from the cookie or URL parameter | | `customer` | object | ✓ | Customer information | | `customer.externalId` | string | ✓ | Your internal user/customer ID | | `customer.email` | string | | Customer's email address | | `customer.firstname` | string | | Customer's first name | | `customer.lastname` | string | | Customer's last name | | `customer.phoneNumber` | string | | Customer's phone number | | `customer.avatarUrl` | string | | URL to customer's avatar image | | `metadata` | object | | Additional custom data (key-value pairs) | ## Examples ```bash theme={null} curl -X POST https://track.taap.it/api/events/lead \ -H "Authorization: Bearer taapit_sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "trackingId": "rLnWe1uz9t282v7g", "customer": { "externalId": "user_123", "email": "john@example.com", "firstname": "John", "lastname": "Doe" }, "metadata": { "source": "signup-form" } }' ``` ```typescript theme={null} import { Taapit } from 'taapit-sdk'; const taapit = new Taapit({ apiKey: process.env.TAAPIT_API_KEY, }); await taapit.track.lead({ trackingId: 'rLnWe1uz9t282v7g', customer: { externalId: 'user_123', email: 'john@example.com', firstname: 'John', lastname: 'Doe', }, metadata: { source: 'signup-form', }, }); ``` ```tsx theme={null} import { useTaapitAnalytics } from 'taapit-sdk/react'; function SignUpForm() { const { trackLead } = useTaapitAnalytics(); const handleSignUp = async (user) => { trackLead({ customer: { externalId: user.id, email: user.email, firstname: user.firstName, lastname: user.lastName, }, metadata: { source: 'signup-form', }, }); }; } ``` ```html theme={null} ``` ## Response ```json theme={null} { "ok": true } ``` ```json theme={null} { "error": "Missing customer.externalId" } ``` ```json theme={null} { "error": "Invalid API key" } ``` ```json theme={null} { "error": "Click not found for this trackingId" } ``` ## Error Codes | HTTP Code | Error | Description | | --------- | ---------------------------------------------- | --------------------------------------- | | 400 | `Invalid payload` | Request body validation failed | | 400 | `Missing customer.externalId` | Required field not provided | | 401 | `Invalid API key` | API key is invalid or revoked | | 401 | `Hostname not in allowed list` | Origin not whitelisted (client-side) | | 403 | `This click does not belong to your workspace` | trackingId is for a different workspace | | 404 | `Click not found for this trackingId` | trackingId doesn't exist or has expired | # Track Sale Source: https://docs.taap.it/api-reference/events/sale POST /api/events/sale Create a sale conversion event ## Endpoint ``` POST https://track.taap.it/api/events/sale ``` ## Authentication Use your secret API key: ```bash theme={null} Authorization: Bearer taapit_sk_xxxxxxxxxxxx ``` Use your publishable key: ```bash theme={null} X-Publishable-Key: taapit_pk_xxxxxxxxxxxx ``` ## Request Body | Field | Type | Required | Description | | ---------------------- | ------ | -------- | ------------------------------------------------ | | `trackingId` | string | ✓ | The `ta_tid` from the cookie or URL parameter | | `customer` | object | ✓ | Customer information | | `customer.externalId` | string | ✓ | Your internal user/customer ID | | `customer.email` | string | | Customer's email address | | `customer.firstname` | string | | Customer's first name | | `customer.lastname` | string | | Customer's last name | | `customer.phoneNumber` | string | | Customer's phone number | | `customer.avatarUrl` | string | | URL to customer's avatar image | | `amount` | number | ✓ | Transaction amount in currency units (not cents) | | `currency` | string | ✓ | ISO 4217 currency code (e.g., `eur`, `usd`) | | `metadata` | object | | Additional custom data (key-value pairs) | **Amount format**: Use currency units, not cents. * ✅ `29.99` for €29.99 * ❌ `2999` would be interpreted as €2999 ## Examples ```bash theme={null} curl -X POST https://track.taap.it/api/events/sale \ -H "Authorization: Bearer taapit_sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "trackingId": "rLnWe1uz9t282v7g", "customer": { "externalId": "user_123", "email": "john@example.com" }, "amount": 99.99, "currency": "eur", "metadata": { "orderId": "order_456", "plan": "pro" } }' ``` ```typescript theme={null} import { Taapit } from 'taapit-sdk'; const taapit = new Taapit({ apiKey: process.env.TAAPIT_API_KEY, }); await taapit.track.sale({ trackingId: 'rLnWe1uz9t282v7g', customer: { externalId: 'user_123', email: 'john@example.com', }, amount: 99.99, currency: 'eur', metadata: { orderId: 'order_456', plan: 'pro', }, }); ``` ```tsx theme={null} import { useTaapitAnalytics } from 'taapit-sdk/react'; function CheckoutButton({ order }) { const { trackSale } = useTaapitAnalytics(); const handlePurchase = async () => { trackSale({ customer: { externalId: order.userId, email: order.email, }, amount: order.total, currency: 'eur', metadata: { orderId: order.id, plan: order.plan, }, }); }; } ``` ```html theme={null} ``` ## Response ```json theme={null} { "ok": true } ``` ```json theme={null} { "error": "Invalid payload", "details": [ { "path": ["amount"], "message": "Required" } ] } ``` ```json theme={null} { "error": "Invalid API key" } ``` ```json theme={null} { "error": "Click not found for this trackingId" } ``` ## Currency Codes Use standard [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency codes: | Currency | Code | | ----------------- | ----- | | Euro | `eur` | | US Dollar | `usd` | | British Pound | `gbp` | | Japanese Yen | `jpy` | | Swiss Franc | `chf` | | Canadian Dollar | `cad` | | Australian Dollar | `aud` | ## Error Codes | HTTP Code | Error | Description | | --------- | ---------------------------------------------- | --------------------------------------- | | 400 | `Invalid payload` | Request body validation failed | | 400 | `Missing customer.externalId` | Required field not provided | | 401 | `Invalid API key` | API key is invalid or revoked | | 401 | `Hostname not in allowed list` | Origin not whitelisted (client-side) | | 403 | `This click does not belong to your workspace` | trackingId is for a different workspace | | 404 | `Click not found for this trackingId` | trackingId doesn't exist or has expired | # Create Link Source: https://docs.taap.it/api-reference/links/create POST https://api.taap.it/v1/links Create a new deeplink with optional advanced features Create a new deeplink with custom codes, domains, password protection, expiration dates, and tracking features. **Request:** ```bash cURL theme={null} curl -X POST 'https://api.taap.it/v1/links' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "original_url": "https://example.com/very-long-url-that-needs-shortening" }' ``` **Response:** ```json theme={null} { "id": "link_987654321", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z", "project_id": "project_123456789", "domain_id": "domain_987654321", "pixel_id": "pixel_456789123", "original_url": "https://example.com/very-long-url-that-needs-shortening", "name": "My Marketing Link", "description": "Link for summer campaign", "code": "summer2024", "app": "MyApp", "app_logo": "https://example.com/logo.png", "android_link": "myapp://open?url=https://example.com", "ios_link": "myapp://open?url=https://example.com", "windows_link": "ms-windows-store://pdp/?productid=9NBLGGH123456", "macos_link": "macappstore://itunes.apple.com/app/myapp/id123456789", "whatsapp_message": "Check out this amazing link!", "metadata": { "title": "Amazing Product", "description": "Check out our new product", "favicon": "https://example.com/favicon.ico", "social_image": "https://example.com/social-image.jpg" }, "qr_code_options": { "size": 200, "color": "#000000", "background_color": "#ffffff", "logo": "https://example.com/logo.png", "logo_size": 50, "error_correction_level": "M" }, "utm_name": "summer_campaign", "utm_source": "email", "utm_medium": "newsletter", "utm_campaign": "summer2024", "utm_term": "marketing", "utm_content": "cta_button", "utm_template_id": "template_123", "referrer": "https://example.com", "password": "secure123", "password_description": "Enter password to access link", "excluded_countries": [ { "code": "US", "label": "United States", "phone": "+1", "suggested": true, "lang": "en", "continent": "North America" } ], "has_public_stat": true, "enable_conversion_tracking": true, "is_archived": false, "expiration_date": "2024-12-31T23:59:59Z", "expiration_click_count": 1000, "clicks": 0 } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Request Parameters The URL to be shortened. Supports http, https, mailto, tel, sms, whatsapp, tg, skype schemes. Whether to enable conversion tracking on this link. When omitted, the default depends on your plan's conversion tracking feature. ## Response Fields ### Core Fields Unique identifier for the created link ISO 8601 timestamp when the link was created ISO 8601 timestamp when the link was last updated ID of the associated project ID of the custom domain used ID of the associated tracking pixel ### Link Content The original URL that was shortened Name of the link Description of the link The short code used in the URL ### Deep Linking Name of the mobile app for deep linking URL to the app logo image Android deep link URL iOS deep link URL Windows deep link URL macOS deep link URL Pre-filled message for WhatsApp sharing ### Metadata & QR Code Link metadata for website previews Page title for link previews Page description for link previews URL to favicon image URL to social media preview image QR code generation options QR code size in pixels QR code color (hex format) QR code background color (hex format) URL to logo image embedded in QR code Logo size in pixels Error correction level (L, M, Q, H) ### UTM Parameters UTM campaign name UTM source UTM medium UTM campaign identifier UTM term (keywords) UTM content UTM template identifier Referrer URL ### Security & Access Password to protect the link Description shown when password is required Array of countries excluded from accessing the link Country code (ISO 3166-1 alpha-2) Country name Country phone code Whether this country is suggested for exclusion Primary language code Continent name Whether link statistics are publicly accessible ### Conversion Tracking Whether conversion tracking is enabled on this link ### Status Flags Whether the link is archived ### Expiration ISO 8601 datetime when link expires Maximum number of clicks before link expires ### Analytics Total number of clicks ## Error Responses ```json 400 Bad Request theme={null} { "detail": "Invalid URL format" } ``` ```json 409 Conflict theme={null} { "detail": "Custom code already exists" } ``` # Delete Link Source: https://docs.taap.it/api-reference/links/delete DELETE https://api.taap.it/v1/links/{link_id} Remove a link from your account Permanently delete a link from your account. **Request:** ```bash cURL theme={null} curl -X DELETE 'https://api.taap.it/v1/links/link_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "message": "Link deleted successfully" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the link to delete ## Query Parameters Deleting a link is permanent and cannot be undone. All analytics data associated with the link will also be removed. # Retrieve Link Source: https://docs.taap.it/api-reference/links/get GET https://api.taap.it/v1/links/{link_id} Retrieve details for a specific link Get detailed information about a specific link by its ID. **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/links/link_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "id": "link_987654321", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z", "project_id": "project_123456789", "domain_id": "domain_987654321", "pixel_id": "pixel_456789123", "original_url": "https://example.com/very-long-url-that-needs-shortening", "name": "My Marketing Link", "description": "Link for summer campaign", "code": "my-custom-link", "app": "MyApp", "app_logo": "https://example.com/logo.png", "android_link": "myapp://open?url=https://example.com", "ios_link": "myapp://open?url=https://example.com", "windows_link": "ms-windows-store://pdp/?productid=9NBLGGH123456", "macos_link": "macappstore://itunes.apple.com/app/myapp/id123456789", "whatsapp_message": "Check out this amazing link!", "metadata": { "title": "Amazing Product", "description": "Check out our new product", "favicon": "https://example.com/favicon.ico", "social_image": "https://example.com/social-image.jpg" }, "qr_code_options": { "size": 200, "color": "#000000", "background_color": "#ffffff", "logo": "https://example.com/logo.png", "logo_size": 50, "error_correction_level": "M" }, "utm_name": "summer_campaign", "utm_source": "email", "utm_medium": "newsletter", "utm_campaign": "summer2024", "utm_term": "marketing", "utm_content": "cta_button", "utm_template_id": "template_123", "referrer": "https://example.com", "password": "secure123", "password_description": "Enter password to access link", "excluded_countries": [ { "code": "US", "label": "United States", "phone": "+1", "suggested": true, "lang": "en", "continent": "North America" } ], "has_public_stat": true, "is_archived": false, "expiration_date": "2024-12-31T23:59:59Z", "expiration_click_count": 1000, "clicks": 42 } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the link # List Links Source: https://docs.taap.it/api-reference/links/list GET https://api.taap.it/v1/links Retrieve a paginated list of links with optional filtering Retrieve all links with pagination and filtering options. **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/links?archived=false&sort_by=created_at&sort_order=desc&page=1&page_size=20&cursor=eyJpZCI6ImxpbmtfOTg3NjU0MzIxIn0=' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "items": [ { "id": "link_987654321", "original_url": "https://example.com/very-long-url-that-needs-shortening", "short_url": "https://taap.it/my-custom-link", "code": "my-custom-link", "created_at": "2024-01-15T10:30:00Z", "click_count": 42, "is_active": true, "is_archived": false } ], "page": 1, "page_size": 10, "has_next": true, "has_prev": false, "next_cursor": "eyJpZCI6ImxpbmtfOTg3NjU0MzIxIn0=", "prev_cursor": null } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Query Parameters ### Pagination Parameters Cursor for pagination (use for efficient pagination) Page number (starts from 1) Number of items per page (maximum 100) ### Sorting Parameters Field to sort by (e.g., "created\_at", "updated\_at", "clicks", "code") Sort order: "asc" for ascending or "desc" for descending ### Filtering Parameters Filter by archived status (true for archived links, false for active links) # Update Link Source: https://docs.taap.it/api-reference/links/update PUT https://api.taap.it/v1/links/{link_id} Update an existing link's properties Update properties of an existing link including URL, password, and expiration settings. **Request:** ```bash cURL theme={null} curl -X PUT 'https://api.taap.it/v1/links/link_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "name": "Updated Marketing Link", "description": "Updated description for campaign", "original_url": "https://example.com/updated-url", "code": "updated-code", "app": "UpdatedApp", "app_logo": "https://example.com/new-logo.png", "android_link": "updatedapp://open?url=https://example.com", "ios_link": "updatedapp://open?url=https://example.com", "windows_link": "ms-windows-store://pdp/?productid=9NBLGGH987654", "macos_link": "macappstore://itunes.apple.com/app/updatedapp/id987654321", "whatsapp_message": "Check out this updated link!", "metadata": { "title": "Updated Product", "description": "Check out our updated product", "favicon": "https://example.com/new-favicon.ico", "social_image": "https://example.com/new-social-image.jpg" }, "qr_code_options": { "size": 250, "color": "#FF0000", "background_color": "#FFFFFF", "logo": "https://example.com/new-logo.png", "logo_size": 60, "error_correction_level": "H" }, "utm_name": "updated_campaign", "utm_source": "social", "utm_medium": "facebook", "utm_campaign": "updated2024", "utm_term": "updated_marketing", "utm_content": "updated_cta_button", "utm_template_id": "template_456", "referrer": "https://facebook.com", "password": "newpassword123", "password_description": "Enter new password to access link", "excluded_countries": [ { "code": "CA", "label": "Canada", "phone": "+1", "suggested": false, "lang": "en", "continent": "North America" } ], "has_public_stat": false, "enable_conversion_tracking": true, "is_archived": false, "expiration_date": "2024-06-30T23:59:59Z", "expiration_click_count": 500, "pixel_id": "pixel_789123456" }' ``` **Response:** ```json theme={null} { "id": "link_987654321", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T11:00:00Z", "project_id": "project_123456789", "domain_id": "domain_987654321", "pixel_id": "pixel_789123456", "original_url": "https://example.com/updated-url", "name": "Updated Marketing Link", "description": "Updated description for campaign", "code": "updated-code", "app": "UpdatedApp", "app_logo": "https://example.com/new-logo.png", "android_link": "updatedapp://open?url=https://example.com", "ios_link": "updatedapp://open?url=https://example.com", "windows_link": "ms-windows-store://pdp/?productid=9NBLGGH987654", "macos_link": "macappstore://itunes.apple.com/app/updatedapp/id987654321", "whatsapp_message": "Check out this updated link!", "metadata": { "title": "Updated Product", "description": "Check out our updated product", "favicon": "https://example.com/new-favicon.ico", "social_image": "https://example.com/new-social-image.jpg" }, "qr_code_options": { "size": 250, "color": "#FF0000", "background_color": "#FFFFFF", "logo": "https://example.com/new-logo.png", "logo_size": 60, "error_correction_level": "H" }, "utm_name": "updated_campaign", "utm_source": "social", "utm_medium": "facebook", "utm_campaign": "updated2024", "utm_term": "updated_marketing", "utm_content": "updated_cta_button", "utm_template_id": "template_456", "referrer": "https://facebook.com", "password": "newpassword123", "password_description": "Enter new password to access link", "excluded_countries": [ { "code": "CA", "label": "Canada", "phone": "+1", "suggested": false, "lang": "en", "continent": "North America" } ], "has_public_stat": false, "enable_conversion_tracking": true, "is_archived": false, "expiration_date": "2024-06-30T23:59:59Z", "expiration_click_count": 500, "clicks": 42 } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the link ## Request Body All parameters are optional for updates. Only include the fields you want to update. ### Core Parameters Updated name for the link Updated description for the link Updated URL to be shortened. Supports http, https, mailto, tel, sms, whatsapp, tg, skype schemes. Updated short code for the link Updated tracking pixel ID to associate with this link Updated project ID to associate with this link ### Deep Linking Parameters Updated name of the mobile app for deep linking Updated URL to the app logo image Updated Android deep link URL (e.g., myapp\://open?url=...) Updated iOS deep link URL (e.g., myapp\://open?url=...) Updated Windows deep link URL (e.g., ms-windows-store://...) Updated macOS deep link URL (e.g., macappstore://...) Updated pre-filled message for WhatsApp sharing ### Metadata Parameters Updated link metadata for website previews Updated page title for link previews Updated page description for link previews Updated URL to favicon image Updated URL to social media preview image Updated QR code generation options Updated QR code size in pixels Updated QR code color (hex format, e.g., #000000) Updated QR code background color (hex format, e.g., #ffffff) Updated URL to logo image to embed in QR code Updated logo size in pixels Updated error correction level (L, M, Q, H) ### UTM Parameters Updated UTM campaign name Updated UTM source (e.g., email, social, google) Updated UTM medium (e.g., newsletter, post, cpc) Updated UTM campaign identifier Updated UTM term (keywords) Updated UTM content (e.g., cta\_button, banner) Updated UTM template identifier Updated referrer URL ### Security & Access Parameters Updated password to protect the link (requires plan feature) Updated description shown when password is required Updated array of countries to exclude from accessing the link Country code (ISO 3166-1 alpha-2) Country name Country phone code Whether this country is suggested for exclusion Primary language code Continent name Updated setting for whether link statistics are publicly accessible ### Conversion Tracking Parameters Updated setting for whether conversion tracking is enabled on this link ### Status Parameters Updated archive status of the link ### Expiration Parameters Updated ISO 8601 datetime when link expires (requires plan feature) Updated maximum number of clicks before link expires (requires plan feature) # Create Project Source: https://docs.taap.it/api-reference/projects/create POST https://api.taap.it/v1/projects Create a new project to organize your links **Request:** ```bash cURL theme={null} curl -X POST 'https://api.taap.it/v1/projects' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "name": "Summer Marketing Campaign", "description": "Links for our summer marketing campaign", "color": "#FF6B6B" }' ``` **Response:** ```json theme={null} { "id": "project_987654321", "created_at": "2024-01-15T10:30:00Z", "name": "Summer Marketing Campaign", "description": "Links for our summer marketing campaign", "color": "#FF6B6B" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Request Parameters Name of the project Optional description for the project Color for the project in hex format (e.g., #FF6B6B, #FFF). Defaults to #000000 (black) if not provided. Must include the # symbol and be a valid 3 or 6 character hex color. ## Response Fields Unique identifier for the created project ISO 8601 timestamp when the project was created Name of the project Description of the project Color of the project in hex format (uppercase). Always present with default value #000000 if not specified during creation. # Delete Project Source: https://docs.taap.it/api-reference/projects/delete DELETE https://api.taap.it/v1/projects/{project_id} Remove a project from your account **Request:** ```bash cURL theme={null} curl -X DELETE 'https://api.taap.it/v1/projects/project_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "message": "Project deleted successfully" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the project to delete Deleting a project will not delete the links associated with it. Links will remain but will no longer be associated with the deleted project. # Retrieve Project Source: https://docs.taap.it/api-reference/projects/get GET https://api.taap.it/v1/projects/{project_id} Retrieve details for a specific project **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/projects/project_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "id": "project_987654321", "name": "Summer Marketing Campaign", "description": "Links for our summer marketing campaign", "created_at": "2024-01-15T10:30:00Z" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the project ## Response Fields Unique identifier for the project Name of the project Description of the project ISO 8601 timestamp when the project was created # List Projects Source: https://docs.taap.it/api-reference/projects/list GET https://api.taap.it/v1/projects Retrieve a paginated list of projects **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/projects?sort_by=created_at&sort_order=desc&page=1&page_size=20&cursor=eyJpZCI6InByb2plY3RfOTg3NjU0MzIxIn0=' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "items": [ { "id": "project_987654321", "name": "Summer Marketing Campaign", "description": "Links for our summer marketing campaign", "created_at": "2024-01-15T10:30:00Z" } ], "page": 1, "page_size": 10, "has_next": false } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Query Parameters ### Pagination Parameters Cursor for pagination (use for efficient pagination) Page number (starts from 1) Number of items per page (maximum 100) ### Sorting Parameters Field to sort by (e.g., "created\_at", "updated\_at", "name") Sort order: "asc" for ascending or "desc" for descending # Update Project Source: https://docs.taap.it/api-reference/projects/update PUT https://api.taap.it/v1/projects/{project_id} Update an existing project's details **Request:** ```bash cURL theme={null} curl -X PUT 'https://api.taap.it/v1/projects/project_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "name": "Summer Marketing Campaign 2024", "description": "Updated description for campaign" }' ``` **Response:** ```json theme={null} { "id": "project_987654321", "name": "Summer Marketing Campaign 2024", "description": "Updated description for campaign", "updated_at": "2024-01-15T11:00:00Z" } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the project to update ## Request Parameters Name of the project Optional description for the project Color for the project in hex format (e.g., #FF6B6B, #FFF). Must include the # symbol and be a valid 3 or 6 character hex color. Color will be normalized to uppercase. ## Response Fields Unique identifier for the updated project Name of the project Description of the project ISO 8601 timestamp when the project was last updated # Breakdowns Source: https://docs.taap.it/api-reference/radar/breakdowns GET https://taap.it/api/v1/radar/breakdowns Retrieve top pages, sources, locations and devices Returns the top breakdowns (pages, sources, locations and devices) for the project bound to your API key over the requested date range. **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/breakdowns?start=2026-01-01T00:00:00Z&end=2026-01-31T23:59:59Z&limit=20' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": { "pages": { "top": [ { "pathname": "/", "people": 320 }, { "pathname": "/pricing", "people": 110 } ] }, "sources": { "referrer": [ { "name": "Direct", "people": 210 }, { "name": "Google", "people": 180 } ] }, "locations": { "countries": [ { "name": "France", "people": 240, "countryCode": "FR", "revenue": 980.0 }, { "name": "Belgium", "people": 90, "countryCode": "BE", "revenue": 120.0 } ] }, "devices": { "browsers": [ { "name": "Chrome", "people": 410 }, { "name": "Safari", "people": 220 } ], "os": [ { "name": "Windows", "people": 300 }, { "name": "iOS", "people": 180 } ] }, "events": [ { "event_name": "signup_click", "people": 40, "events": 52, "completion_rate": 0 } ], "hostnames": ["www.example.com"] } } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters Start of the range, ISO 8601 (UTC). Example: `2026-01-01T00:00:00Z`. End of the range, ISO 8601 (UTC). Example: `2026-01-31T23:59:59Z`. Maximum number of rows per breakdown. Must be a positive number. Defaults to `50`. ## Response Fields Each section is optional and omitted when there is no data. Top pages, each with `pathname` and `people`. Top referrers, each with `name` and `people`. Top countries, each with `name`, `people`, `countryCode` and `revenue`. Top browsers, each with `name` and `people`. Top operating systems, each with `name` and `people`. Top custom events, each with `event_name`, `people` and `events`. Hostnames seen for the project in the range. # Custom events Source: https://docs.taap.it/api-reference/radar/custom-events GET https://taap.it/api/v1/radar/custom-events Most frequent custom events tracked for the project Returns the most frequent custom events tracked for the project bound to your API key, ranked by volume. **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/custom-events?start=2026-01-01T00:00:00Z&end=2026-01-31T23:59:59Z&limit=20' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": [ { "event_name": "signup_click", "people": 240, "events": 312, "completion_rate": 0 }, { "event_name": "add_to_cart", "people": 180, "events": 410, "completion_rate": 0 } ], "limit": 20 } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters Start of the range, ISO 8601 (UTC). Optional — omit for all time. End of the range, ISO 8601 (UTC). Optional — omit for all time. Maximum number of events to return. Capped at `500`. ## Response Fields Custom events ranked by volume. Name of the custom event. Number of unique people who triggered it. Total number of times the event fired. Reserved for funnel use; currently `0`. The effective limit applied to this response. # Radar API Source: https://docs.taap.it/api-reference/radar/introduction Read your Radar (Visitors) analytics programmatically with a project-scoped API key The **Radar API** lets external applications read the analytics collected by Taapit Radar (the Visitors product): aggregate metrics, time series, realtime visitors and top breakdowns (pages, sources, locations, devices). ## Base URL ``` https://taap.it/api/v1/radar ``` ## Authentication Radar endpoints are authenticated with a **project-scoped API key**. Every key belongs to a single Radar project (one website), so you never pass a `projectId` — the project is resolved from the key itself. Send the key as a Bearer token: ```http theme={null} Authorization: Bearer taapit_your_api_key_here ``` You can also use the `x-api-key` header instead: ```http theme={null} x-api-key: taapit_your_api_key_here ``` API keys are created from the Radar dashboard under **Project settings → API**. The full key is shown only once at creation — store it securely and never expose it client-side. ### Permissions Each key carries a permission level (**All**, **Read only** or **Restricted**). All current Radar endpoints are read-only, so any permission level can call them. Write scopes are reserved for future write endpoints. ## Endpoints Aggregate metrics over a date range (people, visits, pageviews, revenue…). Time-bucketed series of the core metrics. Active visitors in a rolling window. Top pages, sources, locations and devices. List people (visitors) with their key attributes and filters. A single person with their sessions and activity heatmap. Visitors active in the last few minutes (live feed). Most frequent custom events tracked for the project. ## Date parameters Endpoints that accept a date range use the `start` and `end` query parameters in ISO 8601 format (UTC), for example `2026-01-01T00:00:00Z`. ## Rate limits & quotas Radar endpoints are backed by an analytics engine that bills per query, so each API key has **per-key rate limits** to keep usage (and your costs) under control: | Window | Default limit | | ------ | ----------------------- | | Second | 3 requests / second | | Minute | 60 requests / minute | | Day | 5,000 requests / day | | Month | 50,000 requests / month | The per-second cap is a **burst guard**: a single key can never spike above a few requests per second, keeping usage comfortably under the analytics engine's per-second billing threshold. Every response includes rate-limit headers so you can track your remaining budget: ```http theme={null} X-RateLimit-Limit: 5000 # daily limit X-RateLimit-Remaining: 4987 # requests left today X-RateLimit-Reset: 1769990400 # UTC epoch seconds when the daily window resets ``` When a limit is exceeded the API returns **`429 Too Many Requests`** with a `Retry-After` header (seconds to wait) and a `scope` field indicating which window was hit (`second`, `minute`, `day` or `month`). Usage is logged **per key and per endpoint**. Polling endpoints like `realtime` and `last-visitors` consume quota on every call — cache responses and avoid sub-minute polling unless you really need it. Each call to `breakdowns` runs several aggregations, so it counts as one request but is heavier than a single metric read. ## Errors ```json 401 Unauthorized theme={null} { "error": "Invalid API key" } ``` ```json 400 Bad Request theme={null} { "error": "Both 'start' and 'end' query parameters are required" } ``` ```json 429 Too Many Requests theme={null} { "error": "Rate limit exceeded", "scope": "minute", "retryAfterSeconds": 42 } ``` ```json 500 Internal Server Error theme={null} { "error": "Internal server error" } ``` # Last visitors Source: https://docs.taap.it/api-reference/radar/last-visitors GET https://taap.it/api/v1/radar/last-visitors Visitors active within the last few minutes (live feed) Returns the visitors that were active within the last `minutes`. This is a live feed; responses are never cached. This endpoint is meant for live dashboards. It consumes quota on every call — avoid polling more than once per minute. See [Rate limits](/api-reference/radar/introduction#rate-limits-quotas). **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/last-visitors?minutes=5' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": [ { "visitorId": "v_8a1c2d", "countryCode": "FR", "city": "Paris", "page": "/pricing", "referrer": "google", "device": "mobile", "lastSeen": "2026-01-28T17:42:10.000Z" } ], "windowMinutes": 5 } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters Rolling window in minutes. Minimum `1`, maximum `60`. ## Response Fields Visitors active in the window, ordered by most recent activity. Each entry includes the visitor's location, current page, referrer and device. The window size applied to this response. # Metrics Source: https://docs.taap.it/api-reference/radar/metrics GET https://taap.it/api/v1/radar/overview Retrieve aggregate Radar metrics for a date range Returns aggregate metrics for the project bound to your API key over the requested date range. **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/overview?start=2026-01-01T00:00:00Z&end=2026-01-31T23:59:59Z' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": { "people": 1280, "visits": 1890, "pageviews": 5230, "events": 412, "revenue": 1990.5, "revenue_currency": "EUR", "sales": 23, "conversion_rate": 1.79, "revenue_per_visitor": 1.05, "bounce_rate": 38.2, "avg_duration_s": 142, "avg_duration_mmss": "02:22" } } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters Start of the range, ISO 8601 (UTC). Example: `2026-01-01T00:00:00Z`. End of the range, ISO 8601 (UTC). Example: `2026-01-31T23:59:59Z`. ## Response Fields Unique visitors. Number of sessions. Total pageviews. Custom events tracked. Attributed revenue. ISO 4217 currency of `revenue`. Number of sales / conversions. Conversion rate (percentage). Revenue divided by unique visitors. Bounce rate (percentage). Average session duration in seconds. Average session duration as `mm:ss`. # People Source: https://docs.taap.it/api-reference/radar/people GET https://taap.it/api/v1/radar/people List people (visitors) for the project bound to your API key Returns a paginated list of people (visitors) over the requested date range, with their key attributes (identity, location, source, device, revenue, sessions). Supports optional filters. **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/people?start=2026-01-01T00:00:00Z&end=2026-01-31T23:59:59Z&limit=50&sort=recent' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": [ { "visitorId": "v_8a1c2d", "name": "Quiet Fox", "email": "jane@example.com", "status": "identified", "countryCode": "FR", "countryName": "France", "source": "google", "browser": "Chrome", "device": "desktop", "revenue": 120.0, "sessions": 4, "events": 37, "firstSeen": "2026-01-03T09:12:00.000Z", "lastSeen": "2026-01-28T17:42:00.000Z" } ], "total": 1842, "limit": 50 } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters Start of the range, ISO 8601 (UTC). Example: `2026-01-01T00:00:00Z`. End of the range, ISO 8601 (UTC). Example: `2026-01-31T23:59:59Z`. Sort order. `recent` (last activity), `revenue`, `sessions` or `events`. Maximum number of people to return. Capped at `1000`. Filter by ISO-2 country code (e.g. `FR`). Filter by browser name (e.g. `Chrome`). Filter by device type (`desktop`, `mobile`, `tablet`). Filter by traffic source / referrer. Filter by identity status (`identified` or `anonymous`). Filter by activity level. ## Response Fields Array of people. Stable visitor identifier. Real name if known, otherwise a generated alias. Email when the visitor is identified. `identified` or `anonymous`. ISO-2 country code, or `XX` if unknown. Human-readable country name. Traffic source / referrer. Browser name. Device type. Total attributed revenue. Number of sessions. Number of events. First activity, ISO 8601. Last activity, ISO 8601. Total number of people in the range (unfiltered). Equals `data.length` when filters are applied. The effective limit applied to this response. # Person details Source: https://docs.taap.it/api-reference/radar/people-details GET https://taap.it/api/v1/radar/people/details Retrieve a single person with their sessions and activity heatmap Returns one person (visitor) with their profile, the list of sessions in the range, and a daily activity heatmap. Responses are always freshly computed (not cached). **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/people/details?visitorId=v_8a1c2d&start=2026-01-01T00:00:00Z&end=2026-01-31T23:59:59Z' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": { "visitor": { "visitorId": "v_8a1c2d", "name": "Quiet Fox", "email": "jane@example.com", "status": "identified", "countryCode": "FR", "countryName": "France", "source": "google", "browser": "Chrome", "device": "desktop", "revenue": 120.0, "sessions": 4, "firstSeen": "2026-01-03T09:12:00.000Z", "lastSeen": "2026-01-28T17:42:00.000Z" }, "sessions": [ { "sessionId": "s_5f2a", "startTime": "2026-01-28T17:10:00.000Z", "endTime": "2026-01-28T17:42:00.000Z", "durationSeconds": 1920, "referrer": "google", "device": "desktop", "browser": "Chrome", "os": "macOS" } ], "heatmap": [ { "date": "2026-01-28", "events": 12 } ] } } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters The visitor identifier returned by the [People](/api-reference/radar/people) endpoint. Start of the range, ISO 8601 (UTC). End of the range, ISO 8601 (UTC). ## Response Fields The person's profile (same shape as a row in the People endpoint). Sessions within the range. Session identifier. Session start, ISO 8601. Session end, ISO 8601. Session duration in seconds. Session source / referrer. Device type. Browser name. Operating system. Daily activity, each entry with `date` (YYYY-MM-DD) and `events` count. ```json 404 Not Found theme={null} { "error": "Visitor not found" } ``` # Realtime Source: https://docs.taap.it/api-reference/radar/realtime GET https://taap.it/api/v1/radar/realtime Retrieve the number of active visitors in a rolling window Returns the number of active visitors in a rolling window for the project bound to your API key. **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/realtime?windowMinutes=30' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": { "active_visitors": 17 } } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters Rolling window size in minutes. Must be a positive number. Defaults to `30`. ## Response Fields Number of visitors active within the window. # Time series Source: https://docs.taap.it/api-reference/radar/timeseries GET https://taap.it/api/v1/radar/timeseries Retrieve a time-bucketed series of the core Radar metrics Returns the core metrics bucketed over time for the project bound to your API key. The bucket granularity is derived automatically from the requested range. **Request:** ```bash cURL theme={null} curl -X GET 'https://taap.it/api/v1/radar/timeseries?start=2026-01-01T00:00:00Z&end=2026-01-07T23:59:59Z' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "data": [ { "t": "2026-01-01 00:00:00", "people": 120, "visits": 180, "pageviews": 540, "events": 32, "revenue": 210.0 }, { "t": "2026-01-02 00:00:00", "people": 96, "visits": 140, "pageviews": 410, "events": 21, "revenue": 0 } ] } ``` ## Authorization Bearer token with your Radar API key. Format: `Bearer taapit_...` ## Query Parameters Start of the range, ISO 8601 (UTC). Example: `2026-01-01T00:00:00Z`. End of the range, ISO 8601 (UTC). Example: `2026-01-07T23:59:59Z`. ## Response Fields An ordered array of data points. Bucket timestamp (`YYYY-MM-DD HH:MM:SS`, UTC). Unique visitors in the bucket. Sessions in the bucket. Pageviews in the bucket. Custom events in the bucket. Attributed revenue in the bucket. # Link Statistics Source: https://docs.taap.it/api-reference/stats/link-stats GET https://api.taap.it/v1/stats/links/{link_id} Retrieve detailed statistics for a specific link **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/stats/links/link_987654321?start_date=2024-01-01T00:00:00Z&end_date=2024-01-31T23:59:59Z&max_days=30' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} [ { "id": "stat_123456789", "link_id": "link_987654321", "last_updated": "2024-01-15T10:30:00Z", "click_date": "2024-01-15", "total_clicks": 45, "unique_visitors": 38, "scans_only": 5, "clicks_only": 40, "chrome_clicks": 25, "ios_clicks": 15, "android_clicks": 5, "os_stats": { "iOS": 15, "Android": 5, "Windows": 20, "macOS": 5 }, "city_stats": { "New York": 10, "Los Angeles": 8, "Toronto": 5 }, "os_version_stats": { "iOS 17.0": 10, "iOS 16.5": 5, "Android 13": 3, "Android 12": 2 }, "lang_stats": { "en": 30, "fr": 8, "es": 7 }, "device_stats": { "mobile": 28, "desktop": 15, "tablet": 2 }, "browser_stats": { "Chrome": 32, "Safari": 8, "Firefox": 3, "Edge": 2 }, "country_stats": { "US": 25, "CA": 12, "UK": 8 }, "device_and_os_stats": { "iPhone iOS": 15, "Android Phone": 5, "Windows Desktop": 20, "Mac Desktop": 5 }, "app_stats": { "Safari": 8, "Chrome Mobile": 15, "Chrome Desktop": 17 }, "device_type_stats": { "smartphone": 20, "desktop": 20, "tablet": 5 }, "from_app_stats": { "true": 8, "false": 37 }, "continent_stats": { "North America": 37, "Europe": 8 } } ] ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the link ## Query Parameters Start date for statistics (ISO 8601 format, e.g., 2024-01-01T00:00:00Z) End date for statistics (ISO 8601 format, e.g., 2024-01-31T23:59:59Z) Maximum number of days to retrieve statistics for (minimum: 1, maximum: 30) ## Response Fields Unique identifier for the statistics record Unique identifier for the link ISO 8601 timestamp when the statistics were last updated Date for the statistics (YYYY-MM-DD format) Total number of clicks on this date Number of unique visitors on this date Number of QR code scans without clicks on this date Number of direct clicks without scans on this date Number of clicks from Chrome browser on this date Number of clicks from iOS devices on this date Number of clicks from Android devices on this date Statistics broken down by operating system Number of clicks from this operating system (OS name as key) Statistics broken down by city Number of clicks from this city (city name as key) Statistics broken down by operating system version Number of clicks from this OS version (version as key) Statistics broken down by language Number of clicks from this language (language code as key) Statistics broken down by device type Number of clicks from mobile devices Number of clicks from desktop devices Number of clicks from tablet devices Statistics broken down by browser Number of clicks from this browser (browser name as key) Statistics broken down by country Number of clicks from this country (country code as key) Statistics broken down by device and operating system combination Number of clicks from this device-OS combination (device-OS as key) Statistics broken down by application Number of clicks from this application (app name as key) Statistics broken down by device type (detailed) Number of clicks from this device type (device type as key) Statistics showing clicks from apps vs web browsers Number of clicks from mobile applications Number of clicks from web browsers Statistics broken down by continent Number of clicks from this continent (continent name as key) # Link Stats Summary Source: https://docs.taap.it/api-reference/stats/link-summary GET https://api.taap.it/v1/stats/links/{link_id}/summary Get aggregated statistics for a link **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/stats/links/link_987654321/summary?start_date=2024-01-01&end_date=2024-01-31' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "link_id": "link_987654321", "total_clicks": 1250, "top_countries": [ {"name": "US", "count": 650}, {"name": "CA", "count": 280}, {"name": "UK", "count": 180} ], "top_devices": [ {"name": "mobile", "count": 750}, {"name": "desktop", "count": 400}, {"name": "tablet", "count": 100} ], "top_browsers": [ {"name": "Chrome", "count": 800}, {"name": "Safari", "count": 300}, {"name": "Firefox", "count": 100} ], "qr_code_usage": 45, "date_range": { "start": "2024-01-01", "end": "2024-01-31" } } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Path Parameters Unique identifier for the link ## Query Parameters Start date for statistics (YYYY-MM-DD format) End date for statistics (YYYY-MM-DD format) ## Response Fields Unique identifier for the link Total number of clicks on the link Array of top countries by click count Country code (ISO 3166-1 alpha-2) Number of clicks from this country Array of top devices by click count Device type (mobile, desktop, tablet) Number of clicks from this device type Array of top browsers by click count Browser name (Chrome, Safari, Firefox, etc.) Number of clicks from this browser Number of times the QR code was scanned Date range for the statistics Start date of the statistics period End date of the statistics period # Workspace Statistics Source: https://docs.taap.it/api-reference/stats/workspace-stats GET https://api.taap.it/v1/stats/workspaces Retrieve detailed statistics for your workspace **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/stats/workspaces?start_date=2024-01-01T00:00:00Z&end_date=2024-01-31T23:59:59Z&max_days=30' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} [ { "id": "ws_stat_123456789", "last_updated": "2024-01-15T10:30:00Z", "click_date": "2024-01-15", "total_clicks": 1250, "unique_visitors": 980, "scans_only": 50, "clicks_only": 1200, "chrome_clicks": 800, "ios_clicks": 400, "android_clicks": 200, "os_stats": { "iOS": 400, "Android": 200, "Windows": 500, "macOS": 150 }, "city_stats": { "New York": 200, "Los Angeles": 150, "Toronto": 100, "London": 80 }, "os_version_stats": { "iOS 17.0": 300, "iOS 16.5": 100, "Android 13": 120, "Android 12": 80 }, "lang_stats": { "en": 900, "fr": 150, "es": 100, "de": 50 }, "device_stats": { "mobile": 750, "desktop": 400, "tablet": 100 }, "browser_stats": { "Chrome": 800, "Safari": 300, "Firefox": 100, "Edge": 50 }, "country_stats": { "US": 650, "CA": 280, "UK": 180, "DE": 80 }, "device_and_os_stats": { "iPhone iOS": 400, "Android Phone": 200, "Windows Desktop": 500, "Mac Desktop": 150 }, "app_stats": { "Safari": 300, "Chrome Mobile": 400, "Chrome Desktop": 400 }, "device_type_stats": { "smartphone": 600, "desktop": 500, "tablet": 150 }, "from_app_stats": { "true": 300, "false": 950 }, "continent_stats": { "North America": 930, "Europe": 200, "Asia": 100, "Oceania": 20 } } ] ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Query Parameters Start date for statistics (ISO 8601 format, e.g., 2024-01-01T00:00:00Z) End date for statistics (ISO 8601 format, e.g., 2024-01-31T23:59:59Z) Maximum number of days to retrieve statistics for (minimum: 1, maximum: 30) ## Response Fields Unique identifier for the statistics record ISO 8601 timestamp when the statistics were last updated Date for the statistics (YYYY-MM-DD format) Total number of clicks across all workspace links on this date Number of unique visitors across all workspace links on this date Number of QR code scans without clicks across all workspace links on this date Number of direct clicks without scans across all workspace links on this date Number of clicks from Chrome browser across all workspace links on this date Number of clicks from iOS devices across all workspace links on this date Number of clicks from Android devices across all workspace links on this date Statistics broken down by operating system across all workspace links Number of clicks from this operating system (OS name as key) Statistics broken down by city across all workspace links Number of clicks from this city (city name as key) Statistics broken down by operating system version across all workspace links Number of clicks from this OS version (version as key) Statistics broken down by language across all workspace links Number of clicks from this language (language code as key) Statistics broken down by device type across all workspace links Number of clicks from mobile devices Number of clicks from desktop devices Number of clicks from tablet devices Statistics broken down by browser across all workspace links Number of clicks from this browser (browser name as key) Statistics broken down by country across all workspace links Number of clicks from this country (country code as key) Statistics broken down by device and operating system combination across all workspace links Number of clicks from this device-OS combination (device-OS as key) Statistics broken down by application across all workspace links Number of clicks from this application (app name as key) Statistics broken down by device type (detailed) across all workspace links Number of clicks from this device type (device type as key) Statistics showing clicks from apps vs web browsers across all workspace links Number of clicks from mobile applications Number of clicks from web browsers Statistics broken down by continent across all workspace links Number of clicks from this continent (continent name as key) # Workspace Stats Summary Source: https://docs.taap.it/api-reference/stats/workspace-summary GET https://api.taap.it/v1/stats/workspaces/summary Get aggregated statistics for your workspace **Request:** ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/stats/workspaces/summary?start_date=2024-01-01&end_date=2024-01-31' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` **Response:** ```json theme={null} { "total_clicks": 15750, "top_countries": [ {"name": "US", "count": 8250}, {"name": "CA", "count": 3150}, {"name": "UK", "count": 2250} ], "top_devices": [ {"name": "mobile", "count": 9450}, {"name": "desktop", "count": 5250}, {"name": "tablet", "count": 1050} ], "top_browsers": [ {"name": "Chrome", "count": 10000}, {"name": "Safari", "count": 3750}, {"name": "Firefox", "count": 1500} ], "qr_code_usage": 525, "date_range": { "start": "2024-01-01", "end": "2024-01-31" } } ``` ## Authorization Bearer token for API authentication. Format: `Bearer YOUR_API_KEY` ## Query Parameters Start date for statistics (YYYY-MM-DD format) End date for statistics (YYYY-MM-DD format) ## Response Fields Total number of clicks across all links in the workspace Array of top countries by click count across all workspace links Country code (ISO 3166-1 alpha-2) Number of clicks from this country Array of top devices by click count across all workspace links Device type (mobile, desktop, tablet) Number of clicks from this device type Array of top browsers by click count across all workspace links Browser name (Chrome, Safari, Firefox, etc.) Number of clicks from this browser Total number of QR code scans across all workspace links Date range for the statistics Start date of the statistics period End date of the statistics period # Authentication Source: https://docs.taap.it/authentication Learn how to authenticate with the taap.it API using API keys The taap.it API uses API key-based authentication to secure access to your account and resources. All API requests must include a valid API key in the Authorization header. ## API Key Overview API keys provide secure access to your taap.it account and are created through the web application dashboard. Each API key is: * **User-specific**: Tied to your user account * **Scoped**: Can have full access, read-only access, or limited permissions * **Secure**: Prefixed with `taapit_` and cryptographically generated ## Creating API Keys Log into your taap.it dashboard and navigate to your user settings. In the "API Keys" section, click "Create API Key" and provide a descriptive name. Choose the appropriate permission level for your use case: * **Full Access**: Complete read/write access to all resources * **Read Only**: View-only access to all resources * **Limited Access**: Custom permissions for specific resources Copy the generated API key immediately and store it securely. API keys are only displayed once during creation. If lost, you'll need to generate a new key. ## Using API Keys Include your API key in the Authorization header using the Bearer token format: ```http theme={null} Authorization: Bearer taapit_your_api_key_here ``` ### Example Requests ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/workspaces' \ -H 'Authorization: Bearer taapit_abc123def456ghi789' \ -H 'Content-Type: application/json' ``` ```javascript JavaScript theme={null} const response = await fetch('https://api.taap.it/v1/workspaces', { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' } }); ``` ```python Python theme={null} import requests headers = { 'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json' } response = requests.get('https://api.taap.it/v1/workspaces', headers=headers) ``` ```php PHP theme={null} ['header' => implode("\r\n", $headers)]]) ); ?> ``` ## Permission Levels API keys can have different permission levels that control access to resources: ### Full Access Grants complete read and write access to all resources and endpoints. * **Use case**: Server-to-server integrations, administrative tools * **Permissions**: All read and write operations * **Security**: High - monitor usage carefully ### Read Only Provides view-only access to all resources without modification capabilities. * **Use case**: Analytics dashboards, reporting tools * **Permissions**: GET operations only * **Security**: Medium - data exposure limited to viewing ### Limited Access Custom permissions allow granular control over specific resources and operations. * **Use case**: Third-party integrations with specific needs * **Permissions**: Configurable per resource (domains, links, projects, workspaces, analytics) * **Security**: High - minimal necessary permissions ## Security Best Practices * Store API keys in environment variables, not in code * Use secure key management services for production * Never commit API keys to version control * Rotate keys regularly for enhanced security * Use the principle of least privilege * Create separate keys for different environments * Monitor API key usage and set up alerts * Deactivate unused or compromised keys immediately * Always use HTTPS for API requests * Implement proper error handling * Use IP whitelisting when possible * Monitor for suspicious activity ## Error Handling ### Authentication Errors ```json 401 Unauthorized theme={null} { "detail": "Invalid API key" } ``` ```json 403 Forbidden theme={null} { "detail": "Insufficient permissions for this operation" } ``` ### Common Authentication Issues * Verify the key is copied correctly * Check that the key hasn't been deactivated * Ensure you're using the full key including the `taapit_` prefix * Check if your API key has the required permissions * Verify you're trying to access resources you own * Consider upgrading to a key with full access * Monitor your request frequency * Implement exponential backoff * Check the rate limit headers in responses ## Migration Guide If you're migrating from another authentication method or upgrading your integration: Generate a new API key with appropriate permissions for your use case. Update your application to use the new API key and test thoroughly. Once confirmed working, deactivate any old authentication credentials. Follow our quickstart guide to make your first authenticated API call. # Shopify Source: https://docs.taap.it/conversions/automatic/shopify Automatic conversion tracking for Shopify stores — add a script tag and configure webhooks The Taapit Shopify integration provides **fully automatic** conversion tracking with no app to install. Add one script tag to your theme, configure three webhooks, and every checkout and order is automatically attributed to your Taapit links. ## How it works Taapit Shopify integration ## Features * ✅ **No app required** – Just a script tag and webhooks * ✅ **Automatic tracking** – Every checkout and order is tracked * ✅ **Full attribution** – Works across sessions (90-day cookie) * ✅ **Real-time sync** – Events appear instantly * ✅ **Multi-currency** – Supports all Shopify currencies ## Prerequisites **Important**: For conversion tracking to work, users must arrive on your store via a **Taapit deeplink**. This is how the tracking ID (`ta_tid`) is generated and passed to your store. **Hide the "Buy Now" button**: The Buy Now (accelerated checkout) button bypasses the cart and goes directly to payment — this flow **cannot be tracked**. You must disable it in your theme so all customers go through the standard Add to Cart → Checkout flow. To hide it: open your theme editor → select a product page section → find **Dynamic checkout buttons** and uncheck it, then save. Before you start: 1. **Create a Taapit deeplink** pointing to your Shopify store or a product page 2. **Enable conversion tracking** on your link in the Taapit dashboard ## Installation Copy this script tag: ```html theme={null} ``` Then add it to your theme: 1. In Shopify Admin, go to **Online Store** → **Themes** 2. Click **Customize** → **Edit code** on your active theme 3. Open the **theme.liquid** file 4. Paste the script just before the `` closing tag, then save The script captures the `ta_tid` tracking ID from Taapit links and stores it in a cookie and localStorage for 90 days. It also attaches the tracking ID to cart attributes so it survives through to the order. You need to create **3 webhooks** in Shopify pointing to your Taapit webhook URL. Your webhook URL (found in your Taapit dashboard under Settings → Analytics → Shopify): ``` https://track.taap.it/api/shopify/webhook?workspaceId=YOUR_WORKSPACE_ID ``` **Steps to configure in Shopify:** 1. In Shopify Admin, go to **Settings** → **Notifications** 2. Scroll down to the **Webhooks** section and click **Create webhook** 3. Choose an event: **Order payment** → paste the webhook URL → save 4. Repeat for **Checkout creation** 5. Repeat for **Checkout update** You must create **3 separate webhooks** with the same URL: * `orders/paid` → tracks a **Sale** event * `checkouts/create` → tracks a **Lead** event * `checkouts/update` → updates the Lead if the cart changes Your workspace ID is already included in the URL shown in your dashboard. 1. Visit your store from a Taapit link (you should see `?ta_tid=xxx` in the URL) 2. Check browser DevTools → Application → Cookies for `ta_tid` 3. Add a product to the cart and proceed to checkout 4. Check the **Analytics** tab in Taapit — a Lead event should appear 5. Complete a test order — a Sale event should appear ## How Tracking Works 1. **Visitor arrives** via Taapit link with `?ta_tid=xxx` 2. **Script captures** the `ta_tid` and stores it in a cookie and localStorage 3. **Script adds** the tracking ID to cart attributes (persists through checkout) 4. **Customer clicks Checkout** — the tracking ID is forwarded via cart attributes 5. **Order webhook** sends order details + tracking ID to Taapit 6. **Conversion recorded** and attributed to the original link This flow only works if the customer goes through the **standard cart checkout**. The Buy Now (accelerated checkout) button bypasses the cart, so the tracking ID is never attached. Make sure to disable it in your theme. ## Tracked Events | Shopify Event | Taapit Event | When | | ------------------ | ------------ | ------------------------ | | `checkouts/create` | Lead | Customer starts checkout | | `checkouts/update` | Lead update | Cart is modified | | `orders/paid` | Sale | Order is paid | ## Troubleshooting Make sure you are visiting the store from a Taapit link that contains `?ta_tid=xxx` in the URL. The script only sets the cookie when this parameter is present. 1. Check that the script tag is present in your theme.liquid (before ``) 2. Check that all 3 webhooks are correctly configured with your workspace ID 3. Check that the Buy Now button is hidden — orders placed through it cannot be tracked 4. Verify the `ta_tid` cookie is set in your browser DevTools Works with all Shopify themes that allow editing theme.liquid. For headless setups (Hydrogen, custom storefronts), use the [Manual Client-side Integration](/conversions/manual/client-side) instead. ## Next Steps Also using Stripe? Add the Stripe integration. Create a Taapit link to start tracking. # Stripe Source: https://docs.taap.it/conversions/automatic/stripe Automatic conversion tracking for Stripe payments The Taapit Stripe integration automatically tracks all your Stripe payments as sales conversions. Just install the SDK, connect the app, and pass the tracking ID to Stripe. ## How it works Taapit Visual Stripe integration ## Prerequisites **Important**: For conversion tracking to work, users must arrive on your website via a **Taapit deeplink**. This is how the tracking ID (`ta_tid`) is generated and passed to your site. Before you start: 1. **Create a Taapit deeplink** pointing to your website or landing page 2. **Enable conversion tracking** on your link: * Go to your link settings in the Taapit dashboard * Enable **Conversion Tracking** 3. **Configure Stripe integration** in [Settings → Conversion](https://taap.it/dashboard/settings/conversion) and select **Stripe Integration** ```mermaid theme={null} flowchart LR A[User clicks Taapit link] --> B[Lands on your site with ta_tid] B --> C[SDK stores ta_tid in cookie] C --> D[User makes purchase] D --> E[ta_tid sent to Stripe] E --> F[Taapit tracks conversion] ``` ## Installation First, add the Taapit SDK to your website to capture the `ta_tid` tracking ID: ```bash theme={null} npm install taapit-sdk ``` Then add the Analytics component to your root layout: ```tsx app/layout.tsx theme={null} import { Analytics } from 'taapit-sdk/react'; export default function RootLayout({ children }) { return ( {children} ); } ``` Add this script to your HTML `` or before ``: ```html theme={null} ``` This step is **required**. Without the SDK, the `ta_tid` won't be captured and conversions can't be tracked. 1. Go to the [Stripe App Marketplace](https://marketplace.stripe.com/) 2. Search for "Taapit Conversion" 3. Click **Install** Or install directly from your Taapit dashboard: 1. Go to **Settings** → **Integrations** → **Stripe** 2. Click **Install Stripe Integration** After installing the app in Stripe: **1. Open the Taapit app in your Stripe dashboard and click "Connect workspace"** Taapit Stripe App - Connect workspace button **2. Authorize the connection to your Taapit workspace** You will be redirected to the Taapit consent page. Select the workspace you want to connect and click **Authorize**. Taapit consent page **3. Verify the workspace is connected** Once authorized, you will see your workspace connected in the Stripe app. Taapit Stripe App - Workspace connected Pass the `ta_tid` to Stripe when creating customers, checkout sessions, or payment intents. ### 1. Frontend: Get the tracking ID First, retrieve the tracking ID from your frontend to pass it to your API: ```typescript theme={null} // Using the taapit global object (script tag) const trackingId = taapit.getTrackingId(); ``` ```tsx theme={null} import { useTaapitAnalytics } from 'taapit-sdk/react'; function CheckoutButton() { const { trackingId } = useTaapitAnalytics(); const handleCheckout = async () => { const response = await fetch('/api/create-checkout', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ priceId: 'price_xxx', trackingId, }), }); const { url } = await response.json(); window.location.href = url; }; return ; } ``` ```typescript theme={null} // Read directly from cookie const trackingId = document.cookie .split('; ') .find(row => row.startsWith('ta_tid=')) ?.split('=')[1]; ``` The tracking ID can be retrieved from: 1. **Taapit SDK** - `taapit.getTrackingId()` or `useTaapitAnalytics()` hook 2. **Cookie** (`ta_tid`) - automatically set by the SDK The backend should check both the request body and cookies for maximum compatibility. *** ### 2. Track Sales: Create a Checkout Session When a user makes a purchase, pass the tracking ID in the checkout session metadata. **When is `taapitTrackingId` required for Checkout Sessions?** * If the customer was **already tracked via a lead event** (using `taapitCustomerExternalId`), the `taapitTrackingId` is **optional** - you only need to pass `taapitCustomerExternalId` to link the sale. * If this is a **new customer** (no prior lead), `taapitTrackingId` is **required** to attribute the sale. ```typescript app/api/create-checkout/route.ts theme={null} import { NextRequest } from 'next/server'; import Stripe from 'stripe'; const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!); export async function POST(request: NextRequest) { const body = await request.json(); const { priceId, customerExternalId } = body; // Get tracking ID from cookie OR from request body // Optional if customer already tracked via lead const trackingId = request.cookies.get('ta_tid')?.value || body.trackingId || ''; const session = await stripe.checkout.sessions.create({ mode: 'subscription', line_items: [{ price: priceId, quantity: 1 }], success_url: 'https://yoursite.com/success', cancel_url: 'https://yoursite.com/cancel', // Pass tracking ID and customer ID in metadata metadata: { taapitTrackingId: trackingId, // Optional if customer exists taapitCustomerExternalId: customerExternalId, // Required }, // Also in subscription_data for subscriptions subscription_data: { metadata: { taapitTrackingId: trackingId, taapitCustomerExternalId: customerExternalId, }, }, }); return Response.json({ url: session.url }); } ``` *** ### 3. (Optional) Track Leads: Create a Stripe Customer If you want to track leads separately from sales, create a Stripe customer with the tracking ID when a user signs up. Taapit listens to the `customer.created` webhook. ```typescript app/api/stripe/create-customer/route.ts theme={null} import { NextRequest } from 'next/server'; import Stripe from 'stripe'; const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!); export async function POST(request: NextRequest) { const body = await request.json(); const { email, name, externalId } = body; // Get tracking ID from cookie OR from request body const trackingId = request.cookies.get('ta_tid')?.value || body.trackingId || ''; // Create Stripe customer with Taapit metadata const customer = await stripe.customers.create({ email, name, metadata: { taapitTrackingId: trackingId, taapitCustomerExternalId: externalId, // Your internal user ID }, }); return Response.json({ customerId: customer.id }); } ``` This step is **optional**. Use it if you want to track user signups as leads before they make a purchase. *** ### 4. (Alternative) Using Stripe Payment Links If you're using [Stripe Payment Links](https://stripe.com/docs/payment-links), you can track sales automatically without writing any backend code. With Payment Links, only **sale events** are tracked. Lead webhooks are not created. **How to set it up:** 1. Get your Stripe Payment Link URL (e.g., `https://buy.stripe.com/xxx`) 2. Add `?taapit_client_reference_id=1` to the URL: ``` https://buy.stripe.com/xxx?taapit_client_reference_id=1 ``` 3. Shorten this URL with Taapit **How it works:** When a user clicks on your Taapit deeplink, Taapit automatically: 1. Replaces `taapit_client_reference_id=1` with `client_reference_id=taapit_tid_{trackingId}` 2. Stripe receives the tracking ID as `client_reference_id` 3. When checkout completes, Taapit attributes the sale to the original click 1. Go to **Settings** → **Integrations** → **Stripe** in Taapit 2. You should see **Connected** status 3. Make a test payment 4. Check the **Analytics** tab for the conversion ## Tracked Events The Stripe integration automatically tracks these events: | Stripe Event | Taapit Event | Description | | ---------------------------- | ------------ | --------------------------------------- | | `customer.created` | Lead | Customer created with tracking metadata | | `checkout.session.completed` | Sale | Checkout session completed | | `invoice.paid` | Sale | Subscription invoice paid | ## Metadata Fields The integration looks for these metadata fields on Stripe objects: | Field | Required | Description | | -------------------------- | --------- | ------------------------------------------ | | `taapitTrackingId` | See below | The tracking ID (`ta_tid` from the cookie) | | `taapitCustomerExternalId` | Yes | Your internal user ID | Use `taapitTrackingId` (not `ta_tid`) in Stripe metadata. The `ta_tid` is the cookie name, while `taapitTrackingId` is the metadata field name. **When is `taapitTrackingId` required?** - **Lead events** (`customer.created`): `taapitTrackingId` is **always required** - **Sale events** (`checkout.session.completed`, `invoice.paid`): - If the customer was **already tracked via a lead event** (using `taapitCustomerExternalId`), the `taapitTrackingId` is **optional** - you only need the `taapitCustomerExternalId` - If this is a **new customer** (no prior lead), `taapitTrackingId` is **required** to attribute the sale ## Troubleshooting 1. **Check metadata**: Ensure `taapitTrackingId` is in your Stripe metadata 2. **Verify webhook delivery**: In Stripe → Developers → Webhooks 3. **Check connection**: Settings → Integrations → Stripe should show "Connected" If the tracking ID is empty, the user either: - Didn't come from a Taapit link - Has cookies blocked - Cookie wasn't passed to checkout This is normal for organic/direct traffic. ## Security | Permission | Purpose | | ----------------------- | ------------------------------ | | `customer_read` | Read customer information | | `subscription_read` | Read subscription data | | `invoice_read` | Read invoice amounts | | `checkout_session_read` | Read checkout session metadata | | `webhook_read` | Receive payment events | ## FAQ Yes, you need the Taapit SDK on your website to capture the `ta_tid` cookie. The Stripe app only handles payment tracking. Each `invoice.paid` event triggers a sale. The tracking ID from the original checkout is used for attribution. Currently, refunds are not automatically tracked. We're working on this feature. ## Next Steps Set up automatic tracking for Shopify stores. For custom payment flows. # How Conversions Work Source: https://docs.taap.it/conversions/how-conversions-work Understand the conversion tracking flow from click to conversion Taapit Conversion Tracking enables you to attribute leads and sales to the deeplinks that drove them. This allows you to measure the true ROI of your marketing campaigns. ## The Conversion Flow Taapit Visual manual integration ## Key Concepts ### 1. Tracking ID (`ta_tid`) When a user clicks on a Taapit deeplink, we generate a unique tracking ID and append it to your destination URL: ``` https://yoursite.com/landing?ta_tid=rLnWe1uz9t282v7g ``` This ID links the click to any future conversions. It's: * **Unique per click** – Each click gets its own ID * **Persistent** – Stored in a cookie * **Privacy-friendly** – Contains no personal information Learn more about [the tracking ID](/conversions/tracking-id). ### 2. Lead Events A **lead** is a potential customer who has shown interest. Examples: * User signs up for an account * User submits a contact form * User starts a free trial * User subscribes to a newsletter Lead tracking requires: * `trackingId` – The `ta_tid` from the cookie * `customer.externalId` – Your internal user ID ### 3. Sale Events A **sale** is a completed transaction. Examples: * One-time purchase * Subscription payment * Upgrade to paid plan * In-app purchase Sale tracking requires: * `trackingId` – The `ta_tid` from the cookie * `customer.externalId` – Your internal user ID * `amount` – Transaction amount in currency units (e.g., 29.99) * `currency` – ISO 4217 currency code (e.g., `eur`, `usd`) ### 4. Customer Object Both lead and sale events include a customer object to identify the user: ```json theme={null} { "customer": { "externalId": "user_123", // Required: Your internal user ID "email": "john@example.com", // Optional: User's email "firstname": "John", // Optional: First name "lastname": "Doe", // Optional: Last name "phoneNumber": "+33612345678", // Optional: Phone number "avatarUrl": "https://..." // Optional: Avatar URL } } ``` The `externalId` is required and should be your internal user ID. This is used to deduplicate conversions and track customer lifetime value. ## Attribution Model Taapit uses **last-click attribution**: * If a user clicks multiple Taapit links before converting, the conversion is attributed to the **most recent click** * The cookie window ensures long sales cycles are captured * Each new click updates the tracking ID ## Conversion Types Comparison | Feature | Lead | Sale | | ----------- | ---------------- | ------------------- | | Tracking ID | Required | Required | | Customer ID | Required | Required | | Amount | Not applicable | Required | | Currency | Not applicable | Required | | Metadata | Optional | Optional | | Use case | Sign-ups, trials | Purchases, payments | ## Integration Methods Choose the integration method that best fits your stack: ### Native Integrations (Zero Code) | Integration | Best for | Setup time | | -------------------------------------------- | ------------------- | ---------- | | [Stripe](/conversions/integrations/stripe) | SaaS, subscriptions | 2 minutes | | [Shopify](/conversions/integrations/shopify) | E-commerce stores | 2 minutes | ### SDK Integrations | Method | Best for | Reliability | | ------------------------------------------------------- | ---------------- | ----------- | | [Client-side SDK](/conversions/track-leads) | Simple setups | Good | | [Server-side SDK](/conversions/track-leads#server-side) | Maximum accuracy | Excellent | ### API Integrations | Method | Best for | Flexibility | | -------------------------------------- | ------------------- | ----------- | | [REST API](/conversions/api-reference) | Custom integrations | Maximum | ## Data Flow ### Client-side Flow ``` Browser → Taapit API → Your Dashboard ``` 1. Browser reads `ta_tid` from cookie 2. SDK sends event to Taapit API 3. Data appears in your dashboard **Pros:** Simple setup, no backend changes\ **Cons:** Can be blocked by ad blockers ### Server-side Flow ``` Browser → Your Backend → Taapit API → Your Dashboard ``` 1. Browser sends `ta_tid` to your backend (cookie or form field) 2. Your backend sends event to Taapit API 3. Data appears in your dashboard **Pros:** Cannot be blocked, more reliable\ **Cons:** Requires backend integration ## Privacy & Compliance Taapit is designed with privacy in mind: * **No personal data in tracking ID** – `ta_tid` is a random string * **First-party cookies** – Set on your domain, not blocked by browsers * **GDPR compliant** – No cross-site tracking * **Data ownership** – You own your conversion data ## Next Steps Learn how to retrieve the ta\_tid in your application. Start tracking lead conversions. # Client-side Integration Source: https://docs.taap.it/conversions/manual/client-side Track conversions directly from your frontend using the NPM package or script tag Track leads and sales directly from the browser. This method is simple to implement but can be blocked by ad blockers. Client-side tracking can be **blocked by ad blockers**. For maximum reliability, we strongly recommend [Server-side Integration](/conversions/manual/server-side) instead. ## Prerequisites **Important**: For conversion tracking to work, users must arrive on your website via a **Taapit deeplink**. This is how the tracking ID (`ta_tid`) is generated and passed to your site. Before you start: 1. **Create a Taapit deeplink** pointing to your website or landing page 2. **Enable conversion tracking** on your link: * Go to your link settings in the Taapit dashboard * Enable **Conversion Tracking** Then, configure your Taapit workspace: 1. In your Taapit dashboard, go to [Settings → Conversion](https://taap.it/dashboard/settings/conversion) 2. In the dropdown, select **Manual Client-side Integration** 1. In the **Allowed Hostnames** section, add your website domains (e.g., `example.com`, `www.example.com`) 2. Click **Save** The SDK will only work on domains listed in your allowed hostnames. Don't forget to add both `www` and non-`www` versions if needed. 1. Copy your **Publishable Key** (starts with `taapit_pk_`) 2. You'll use this key in the next steps If you don't have a publishable key yet, click **Generate Key** to create one. ## Installation Choose your preferred method: ```bash theme={null} npm install taapit-sdk ``` Add the `Analytics` component to your root layout to automatically capture the `ta_tid`: ```tsx app/layout.tsx theme={null} import { Analytics } from 'taapit-sdk/react'; export default function RootLayout({ children }) { return ( {children} ); } ``` Get your publishable key from the [Taapit Dashboard](https://taap.it/dashboard/settings/analytics). Add this script to your HTML `` or before ``: ```html theme={null} ``` The script automatically: * Captures the `ta_tid` from the URL when users arrive * Stores it in a cookie for 365 days * Exposes the global `taapit` object **Alternative methods:** ```html theme={null} ``` ## Track a Lead A **lead** is a potential customer who shows interest (sign-up, form submission, trial start). **`trackingId` for leads**: The `trackingId` is **always required** for lead events. It is automatically detected from the `ta_tid` cookie set when the user clicked a Taapit link. ```tsx components/signup-form.tsx theme={null} 'use client'; import { useTaapitAnalytics } from 'taapit-sdk/react'; export function SignUpForm() { const { trackLead, isReady, trackingId } = useTaapitAnalytics(); const handleSubmit = async (formData: FormData) => { const email = formData.get('email') as string; const name = formData.get('name') as string; // Create user in your system const user = await createUser({ email, name }); // Track the lead with Taapit trackLead({ customer: { externalId: user.id, // Required: your user ID email: user.email, firstname: user.firstName, lastname: user.lastName, }, metadata: { source: 'signup-form', plan: 'free-trial', }, }); }; return (
); } ``` ### Direct import (alternative) ```tsx theme={null} import { taapit } from 'taapit-sdk/react'; export function SignUpButton() { const handleClick = async () => { const user = await signUp(); taapit.trackLead({ customer: { externalId: user.id, email: user.email }, }); }; return ; } ```
```html theme={null} ```
## Track a Sale A **sale** is a completed transaction (purchase, subscription, payment). **`trackingId` for sales**: If the customer was already tracked via a **lead event**, the `trackingId` is optional. You only need the `customerExternalId` to link the sale to the existing customer. If this is a **new customer** (no prior lead), the user must have a valid `ta_tid` cookie (set by clicking a Taapit link). ```tsx components/checkout.tsx theme={null} 'use client'; import { useTaapitAnalytics } from 'taapit-sdk/react'; export function CheckoutButton({ cart, user }) { const { trackSale } = useTaapitAnalytics(); const handlePurchase = async () => { // Process payment const order = await processPayment(cart); // Track the sale with Taapit trackSale({ customer: { externalId: user.id, email: user.email, }, amount: cart.total, // e.g., 49.99 (NOT cents) currency: 'eur', // ISO 4217 code metadata: { orderId: order.id, items: cart.items.length, }, }); router.push(`/order/${order.id}`); }; return ( ); } ``` ```html theme={null} ``` The `amount` must be in **currency units**, not cents. - ✅ `amount: 29.99` for €29.99 - ❌ `amount: 2999` (this would be €2999) ## Available Methods ```javascript theme={null} // Get the current tracking ID const trackingId = taapit.getTrackingId(); // Track a lead (trackingId is ALWAYS required - auto-detected from cookie) taapit.trackLead({ customer: { externalId: 'user_123', // Required email: 'john@example.com', firstname: 'John', lastname: 'Doe', phoneNumber: '+33612345678', avatarUrl: 'https://example.com/avatar.jpg', }, metadata: { ... }, // Optional custom data }); // Track a sale // trackingId is optional if customer was already tracked via a lead event taapit.trackSale({ customer: { externalId: 'user_123' }, // Required - links to existing customer amount: 99.99, // Required currency: 'eur', // Required (ISO 4217) metadata: { ... }, }); ``` ## Best Practices ### 1. Always track after confirmation ```typescript theme={null} // ✅ Good - Track after action is confirmed const user = await createUser(data); taapit.trackLead({ customer: { externalId: user.id } }); // ❌ Bad - Track before confirmation taapit.trackLead({ customer: { externalId: "pending" } }); const user = await createUser(data); // Might fail! ``` ### 2. Handle missing tracking IDs gracefully ```typescript theme={null} const trackingId = taapit.getTrackingId(); if (trackingId) { taapit.trackLead({...}); } // Continue with your flow even without tracking ``` ### 3. Use stable external IDs ```typescript theme={null} // ✅ Good - Use your database ID customer: { externalId: user.id; } // ❌ Bad - Don't use transient values customer: { externalId: session.id; } ``` ## Limitations * **Ad blockers** may block tracking requests * **Browser restrictions** can prevent cookies from being set * **Page close** before tracking completes loses the event For critical conversions like sales, consider [Server-side Integration](/conversions/manual/server-side). ## Next Steps More reliable tracking from your backend (recommended). Full API documentation. # Server-side Integration (Recommended) Source: https://docs.taap.it/conversions/manual/server-side Track conversions from your backend for maximum reliability Server-side tracking is the **recommended method** for conversion tracking because it: * ✅ **Can't be blocked** by ad blockers * ✅ **Guarantees delivery** of tracking events * ✅ **Confirms actions** before tracking (e.g., payment verified) * ✅ **Works with webhooks** from payment providers ## How It Works Taapit Visual manual integration ## Prerequisites **Important**: For conversion tracking to work, users must arrive on your website via a **Taapit deeplink**. This is how the tracking ID (`ta_tid`) is generated and passed to your site. Before you start: 1. **Create a Taapit deeplink** pointing to your website or landing page 2. **Enable conversion tracking** on your link: * Go to your link settings in the Taapit dashboard * Enable **Conversion Tracking** 3. **Get your Secret Key** from [Settings → Conversion](https://taap.it/dashboard/settings/conversion) in your Taapit dashboard Never expose your **secret key** in client-side code. Use it only on your server. ## Installation Even for server-side tracking, you **must** install the SDK on your frontend to capture the `ta_tid` cookie. ### Step 1: Frontend - Install the SDK ```bash theme={null} npm install taapit-sdk ``` Add the Analytics component to capture `ta_tid`: ```tsx app/layout.tsx theme={null} import { Analytics } from "taapit-sdk/react"; export default function RootLayout({ children }) { return ( {children} ); } ``` ### Step 2: Backend - Set up your API key ```bash .env theme={null} TAAPIT_API_KEY=taapit_sk_xxx ``` Never expose your secret API key in client-side code. ### Step 3: Backend - Track conversions ```typescript app/api/signup/route.ts theme={null} import { Taapit } from "taapit-sdk"; import { cookies } from "next/headers"; const taapit = new Taapit({ apiKey: process.env.TAAPIT_API_KEY, }); export async function POST(request: Request) { const body = await request.json(); // Get tracking ID from cookie const cookieStore = cookies(); const trackingId = cookieStore.get("ta_tid")?.value; // Create user in your database const user = await db.users.create({ email: body.email, name: body.name, }); // Track the lead if (trackingId) { await taapit.track.lead({ trackingId, customer: { externalId: user.id, email: user.email, }, }); } return Response.json({ user }); } ``` ### Step 1: Frontend - Add the script ```html theme={null} ``` ### Step 2: Frontend - Send tracking ID to backend ```html theme={null} ``` ### Step 3: Backend - Call the REST API ```bash theme={null} curl -X POST https://track.taap.it/api/events/lead \ -H "Authorization: Bearer taapit_sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "trackingId": "rLnWe1uz9t282v7g", "customer": { "externalId": "user_123", "email": "john@example.com" } }' ``` ## Track a Lead ```typescript theme={null} import { Taapit } from 'taapit-sdk'; import { cookies } from 'next/headers'; const taapit = new Taapit({ apiKey: process.env.TAAPIT_API_KEY }); export async function POST(request: Request) { const body = await request.json(); const cookieStore = cookies(); const trackingId = cookieStore.get('ta_tid')?.value || body.trackingId; // Create user const user = await createUser(body); // Track lead if (trackingId) { const result = await taapit.track.lead({ trackingId, customer: { externalId: user.id, email: user.email, firstname: body.firstName, lastname: body.lastName, }, metadata: { source: 'signup-api', plan: body.plan, }, }); if (!result.success) { console.error('Failed to track lead:', result.error); } } return Response.json({ user }); } ``` ```python theme={null} import requests def track_lead(tracking_id: str, user: dict): response = requests.post( 'https://track.taap.it/api/events/lead', headers={ 'Authorization': f'Bearer {TAAPIT_API_KEY}', 'Content-Type': 'application/json', }, json={ 'trackingId': tracking_id, 'customer': { 'externalId': user['id'], 'email': user['email'], 'firstname': user.get('first_name'), 'lastname': user.get('last_name'), }, }, ) return response.json() ``` ```php theme={null} true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . TAAPIT_API_KEY, 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode([ 'trackingId' => $trackingId, 'customer' => [ 'externalId' => $user['id'], 'email' => $user['email'], ], ]), ]); $response = curl_exec($ch); return json_decode($response, true); } ``` ```ruby theme={null} require 'net/http' require 'json' def track_lead(tracking_id, user) uri = URI('https://track.taap.it/api/events/lead') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Post.new(uri.path) request['Authorization'] = "Bearer #{TAAPIT_API_KEY}" request['Content-Type'] = 'application/json' request.body = { trackingId: tracking_id, customer: { externalId: user[:id], email: user[:email] } }.to_json response = http.request(request) JSON.parse(response.body) end ``` ```go theme={null} func trackLead(trackingID string, user User) error { payload := map[string]interface{}{ "trackingId": trackingID, "customer": map[string]string{ "externalId": user.ID, "email": user.Email, }, } body, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", "https://track.taap.it/api/events/lead", bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Content-Type", "application/json") client := &http.Client{} resp, err := client.Do(req) if err != nil { return err } defer resp.Body.Close() return nil } ``` ## Track a Sale **`trackingId` for sales**: If the customer was already tracked via a **lead event**, the `trackingId` is optional for sale events. You only need to provide the `customerExternalId` to link the sale to the existing customer. If this is a **new customer** (no prior lead), `trackingId` is required. ```typescript theme={null} export async function POST(request: Request) { const body = await request.json(); const cookieStore = cookies(); const trackingId = cookieStore.get('ta_tid')?.value || body.trackingId; // Verify payment const order = await verifyPayment(body); // Track sale // trackingId is optional if customer was already tracked via a lead event await taapit.track.sale({ trackingId, // Optional if customer already exists customer: { externalId: order.userId, // Required - links to existing customer or creates new one email: order.customerEmail, }, amount: order.total, // e.g., 149.99 (NOT cents) currency: order.currency, // e.g., 'eur' metadata: { orderId: order.id, productIds: order.items.map(i => i.productId), }, }); return Response.json({ success: true }); } ``` ```bash theme={null} # With trackingId (new customer or first-time tracking) curl -X POST https://track.taap.it/api/events/sale \ -H "Authorization: Bearer taapit_sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "trackingId": "rLnWe1uz9t282v7g", "customer": { "externalId": "user_123", "email": "john@example.com" }, "amount": 99.99, "currency": "eur", "metadata": { "orderId": "order_456" } }' # Without trackingId (customer already tracked via lead event) curl -X POST https://track.taap.it/api/events/sale \ -H "Authorization: Bearer taapit_sk_xxx" \ -H "Content-Type: application/json" \ -d '{ "customer": { "externalId": "user_123" }, "amount": 99.99, "currency": "eur" }' ``` The `amount` must be in **currency units**, not cents. * ✅ `amount: 29.99` for €29.99 * ❌ `amount: 2999` (this would be €2999) ## API Reference ### Endpoints | Event | Endpoint | | ----- | -------------------------------------------- | | Lead | `POST https://track.taap.it/api/events/lead` | | Sale | `POST https://track.taap.it/api/events/sale` | ### Authentication ``` Authorization: Bearer taapit_sk_xxx ``` ### Request Body ```json theme={null} { "trackingId": "rLnWe1uz9t282v7g", "customer": { "externalId": "user_123", "email": "john@example.com", "firstname": "John", "lastname": "Doe", "phoneNumber": "+33612345678", "avatarUrl": "https://example.com/avatar.jpg" }, "amount": 99.99, // Sale only "currency": "eur", // Sale only "metadata": {} } ``` | Field | Type | Required | Description | | --------------------- | ------ | --------- | ---------------------------- | | `trackingId` | string | See below | The `ta_tid` from cookie/URL | | `customer.externalId` | string | Yes | Your internal user ID | | `customer.email` | string | No | User's email | | `amount` | number | Sale only | Amount in currency units | | `currency` | string | Sale only | ISO 4217 code (eur, usd...) | | `metadata` | object | No | Custom data | **When is `trackingId` required?** - **Lead events**: `trackingId` is **always required** - **Sale events**: - If the `customerExternalId` was already tracked (via a previous lead event), `trackingId` is **optional** - If this is a new customer (no prior lead event), `trackingId` is **required** to create the customer record ### Response ```json theme={null} { "ok": true } ``` ## Best Practices ### 1. Get tracking ID from multiple sources ```typescript theme={null} const cookieStore = cookies(); const trackingId = cookieStore.get("ta_tid")?.value || // Cookie (preferred) body.trackingId || // Request body new URL(request.url).searchParams.get("ta_tid"); // URL param ``` ### 2. Always track after confirmation ```typescript theme={null} // ✅ Good - Track after payment is confirmed const paymentResult = await processPayment(); if (paymentResult.success) { await taapit.track.sale({...}); } // ❌ Bad - Track before confirmation await taapit.track.sale({...}); const paymentResult = await processPayment(); // Might fail! ``` ### 3. Store tracking ID for later use ```typescript theme={null} // When creating checkout session const session = await stripe.checkout.sessions.create({ metadata: { ta_tid: trackingId }, // Store for webhook }); // Later in webhook, retrieve it const trackingId = session.metadata.ta_tid; ``` ### 4. Log tracking failures ```typescript theme={null} const result = await taapit.track.sale({...}); if (!result.success) { console.error('Taapit tracking failed:', result.error); // Don't fail the main operation - tracking is secondary } ``` ## Next Steps Automatic tracking for Stripe (even simpler). Full API documentation for leads. Full API documentation for sales. # Overview Source: https://docs.taap.it/conversions/overview Track leads and sales from your Taapit deeplinks Taapit Conversions allows you to track leads and sales from your deeplinks, enabling you to measure the ROI of your marketing campaigns. ## How it works Taapit Visual manual integration 1. A user clicks on your Taapit deeplink 2. Taapit redirects them to your website with a `ta_tid` parameter 3. The tracking ID is stored in a cookie 4. When the user converts (signs up, purchases, etc.), the conversion is sent to Taapit ## Choose your integration method There are **4 ways** to integrate Taapit Conversions: **Semi-automatic** – Install the SDK, pass tracking ID in Stripe metadata. **Automatic** – Install the app, enable the theme extension. Zero code. **Manual** – Track conversions from your frontend with JavaScript. **Manual** – Track from your backend for maximum reliability. ## Which method should I use? | Method | Best for | Pros | Cons | | --------------- | ------------------- | ------------------------------- | ----------------------------- | | **Stripe** | SaaS, subscriptions | Automatic tracking via webhooks | Requires passing metadata | | **Shopify** | E-commerce stores | Zero code, fully automatic | Shopify only | | **Client-side** | Quick setup | Easy to implement | Can be blocked by ad blockers | | **Server-side** | Production apps | Reliable, can't be blocked | Requires backend code | For most production applications, we recommend **Server-side integration** for maximum reliability, or one of the **Automatic integrations** if you use Stripe or Shopify. # taap.it API Documentation Source: https://docs.taap.it/index Powerful link management and analytics API for developers # Welcome to taap.it API The **taap.it API** provides powerful programmatic access to our link management and analytics platform. Create, manage, and track deeplinks with enterprise-grade features and detailed analytics. Get up and running with your first API call in under 5 minutes Secure API key authentication with granular permissions Complete documentation for all endpoints and features Detailed insights and performance metrics for your links ## Key Features * Create deeplinks with custom codes and domains * Password protection and expiration settings * UTM parameter templates and tracking pixels * Bulk operations and advanced filtering * Real-time click tracking and unique visitor counts * Geographic and device analytics * Browser and referrer statistics * Exportable reports and data visualization * Password protection and expiration settings * UTM parameter tracking and templates * QR code generation with custom branding * Geographic restrictions and access control * Branded deeplinks with your domain * DNS verification and setup assistance * SSL certificate management * Domain performance monitoring ## Popular API Endpoints **POST /v1/links** - Create, update, and manage deeplinks with advanced features like password protection and expiration dates. **GET /v1/stats/links/** - Access comprehensive analytics including clicks, geographic data, and device statistics. **POST /v1/domains** - Manage custom domains for branded deeplinks with DNS verification. **POST /v1/projects** - Organize and group related links with project-based management. ## Quick Example ```bash cURL theme={null} curl -X POST 'https://api.taap.it/v1/links' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "original_url": "https://example.com/long-url", "custom_code": "my-link" }' ``` ```javascript JavaScript theme={null} const response = await fetch('https://api.taap.it/v1/links', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ original_url: 'https://example.com/long-url', custom_code: 'my-link' }) }); ``` ```python Python theme={null} import requests response = requests.post( 'https://api.taap.it/v1/links', headers={ 'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json' }, json={ 'original_url': 'https://example.com/long-url', 'custom_code': 'my-link' } ) ``` ```json Success Response theme={null} { "id": "link_987654321", "original_url": "https://example.com/long-url", "short_url": "https://taap.it/my-link", "code": "my-link", "created_at": "2024-01-15T10:30:00Z", "click_count": 0, "is_active": true } ``` ## Base URL & Authentication All API requests should be made to: ``` https://api.taap.it/v1 ``` All requests require authentication using API keys. Include your API key in the Authorization header: `Bearer taapit_your_api_key_here` Follow our quickstart guide to make your first API call and start building with taap.it. # Introduction Source: https://docs.taap.it/introduction Welcome to the taap.it API documentation ## What is taap.it API? The taap.it API provides programmatic access to taap.it's link management and analytics platform. With our API, you can create, manage, and track deeplinks, analyze performance data, and integrate taap.it's capabilities directly into your applications. ## Key Features Create, update, and delete deeplinks with custom domains and advanced features Track clicks, unique visitors, geographic data, and device analytics Create branded deeplinks with your own custom domains Group related links and track performance across projects ## Getting Started Log into your taap.it dashboard and navigate to your user settings to create an API key. Keep your API key secure and never share it publicly. API keys provide full access to your account. Use your API key to authenticate requests to the taap.it API. ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/links' \ -H 'Authorization: Bearer taapit_your_api_key_here' ``` Explore our endpoints for domains, links, projects, and stats to build powerful integrations. ## Authentication All API requests require authentication using an API key. Include your API key in the Authorization header using the Bearer token format: ```bash theme={null} Authorization: Bearer taapit_your_api_key_here ``` API keys are prefixed with `taapit_` and can be created through the web application dashboard. ## Base URL All API requests should be made to: ``` https://api.taap.it/v1 ``` ## Rate Limits The taap.it API implements rate limiting to ensure fair usage and optimal performance: * **Plan-based Rate Limits**: Rate limits vary based on your subscription plan * **Per-user enforcement**: Limits are applied per user account * **Future endpoint-specific limits**: May be implemented for specific endpoints in the future Rate limit headers are included in all responses: ```http theme={null} X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 999 X-RateLimit-Reset: 1640995200 ``` ## Response Format All API responses are returned in JSON format with the following structure: ```json Success Response theme={null} { "data": { ... }, "message": "Success" } ``` ```json Error Response theme={null} { "detail": "Error message describing what went wrong" } ``` ## Status Codes The API uses standard HTTP status codes: * `200` - Success * `201` - Created * `400` - Bad Request * `401` - Unauthorized * `403` - Forbidden * `404` - Not Found * `409` - Conflict * `429` - Too Many Requests * `500` - Internal Server Error ## Support Need help? We're here to assist: * **Email**: [support@taap.it](mailto:support@taap.it) * **Documentation**: This documentation site * **Status Page**: status.taap.it Jump into our quickstart guide to make your first API call in under 5 minutes. # Quickstart Guide Source: https://docs.taap.it/quickstart Get up and running with the taap.it API in minutes This quickstart guide will walk you through making your first API call to the taap.it API. ## Prerequisites Before you begin, you'll need: * A taap.it account * An API key (created through the web dashboard) * A tool to make HTTP requests (curl, Postman, or your preferred client) ## Step 1: Create an API Key Visit [www.taap.it](https://www.taap.it) and log into your account. Go to your user settings and find the "API Keys" section. Click "Create API Key" and give it a descriptive name. Copy the generated key immediately. API keys are only shown once during creation. Make sure to copy and store them securely. Your API key will look like this: `taapit_abc123def456ghi789jkl012mno345pqr678stu901vwx234yz` ## Step 2: Make Your First Request Let's start by listing your existing links to verify your API key is working: ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/links' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' ``` **Response:** ```json theme={null} { "items": [], "page": 1, "page_size": 20, "has_next": false } ``` ## Step 3: Create Your First Link Now let's create a deeplink: ```bash cURL theme={null} curl -X POST 'https://api.taap.it/v1/links' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' \ -d '{ "original_url": "https://example.com/very-long-url-that-needs-shortening", "custom_code": "my-custom-link" }' ``` **Response:** ```json theme={null} { "id": "link_987654321", "original_url": "https://example.com/very-long-url-that-needs-shortening", "short_url": "https://taap.it/my-custom-link", "code": "my-custom-link", "created_at": "2024-01-15T10:35:00Z", "updated_at": "2024-01-15T10:35:00Z", "click_count": 0, "is_active": true } ``` ## Step 4: Get Link Analytics Let's check the analytics for your newly created link: ```bash cURL theme={null} curl -X GET 'https://api.taap.it/v1/stats/links/link_987654321' \ -H 'Authorization: Bearer taapit_your_api_key_here' \ -H 'Content-Type: application/json' ``` **Response:** ```json theme={null} [ { "link_id": "link_987654321", "click_date": "2024-01-15", "total_clicks": 0, "unique_visitors": 0, "country_stats": {}, "device_stats": {}, "browser_stats": {}, "scans_only": 0 } ] ``` ## Next Steps Learn how to manage custom domains for your deeplinks Organize your links into projects for better management Dive deeper into link performance and user analytics Create, update, and manage your deeplinks ## Common Patterns ### Error Handling Always check for errors in API responses: ```javascript JavaScript Example theme={null} const response = await fetch('https://api.taap.it/v1/links', { headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' } }); if (!response.ok) { const error = await response.json(); console.error('API Error:', error.detail); return; } const data = await response.json(); console.log('Success:', data); ``` ### Rate Limit Handling Handle rate limits gracefully: ```javascript JavaScript Example theme={null} async function makeRequest(url, options) { const response = await fetch(url, options); if (response.status === 429) { const retryAfter = response.headers.get('Retry-After'); console.log(`Rate limited. Retry after ${retryAfter} seconds`); await new Promise(resolve => setTimeout(resolve, retryAfter * 1000)); return makeRequest(url, options); // Retry } return response; } ``` ## Need Help? * Verify your API key is correct and active * Ensure you're using the `Bearer` prefix in the Authorization header * Check that your API key hasn't expired * Implement exponential backoff for retries * Monitor the `X-RateLimit-Remaining` header * Consider caching responses to reduce API calls * **401 Unauthorized**: Invalid or missing API key * **403 Forbidden**: Insufficient permissions for the requested resource * **404 Not Found**: Resource doesn't exist or you don't have access * **409 Conflict**: Resource already exists (e.g., duplicate custom code) Explore our complete API reference to unlock the full power of taap.it.