{"openapi":"3.0.3","info":{"title":"Specvista Analytics API","version":"1.0.0","description":"Send events from websites, apps and servers, and read reports for your projects. Ingest endpoints authenticate with a project key in X-Api-Key. Account, project and report endpoints authenticate with a bearer token from POST /auth/login. Guides: https://analytics.specvista.com/docs. Errors carry a stable code and a doc_url: https://analytics.specvista.com/docs/errors."},"servers":[{"url":"https://analyticsapi.specvista.com/api/v1"}],"externalDocs":{"description":"Specvista Analytics docs","url":"https://analytics.specvista.com/docs"},"tags":[{"name":"Ingest","description":"Send events. Authenticate with a project key."},{"name":"Account","description":"Create an account and get a bearer token."},{"name":"Projects","description":"Create projects and read their keys. Bearer token."},{"name":"Reports","description":"Read analytics for a project. Bearer token."},{"name":"SDK","description":"The browser script and its helpers."}],"paths":{"/ingest":{"post":{"operationId":"trackEvent","summary":"Send one event","tags":["Ingest"],"security":[{"projectKey":[]},{"projectDomain":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"202":{"description":"Accepted. Processing is asynchronous. skipped is true when the browser has the sa_ignore cookie.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"skipped":{"type":"boolean"}}}}}},"401":{"description":"Error with code unregistered_sender. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["unregistered_sender"]}}}},"/ingest/batch":{"post":{"operationId":"trackBatch","summary":"Send up to 100 events at once","description":"Send a JSON array of events, or an object with an events array. Only the first 100 events are stored.","tags":["Ingest"],"security":[{"projectKey":[]},{"projectDomain":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"array","items":{"$ref":"#/components/schemas/Event"}},{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}},"required":["events"]}]}}}},"responses":{"202":{"description":"Accepted. queued is the number of events received, of which at most 100 are stored. skipped replaces queued when the browser has the sa_ignore cookie.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"queued":{"type":"integer"},"skipped":{"type":"boolean"}}}}}},"401":{"description":"Error with code unregistered_sender. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["unregistered_sender"]}}}},"/ingest/identify":{"post":{"operationId":"identifyUser","summary":"Attach an email, name and traits to a userId","tags":["Ingest"],"security":[{"projectKey":[]},{"projectDomain":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Identify"}}}},"responses":{"202":{"description":"Accepted. Returns ok false with error \"userId required\" when userId is missing, and skipped true when the browser has the sa_ignore cookie.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"type":"string"},"skipped":{"type":"boolean"}}}}}},"401":{"description":"Error with code unregistered_sender. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["unregistered_sender"]}}}},"/ingest/ignore-on":{"get":{"operationId":"ignoreMyVisits","summary":"Set the sa_ignore cookie so this browser is never tracked","tags":["Ingest"],"responses":{"200":{"description":"Cookie set.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"tracking":{"type":"boolean"}}}}}}}}},"/ingest/ignore-off":{"get":{"operationId":"trackMyVisits","summary":"Clear the sa_ignore cookie","tags":["Ingest"],"responses":{"200":{"description":"Cookie cleared.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"tracking":{"type":"boolean"}}}}}}}}},"/ingest/ignore-status":{"get":{"operationId":"ignoreStatus","summary":"Whether this browser is tracked","tags":["Ingest"],"responses":{"200":{"description":"Status.","content":{"application/json":{"schema":{"type":"object","properties":{"tracking":{"type":"boolean"}}}}}}}}},"/forget":{"post":{"operationId":"forgetUser","summary":"Erase a user's identity and personal event data","description":"Requires a backend project key. Limited per key per minute.","tags":["Ingest"],"security":[{"projectKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"oneOf":[{"type":"string"},{"type":"integer"}]},"projectId":{"oneOf":[{"type":"integer"},{"type":"string"}],"description":"Another project owned by the same account. Defaults to the key's project."}},"required":["userId"]}}}},"responses":{"204":{"description":"Forgotten."},"400":{"description":"Error with code user_id_required or invalid_project_id. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["user_id_required","invalid_project_id"]},"401":{"description":"Error with code invalid_api_key. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["invalid_api_key"]},"403":{"description":"Error with code backend_key_required or forget_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["backend_key_required","forget_forbidden"]},"429":{"description":"Error with code rate_limited. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["rate_limited"]}}}},"/auth/register":{"post":{"operationId":"register","summary":"Create an account","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string","minLength":8},"firstName":{"type":"string"},"lastName":{"type":"string"}},"required":["email","password","firstName"]}}}},"responses":{"201":{"description":"Account created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"Error with code email_required or password_too_short or first_name_required. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["email_required","password_too_short","first_name_required"]},"409":{"description":"Error with code email_taken. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["email_taken"]}}}},"/auth/login":{"post":{"operationId":"login","summary":"Sign in and get a bearer token valid for 90 days","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]}}}},"responses":{"201":{"description":"Signed in. Use user.token as the bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"400":{"description":"Error with code credentials_required. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["credentials_required"]},"401":{"description":"Error with code invalid_credentials. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["invalid_credentials"]}}}},"/auth/me":{"get":{"operationId":"me","summary":"The signed-in account","tags":["Account"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Account.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"uuid":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]}}}},"/auth/password":{"patch":{"operationId":"changePassword","summary":"Change the signed-in account's password","tags":["Account"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"currentPassword":{"type":"string"},"newPassword":{"type":"string","minLength":8}},"required":["currentPassword","newPassword"]}}}},"responses":{"200":{"description":"Changed.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"400":{"description":"Error with code password_too_short or current_password_incorrect. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["password_too_short","current_password_incorrect"]},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]}}}},"/auth/profile":{"patch":{"operationId":"updateProfile","summary":"Change the signed-in account's name","tags":["Account"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated, with a fresh token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]}}}},"/projects":{"get":{"operationId":"listProjects","summary":"List your projects, including each project key","tags":["Projects"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Projects, newest first.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]}}},"post":{"operationId":"createProject","summary":"Create a project and its key","tags":["Projects"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":"string","description":"Website hostname, for keyless browser tracking."},"type":{"type":"string","enum":["web","mobile","backend","other"],"default":"web"}},"required":["name"]}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Error with code project_name_required or invalid_project_type. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_name_required","invalid_project_type"]},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]}}}},"/projects/{projectId}":{"get":{"operationId":"getProject","summary":"Get one project","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."}],"responses":{"200":{"description":"Project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}},"patch":{"operationId":"updateProject","summary":"Rename a project or change its domain","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"domain":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}},"delete":{"operationId":"deleteProject","summary":"Delete a project","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/projects/{projectId}/rotate-key":{"post":{"operationId":"rotateProjectKey","summary":"Replace a project's key. The old key stops working at once.","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."}],"responses":{"201":{"description":"Project with its new key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/global":{"get":{"operationId":"globalOverview","summary":"Live visitors and pageviews across all your projects","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Overview.","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"domain":{"type":"string"},"live":{"type":"integer"},"pageviewsToday":{"type":"integer"},"pageviewsPeriod":{"type":"integer"}}}},"totalLive":{"type":"integer"},"totalPageviewsToday":{"type":"integer"},"period":{"type":"string","description":"Absent when you have no projects."}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]}}}},"/analytics/{projectId}/overview":{"get":{"operationId":"projectOverview","summary":"Headline numbers with the previous period for comparison","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","description":"All events ever, excluding bot and internal traffic."},"pageviews":{"type":"integer"},"uniqueSessions":{"type":"integer"},"liveVisitors":{"type":"integer","description":"Sessions active in the last 5 minutes."},"period":{"type":"string"},"trend":{"type":"number","nullable":true,"description":"Percentage change in pageviews against the previous period."},"previous":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"pageviews":{"type":"integer"},"uniqueSessions":{"type":"integer"},"bounceRate":{"type":"number","nullable":true}}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/pageviews":{"get":{"operationId":"pageviewsOverTime","summary":"Pageviews per day, week or month","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["day","week","month"],"default":"day"}}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"views":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/top-pages":{"get":{"operationId":"topPages","summary":"Top 10 paths by pageviews","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"views":{"type":"integer"},"sessions":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/landing-pages":{"get":{"operationId":"landingPages","summary":"Top 10 entry paths with bounce rate","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"integer"},"pages":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"sessions":{"type":"integer"},"bounced":{"type":"integer"},"bounceRate":{"type":"integer"}}}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/top-events":{"get":{"operationId":"topEvents","summary":"Top 10 custom events (pageviews excluded)","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"source":{"type":"string"},"count":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/event-names":{"get":{"operationId":"eventNames","summary":"Up to 50 event names with counts, for funnel pickers","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"count":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/funnel":{"get":{"operationId":"funnel","summary":"Conversion from one event to another, with the previous period","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."},{"name":"from","in":"query","required":true,"schema":{"type":"string","maxLength":100},"description":"Start event name."},{"name":"to","in":"query","required":true,"schema":{"type":"string","maxLength":100},"description":"Finish event name, different from the start event."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"object","properties":{"fromEvent":{"type":"string"},"toEvent":{"type":"string"},"period":{"type":"string"},"current":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"started":{"type":"integer"},"converted":{"type":"integer"},"rate":{"type":"number","nullable":true}}},"previous":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"started":{"type":"integer"},"converted":{"type":"integer"},"rate":{"type":"number","nullable":true}}}}}}}},"400":{"description":"Error with code invalid_funnel_events or same_funnel_events. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["invalid_funnel_events","same_funnel_events"]},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/referrers":{"get":{"operationId":"referrers","summary":"Top 10 referrers","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"referrer":{"type":"string"},"visits":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/channels":{"get":{"operationId":"channels","summary":"Pageviews by channel: Organic, Direct, Referral, Social, Email, Paid","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"count":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/utm-campaigns":{"get":{"operationId":"utmCampaigns","summary":"Top 20 UTM campaigns","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"campaign":{"type":"string"},"source":{"type":"string"},"medium":{"type":"string"},"visits":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/sources":{"get":{"operationId":"sources","summary":"Events by source: web, mobile or backend","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string"},"count":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/devices":{"get":{"operationId":"devices","summary":"Events by device type","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"device":{"type":"string"},"count":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/browsers":{"get":{"operationId":"browsers","summary":"Events by browser","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"browser":{"type":"string"},"count":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/os":{"get":{"operationId":"operatingSystems","summary":"Events by operating system","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"os":{"type":"string"},"count":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/countries":{"get":{"operationId":"countries","summary":"Top 50 countries","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"countryCode":{"type":"string"},"country":{"type":"string"},"visits":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/cities":{"get":{"operationId":"cities","summary":"Top 20 cities","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":"string"},"countryCode":{"type":"string"},"country":{"type":"string"},"visits":{"type":"integer"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/bounce-rate":{"get":{"operationId":"bounceRate","summary":"Share of single-page sessions, as a whole percentage","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"object","properties":{"bounceRate":{"type":"integer"}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/new-vs-returning":{"get":{"operationId":"newVsReturning","summary":"Identified users first seen in the period against earlier ones","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"object","properties":{"new":{"type":"integer"},"returning":{"type":"integer"}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/people":{"get":{"operationId":"people","summary":"Up to 500 userIds active in the period, with identities where known","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"Report rows. Bot and internal traffic is excluded.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"identified":{"type":"integer"},"anonymous":{"type":"integer"},"people":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"traits":{"type":"object","nullable":true},"identified":{"type":"boolean"},"events":{"type":"integer"},"firstSeenAt":{"type":"string"},"lastSeenAt":{"type":"string"}}}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/live-events":{"get":{"operationId":"liveEvents","summary":"Up to 20 of the most recent events from the last hour","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."}],"responses":{"200":{"description":"Events, newest first.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"path":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"browser":{"type":"string","nullable":true},"createdAt":{"type":"string"}}}}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/{projectId}/export":{"get":{"operationId":"exportCsv","summary":"Download up to 50,000 events as CSV","tags":["Reports"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric project id from GET /projects."},{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["24h","7d","30d"],"default":"30d"},"description":"Reporting window ending now. Any other value is treated as 30d."}],"responses":{"200":{"description":"CSV with columns time, event, path, referrer, country, device, browser, os, sessionId, utmSource, utmMedium, utmCampaign.","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]},"403":{"description":"Error with code project_forbidden. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_forbidden"]},"404":{"description":"Error with code project_not_found. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["project_not_found"]}}}},"/analytics/tracking-health":{"get":{"operationId":"trackingHealth","summary":"Whether each of your projects is still receiving events","tags":["Reports"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Per-project tracking status.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error with code missing_token or invalid_token. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["missing_token","invalid_token"]}}}},"/sdk.js":{"get":{"operationId":"browserSdk","summary":"The browser script. Also served at /sdk.min.js.","tags":["SDK"],"responses":{"200":{"description":"JavaScript.","content":{"application/javascript":{"schema":{"type":"string"}}}}}}},"/sdk/linked-domains":{"get":{"operationId":"linkedDomains","summary":"Domains owned by the same account, used by the browser script to link visitors across your sites","tags":["SDK"],"security":[{"projectKey":[]},{"projectDomain":[]}],"responses":{"200":{"description":"Domains.","content":{"application/json":{"schema":{"type":"object","properties":{"domains":{"type":"array","items":{"type":"string"}}}}}}},"401":{"description":"Error with code unregistered_sender. Follow doc_url in the body for the fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"x-error-codes":["unregistered_sender"]}}}},"/openapi.json":{"get":{"operationId":"openApi","summary":"This document","tags":["SDK"],"responses":{"200":{"description":"OpenAPI 3.0 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"securitySchemes":{"projectKey":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Project key from GET /projects or the dashboard. Treat it as a secret in server code."},"projectDomain":{"type":"apiKey","in":"header","name":"X-Domain","description":"Browser-only alternative: the hostname registered as the domain of a web project."},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"user.token from POST /auth/login or /auth/register. Valid for 90 days."}},"schemas":{"Event":{"type":"object","properties":{"event":{"type":"string","maxLength":100,"description":"Event name, for example signup.completed. Defaults to pageview."},"source":{"type":"string","enum":["web","mobile","backend"],"default":"web"},"userId":{"type":"string","maxLength":255},"sessionId":{"type":"string","maxLength":100},"url":{"type":"string"},"path":{"type":"string"},"referrer":{"type":"string"},"environment":{"type":"string","enum":["development","preview","production"],"description":"Anything other than production is stored as internal and left out of reports."},"consent":{"type":"string","enum":["full","essential"],"description":"essential stores only event, path, referrer, device type and country."},"os":{"type":"string"},"osVersion":{"type":"string"},"appVersion":{"type":"string"},"appBuild":{"type":"string"},"deviceType":{"type":"string"},"browser":{"type":"string"},"language":{"type":"string"},"locale":{"type":"string"},"timezone":{"type":"string"},"screenWidth":{"type":"integer"},"screenHeight":{"type":"integer"},"utmSource":{"type":"string"},"utmMedium":{"type":"string"},"utmCampaign":{"type":"string"},"utmContent":{"type":"string"},"utmTerm":{"type":"string"},"anonymousId":{"type":"string"},"installId":{"type":"string"},"deviceId":{"type":"string"},"deviceModel":{"type":"string"},"domain":{"type":"string","description":"Browser-only alternative to X-Domain."},"properties":{"type":"object","additionalProperties":true,"description":"Your own structured fields. Never send secrets or free text."}}},"Identify":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"traits":{"type":"object","additionalProperties":true},"emailStorage":{"type":"string","enum":["hash_only"],"description":"Store only a salted hash of the email."}},"required":["userId"]},"Session":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"integer"},"uuid":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"token":{"type":"string","description":"Bearer token, valid for 90 days."}}}}},"Project":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"apiKey":{"type":"string","description":"Project key, starts with sa_live_."},"domain":{"type":"string","nullable":true},"type":{"type":"string","enum":["web","mobile","backend","other"]},"ownerUserId":{"type":"integer"},"productId":{"type":"integer","nullable":true},"archivedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"error":{"type":"string"},"code":{"type":"string","enum":["missing_token","invalid_token","admin_required","invalid_credentials","credentials_required","email_required","first_name_required","password_too_short","email_taken","current_password_incorrect","project_name_required","invalid_project_type","project_not_found","project_forbidden","unregistered_sender","invalid_api_key","backend_key_required","user_id_required","invalid_project_id","forget_forbidden","rate_limited","invalid_funnel_events","same_funnel_events"]},"message":{"type":"string"},"doc_url":{"type":"string"}},"required":["statusCode","message"]}}}}