{"openapi":"3.0.3","servers":[{"description":"Production","url":"https://api.journy.io"}],"info":{"contact":{"email":"hi@journy.io","name":"Support","url":"https://developers.journy.io"},"description":"# Welcome\n\nImplementing a new tool can be daunting, but it doesn't have to. You can implement journy.io in a few different ways to ensure it fits with the rest of your tech stack seamlessly.\n\nWe welcome your feedback, ideas and suggestions. We really want to make your life easier, so if we’re falling short or should be doing something different, we want to hear about it. Send us an email at [hi@journy.io](mailto:hi@journy.io) or reach out via the chat on our website or on our platform.\n\nThere are multiple ways you can send us data about users and accounts. We have both frontend and backend APIs, which can be used together at the same time.\n\nIf you already use [Segment](https://segment.com/), you can [get up and running with journy.io in seconds](https://help.journy.io/en/articles/6488307-the-segment-connector).\n\n# Concepts\n\n## Users\n\nThe most basic entity is a user, a specific individual that completed an interaction with your product.\n\nWe support multiple types of users, often differentiated by it's external ID prefix. E.g. In the case you are building an ordering app, there could easily be an administrator (who updates products and checks for orders) and the end-customers who place orders. One could have a typical ADM-XXXXXXXX ID, while the other would be referenced by USR-XXXXXXXXX.\n\n## Accounts\n\nIn B2B SaaS, users can be part of multiple accounts. E.g. Imagine you're building a content scheduling app where an agency can manage the social media posts of their clients. Each client of the agency has its own account in the product.\n\nIf your app doesn't have the concept of a team or group of users, you can ignore accounts.\n\n## Events\n\nAn event is a data point that represents an interaction between a user and/or an account; and your product. Events can represents any range of interactions. E.g. Every time a customer creates an invoice in an invoicing app. Actions like creating an invoice can be tracked as an event in journy.io.\n\nIt's critical to track events properly. You'll need to provide either an account ID, or a user ID, or both; when tracking an event. E.g. If a user updates his personal settings, you can omit the account ID as the event would not be related to any account. In a same logic, an account could get a 'suspend account' event (with account ID) from an internal process, whereas no user would be associated. In most cases, events will be associated to both 1 user and 1 account.\n\nYou can optionally pass extra details as metadata (e.g. amount of the invoice). This gets particarly powerfull when creating computed properties on those event metadata. E.g. Our above ordering app could send journy.io 'Place Order' events with metadata 'price', on which journy.io very easily would compute a total order value (for each account) for the last 30 days.\n\n💡 Metadata does not update the properties of a user or account.\n\n# Frontend vs backend\n\nThe best implementations we see employ a hybrid approach to maximize data quality while maintaining the flexibility to easily collect the data they need.\n\nWe recommend using our JavaScript snippet to track screen views and our backend API to sync users, sync accounts and track events.\n\nWhen evaluating how to track a particular event, we suggest starting with server-side and only use frontend if it's not possible to collect purely server-side. This can be the case if you need to track interactions with your product that don't result in any natural server requests (such as a button click that opens a modal).\n\n# Frontend\n\n## Setup\n\n💡 You can find the JavaScript snippet in the website settings in the connections view.\n\nCopy the JavaScript snippet and place it in the head or body of your application.\n\nThe snippet automatically calls `journy(\"init\", { ... })` and `journy(\"pageview\")`.\n\n## Identify user\n\n💡 A user ID should be a robust, static, unique identifier that you recognize a user by in your own systems. Because these IDs are consistent across a customer’s lifetime, you should include a user ID in identify calls as often as you can. Ideally, the user ID should be a database ID.\n\n💡 journy.io does not recommend using simple email addresses or usernames as user ID, as these can change over time. journy.io recommends that you use static IDs instead, so the IDs never change. When you use a static ID, you can still recognize the user in your analytics tools, even if the user changes their email address.\n\n💡 The properties `full_name`, `first_name`, `last_name`, `phone` and `registered_at` will be used for creating contacts in destinations like Intercom, HubSpot, Salesforce, ...\n\n`journy(\"identify\")` allows you to identify the user that is currently using your product.\n\n```ts\njourny(\"identify\", {\n  // Email or user ID is required\n  email: \"john.doe@acme.com\",\n  // Unique identifier for the user in your database\n  userId: \"20\",\n\n  // Optional\n  // Hash of the user ID using a backend secret\n  // You can find the secret in the website settings\n  // Recommended to prevent spoofing\n  verification: \"hash\",\n\n  // Optional\n  properties: {\n    full_name: \"John Doe\",\n    // or\n    first_name: \"John\",\n    last_name: \"Doe\",\n\n    phone: \"123\",\n    registered_at: new Date(/* ... */),\n    is_admin: true,\n    key_with_empty_value: \"\",\n    this_property_will_be_deleted: null,\n  },\n});\n```\n\n## Identify account\n\n💡 An account ID should be a robust, static, unique identifier that you recognize an account by in your own systems. Ideally, the account ID should be a database ID.\n\n💡 The properties `name`, `mrr`, `plan` and `registered_at` will be used to create companies in destinations like Intercom, HubSpot, Salesforce, ...\n\n`journy(\"account\")` allows you to identify the business account (i.e. organization) using your product.\n\n```ts\njourny(\"account\", {\n  // Required\n  // Unique identifier for the account in your database\n  accountId: \"30\",\n\n  // Optional\n  // Hash of the account ID using a backend secret\n  // You can find the secret in the website settings\n  // Recommended to prevent spoofing\n  verification: \"hash\",\n\n  // Optional\n  properties: {\n    name: \"ACME, Inc\",\n    mrr: 399,\n    plan: \"Pro\",\n    registered_at: new Date(/* ... */),\n    is_paying: true,\n    key_with_empty_value: \"\",\n    this_property_will_be_deleted: null,\n  },\n});\n```\n\n## Send page view\n\n💡 In applications, we advise you to use screen views instead of page views.\n\nThe JavaScript snippet in the site settings includes a `pageview` by default.\n\n```ts\njourny(\"pageview\");\n```\n\nIf you have a B2B application, we recommend to set account ID for every page view that happens within the context of an account.\n\n💡 An account ID should be a robust, static, unique identifier that you recognize an account by in your own systems. Ideally, the account ID should be a database ID.\n\n```ts\njourny(\"pageview\", {\n  accountId: \"30\",\n\n  // Optional\n  // Hash of the account ID using a backend secret\n  // You can find the secret in the website settings\n  // Recommended to prevent spoofing\n  verification: \"hash\",\n});\n```\n\n## Send screen view\n\nIn applications, we strongly advise you to use screen views instead of page views.\n\nPage URLs in applications often include the account ID (e.g. https://app.acme.com/accountId/settings).\n\nThis makes it difficult to create signals, segments, ... based on those URLs.\n\nThat's what screen views solve. It allows you to set a name for the screen being viewed (e.g. Account settings).\n\n```ts\njourny(\"screen\", { name: \"Personal settings\" });\n```\n\nIf you have a B2B application, we recommend to set account ID for every screen view that happens within the context of an account.\n\nExample: \"Personal settings\" would be without account ID, \"Team settings\" would be with account ID.\n\n💡 An account ID should be a robust, static, unique identifier that you recognize an account by in your own systems. Ideally, the account ID should be a database ID.\n\n```ts\njourny(\"screen\", {\n  name: \"Account settings\",\n  accountId: \"30\",\n\n  // Optional\n  // Hash of the account ID using a backend secret\n  // You can find the secret in the website settings\n  // Recommended to prevent spoofing\n  verification: \"hash\",\n});\n```\n\n## Trigger an event\n\n💡 Use past tense for event names.\n\nUser events:\n\n```js\njourny(\"event\", {\n  // required\n  name: \"signed_in\",\n\n  // optional\n  metadata: {\n    key: \"value\",\n  },\n});\n```\n\nAccount events:\n\n💡 An account ID should be a robust, static, unique identifier that you recognize an account by in your own systems. Ideally, the account ID should be a database ID.\n\n```js\njourny(\"event\", {\n  // required\n  name: \"created_invoice\",\n  accountId: \"30\",\n\n  // Optional\n  // Hash of the account ID using a backend secret\n  // You can find the secret in the website settings\n  // Recommended to prevent spoofing\n  verification: \"hash\",\n\n  // optional\n  metadata: {\n    key: \"value\",\n    amount: 100,\n    allow_wire_transfer: true,\n  },\n});\n```\n\n## Identity verification\n\nIdentity verification ensures that one person can't impersonate another.\n\nIdentity verification requires you to add an hash (HMAC) (that you generate on your server using SHA256) to your installation snippet alongside your user ID and account ID.\n\njourny.io won't accept requests for a logged-in user without a valid hash. The hash is calculated using a secret key, which you should never share. Without this secret key, no third party can send journy.io a valid hash for one of your users, so they can't impersonate your users.\n\nThis is optional but highly recommended.\n\nYou can enable identify verification in the website settings in the connections view.\n\n```js\njourny(\"identify\", {\n  userId: \"userId\",\n  verification: \"USER_ID_HMAC_VALUE_HERE\"\n})\n\njourny(\"account\", {\n  accountId: \"accountId\",\n  verification: \"ACCOUNT_ID_HMAC_VALUE_HERE\"\n})\n\njourny(\"event\", {\n  accountId: \"accountId\",\n  verification: \"ACCOUNT_ID_HMAC_VALUE_HERE\"\n})\n```\n\n### PHP\n\n```php\n<?php\n\nhash_hmac(\n  'sha256', // hash function\n  id, // user or account ID\n  'secret' // secret key (keep safe!)\n);\n```\n\n### Node.js\n\n```js\nimport { createHmac } from \"crypto\"\n\ncreateHmac(\n  \"sha256\", // hash function\n  'secret' // secret key (keep safe!)\n).update(id).digest(\"hex\") // user or account ID\n```\n\n### Ruby\n\n```ruby\nOpenSSL::HMAC.hexdigest(\n  'sha256', # hash function\n  'secret', # secret key (keep safe!)\n  id.to_s # user or account ID\n)\n```\n\n### Python\n\n```\nimport hmac\nimport hashlib\n\nhmac.new(\n  b'secret', # secret key (keep safe!)\n  bytes(id, encoding='utf-8'), # user or account ID\n  digestmod=hashlib.sha256 # hash function\n).hexdigest()\n```\n\n## Single page application\n\nYou can use our JavaScript snippet inside single page applications.\n\nYou should call `journy(\"screen\")` (or `journy(\"pageview\")`) whenever a user in your application transitions to another page. You can do this by listening to router change events. The current page URL will always be resolved using `window.location.href`.\n\nYou can trigger events using `journy(\"event\")` whenever you need to.\n\n### Next.js\n\nWe built a demo app with Next.js. You can find the code [here](https://github.com/journy-io/js-sdk-demo-app).\n\nThis [component](https://github.com/journy-io/js-sdk-demo-app/blob/main/components/Journy.js) should be a great start.\n\nYou can use the `Script` component from Next.js to load the web snippet and call `init`.\n\nDon't forget to listen on route changes. You can use the `useRouter` hook for that.\n\n### React Router v6\n\nYou can use the [`useLocation`](https://reactrouter.com/docs/en/v6/api#uselocation) hook to listen for route changes:\n\n```js\nimport React, { useEffect } from \"react\";\nimport { useLocation } from 'react-router-dom';\n\nfunction App() {\n  const location = useLocation();\n\n  useEffect(() => {\n    journy(\"screen\", { name: \"name\" });\n    // or\n    journy(\"pageview\");\n  }, [location]);\n\n  return (\n      // ...\n  );\n}\n```\n\n### Vue Router\n\nYou can use [`router.afterEach`](https://router.vuejs.org/guide/advanced/navigation-guards.html#global-after-hooks) to listen for route changes:\n\n```js\nconst router = new VueRouter({ ... });\n\nrouter.afterEach((to, from) => {\n  journy(\"screen\", { name: \"name\" });\n  // or\n  journy(\"pageview\");\n});\n```\n\nNote: We don't accept a page URL argument for `journy(\"pageview\")`. The current page URL will always be resolved using `window.location.href`.\n\n## TypeScript\n\nWe published an [npm package](https://www.npmjs.com/package/@journyio/web-types) with type definitions to enable type-safe usage of our JavaScript snippet. The code and documentation is available on [GitHub](https://github.com/journy-io/web-types).\n\n## Localhost\n\nBy default a site doesn't allow page views from other domains than the registered domain. This makes it difficult to test your tracking implementation locally.\n\nYou can enable \"Allow any domain\" in the site settings to disable the domain check.\n\nThis will allow you to test the JavaScript snippet with localhost as hostname.\n\n# Backend\n\nThe journy.io API is organized around REST. Our API has predictable resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.\n\nThe API is hosted on api.journy.io.\n\n## Official SDKs\n\nOur SDKs are designed to help you interact with our APIs with less friction. They are written in several different languages and help bridge the gap between your application and journy.io APIs. They take away the need to know the exact URL and HTTP method to use for each API call among other things leaving you more time to focus on making your application.\n\n| Language   | Package                                                                        | Source code                                                                |\n|------------|--------------------------------------------------------------------------------|----------------------------------------------------------------------------|\n| 💚 Node.js | [npm install @journyio/sdk ](https://www.npmjs.com/package/@journyio/sdk)      | [github.com/journy-io/js-sdk](https://github.com/journy-io/js-sdk)         |\n| 🐘 PHP     | [composer require journy-io/sdk](https://packagist.org/packages/journy-io/sdk) | [github.com/journy-io/php-sdk](https://github.com/journy-io/php-sdk)       |\n| 🐍 Python  | [pip install journyio-sdk](https://pypi.org/project/journyio-sdk/)             | [github.com/journy-io/python-sdk](https://github.com/journy-io/python-sdk) |\n| 💎 Ruby    | Coming soon                                                                    | Coming soon                                                                |\n\nYour favourite programming language not included? [Let us know!](mailto:hi@journy.io)\n\nIn the meanwhile, you can use [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) to generate a client for your programming language.\n\n## Authentication\n\nThe journy.io API uses API keys to authenticate requests. You can view and manage your API keys in the [connections screen](https://system.journy.io).\n\nYour API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.\n\nAll API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.\n\nFor every request send to the API we expect a header `X-Api-Key` to be set with the API Key.\n\n## Permissions\n\nWhen creating an API Key in [the application](https://system.journy.io) you will have the choice to give permissions to an API Key (which you can change later on). These permissions restrict the API Key from different actions. When an API Key tries to perform a certain action it doesn't have the permissions for, you will receive a `401: Unauthorized` response.\n\n## Rate limiting\n\nTo prevent abuse of the API there is a maximum throughput of 1800 requests per minute. If you need a higher throughput, please contact us.\n\nTo keep our platform healthy and stable, we'll block API keys that consistently hit our rate limits. Therefore, please consider taking this throughput into account.\n\nIn every response the headers `X-RateLimit-Limit` and `X-RateLimit-Remaining` will be set. The `X-RateLimit-Limit`-header will always contain the current limit of requests per minute. The `X-RateLimit-Remaining`-header will always contain the amount of requests you have left in the current sliding window.\n\n💡 The client-side tracking uses different rate limits.\n\n## Errors\n\njourny.io uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted). Codes in the 5xx range indicate an error with journy.io's servers (these are rare).\n\nWhen performing a `POST`- or `PUT`-request with a requestBody, or when including parameters, these parameters and fields will automatically be checked and validated against the API Spec. When any error occurs, you will get a response with an `errors`-field, structured as follows:\n\n```json\n{\n  \"errors\": {\n    \"parameters\": {\n      \"header\": {\n        \"headerParameterName\": \"Describe what's wrong with the header parameter.\",\n        ...\n      },\n      \"query\": {\n        \"queryParameterName\": \"Describe what's wrong with the query parameter.\",\n        ...\n      },\n      \"path\": {\n        \"pathParameterName\": \"Describe what's wrong with the path parameter.\",\n        ...\n      },\n    },\n    \"fields\": {\n      \"fieldName\": \"Describe what's wrong with the fieldName.\",\n      \"object.fieldName\": \"Describe what's wrong with the fieldName of the included object.\",\n       ...\n    }\n  }\n}\n```\n\n## Best practices\n\n### Track accounts & users immediately on creation\n\nWhen you create an account in your database, immediately sending data about that account to journy.io helps your team stay in sync. The same goes for users. Call [Upsert account](#operation/upsertAccount) as soon as possible, right after the account is first created in your database.\n\n### Update account data daily\n\nNot every account is active every day. But, you may have properties on the account that change through background processing. That's why we recommend updating every one of your accounts' data in a recurring daily process. This way, you know that your accounts are updated every day in journy.io.\n\n## Changelog\n\n### December 2021\n\n[POST /events](#operation/trackJourneyEvent) will be moved to [POST /track](#operation/trackEvent). [POST /events](#operation/trackJourneyEvent) is deprecated and will be removed in the future.","termsOfService":"https://www.journy.io/terms-of-use/","title":"Developer documentation","version":"1.0.0","x-apisguru-categories":["customer_relation"],"x-logo":{"altText":"Journy.io","url":"https://developers.journy.io/developers.png"},"x-origin":[{"format":"openapi","url":"https://api.journy.io/spec.json","version":"3.0"}],"x-providerName":"journy.io"},"externalDocs":{"description":"Help center","url":"https://help.journy.io"},"tags":[{"description":"Endpoints for creating, deleting or updating users.","name":"Users","x-displayName":"👥 Users"},{"description":"Endpoints for creating, deleting or updating accounts.","name":"Accounts","x-displayName":"🏢 Accounts"},{"description":"Endpoints for tracking events.","name":"Track","x-displayName":"📥 Track"},{"description":"Endpoints for listing properties.","name":"Properties","x-displayName":"📖 Properties"},{"description":"Endpoints for listing events.","name":"Events","x-displayName":"🎯 Events"},{"description":"Endpoints for reading user and account segments","name":"Segments","x-displayName":"🗂️ Segments"},{"description":"Endpoints for managing websites.","name":"Websites","x-displayName":"🌐 Websites"},{"description":"Endpoints for validating API keys.","name":"Validation","x-displayName":"🆗 Validation"}],"paths":{"/accounts":{"delete":{"description":"Endpoint used to delete an account.","operationId":"deleteAccount","requestBody":{"content":{"application/json":{"schema":{"description":"Delete an account","properties":{"identification":{"description":"Account identification requires an accountId, domain or both","minProperties":1,"properties":{"accountId":{"description":"Unique identifier for the account in your database","format":"account-id","type":"string"},"domain":{"description":"The domain associated with the account (e.g. acme-inc.com)","format":"top-level-domain","type":"string"}},"type":"object"}},"required":["identification"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Accepted","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Delete account","tags":["Accounts"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.deleteAccount({\n  // required\n  accountId: \"accountId\",\n  domain: \"acme-inc.com\",\n});"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->deleteAccount([\n    \"accountId\" => \"accountId\",\n    \"domain\" => \"acme-inc.com\",\n]);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.client import Properties\nfrom journyio.account_identified import AccountIdentified\nfrom journyio.user_identified import UserIdentified\nfrom datetime import datetime\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\naccount = AccountIdentified(\"accountId\", \"acme-inc.com\")\n# or\naccount = AccountIdentified.by_account_id(\"accountId\")\n# or\naccount = AccountIdentified.by_domain(\"acme-inc.com\")\n\nclient.delete_account(account, properties)"}],"x-key-permissions":["TrackData"]}},"/accounts/upsert":{"post":{"description":"Endpoint used to create or update an account.","operationId":"upsertAccount","requestBody":{"content":{"application/json":{"schema":{"description":"Update properties and/or members of an account","properties":{"identification":{"description":"Account identification requires an accountId, domain or both","minProperties":1,"properties":{"accountId":{"description":"Unique identifier for the account in your database","format":"account-id","type":"string"},"domain":{"description":"The domain associated with the account (e.g. acme-inc.com)","format":"top-level-domain","type":"string"}},"type":"object"},"properties":{"additionalProperties":{"oneOf":[{"nullable":true,"type":"string"},{"type":"boolean"},{"type":"number"},{"items":{"format":"non-empty-string","type":"string"},"type":"array"}]},"description":"The properties being set, possible values are strings, booleans, numbers and datetimes (ISO 8601)","type":"object"}},"required":["identification"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"example":"Account will be created or updated","type":"string"}},"required":["message"],"type":"object"},{"description":"Specifies if any warnings occurred when validating the properties","properties":{"rejected":{"additionalProperties":{"type":"string"},"description":"If validation fails, specifies the property name and error message","example":{"created_at":"Expected a date but found a boolean."},"type":"object"}},"type":"object"}]}}},"description":"Account will be created","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Create or update account","tags":["Accounts"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.upsertAccount({\n  // required\n  accountId: \"accountId\",\n  domain: \"acme-inc.com\",\n\n  // optional\n  properties: {\n    name: \"ACME, Inc\",\n    mrr: 399,\n    plan: \"Pro\",\n    registered_at: new Date(...),\n    is_paying: true,\n    key_with_empty_value: \"\",\n    array_of_values: [\"value1\", \"value2\"],\n    this_property_will_be_deleted: null,\n  }\n});"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->upsertAccount([\n    \"accountId\" => \"accountId\",\n    \"domain\" => \"acme-inc.com\",\n\n    // optional\n    \"properties\" => [\n        \"name\" => \"ACME, Inc\",\n        \"mrr\" => 399,\n        \"plan\" => \"Pro\",\n        \"registered_at\" => new \\DateTimeImmutable(\"...\"),\n        \"is_paying\" => true,\n        \"key_with_empty_value\" => \"\",\n        \"array_of_values\" => [\"value1\", \"value2\"],\n        \"this_property_will_be_deleted\" => null,\n    ]\n]);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.client import Properties\nfrom journyio.account_identified import AccountIdentified\nfrom journyio.user_identified import UserIdentified\nfrom datetime import datetime\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\naccount = AccountIdentified(\"accountId\", \"acme-inc.com\")\n# or\naccount = AccountIdentified.by_account_id(\"accountId\")\n# or\naccount = AccountIdentified.by_domain(\"acme-inc.com\")\n\nproperties = Properties()\nproperties[\"name\"] = \"ACME, Inc\"\nproperties[\"mrr\"] = 399\nproperties[\"plan\"] = \"Pro\"\nproperties[\"registered_at\"] = datetime.now()\nproperties[\"is_paying\"] = True\nproperties[\"key_with_empty_value\"] = \"\"\nproperties[\"this_property_will_be_deleted\"] = None\nproperties[\"array_of_values\"] = [\"value1\", \"value2\"]\n\nclient.upsert_account(account, properties)"}],"x-key-permissions":["TrackData"]}},"/accounts/users/add":{"post":{"description":"You can add up to 100 users to an account.","operationId":"addUserToAccount","requestBody":{"content":{"application/json":{"schema":{"description":"The identification for user and account","properties":{"account":{"description":"Account identification requires an accountId, domain or both","minProperties":1,"properties":{"accountId":{"description":"Unique identifier for the account in your database","format":"account-id","type":"string"},"domain":{"description":"The domain associated with the account (e.g. acme-inc.com)","format":"top-level-domain","type":"string"}},"type":"object"},"users":{"items":{"properties":{"identification":{"description":"User identification requires a userId, email or both","minProperties":1,"properties":{"email":{"description":"Email address of the user","format":"email","type":"string"},"userId":{"description":"Unique identifier for the user in your database","format":"user-id","type":"string"}},"type":"object"}},"required":["identification"],"type":"object"},"type":"array"}},"required":["account","users"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Object was created","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Add users to an account","tags":["Accounts"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\nimport { Client } from \"@journyio/sdk\";\nconst client = Client.withDefaults('your-api-key');\n\nawait client.addUsersToAccount(\n  AccountIdentified.byAccountId(\"accountId\"),\n  [UserIdentified.byUserId(\"userId1\"), UserIdentified.byUserId(\"userId2\")]\n);"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->addUsersToAccount(\n  AccountIdentified::byAccountId(\"accountId\"),\n  array(UserIdentified::byUserId(\"userId1\"), UserIdentified::byUserId(\"userId2\"))\n);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nclient.add_users_to_account(\n  AccountIdentified(\"accountId\", \"www.domain.tld\")\n  [UserIdentified(\"userId1\", \"name1@domain.tld\"), UserIdentified(\"userId2\", \"name2@domain.tld\")]\n)"}],"x-key-permissions":["TrackData"]}},"/accounts/users/remove":{"post":{"description":"You can remove up to 100 users from an account.\n\nWhen removing a user, the user will still be stored in journy.io, but marked as \"removed\".\n","operationId":"removeUserFromAccount","requestBody":{"content":{"application/json":{"schema":{"description":"The identification for user and account","properties":{"account":{"description":"Account identification requires an accountId, domain or both","minProperties":1,"properties":{"accountId":{"description":"Unique identifier for the account in your database","format":"account-id","type":"string"},"domain":{"description":"The domain associated with the account (e.g. acme-inc.com)","format":"top-level-domain","type":"string"}},"type":"object"},"users":{"items":{"properties":{"identification":{"description":"User identification requires a userId, email or both","minProperties":1,"properties":{"email":{"description":"Email address of the user","format":"email","type":"string"},"userId":{"description":"Unique identifier for the user in your database","format":"user-id","type":"string"}},"type":"object"}},"required":["identification"],"type":"object"},"type":"array"}},"required":["account","users"],"type":"object"}}},"required":true},"responses":{"204":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No content","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Remove user from account","tags":["Accounts"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\nimport { Client } from \"@journyio/sdk\";\nconst client = Client.withDefaults('your-api-key');\n\nawait client.removeUsersFromAccount(\n  AccountIdentified.byAccountId(\"accountId\"),\n  [UserIdentified.byUserId(\"userId1\"), UserIdentified.byUserId(\"userId2\")]\n);"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->removeUsersFromAccount(\n  AccountIdentified::byAccountId(\"accountId\"),\n  array(UserIdentified::byUserId(\"userId1\"), UserIdentified::byUserId(\"userId2\"))\n);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nclient.remove_users_from_account(\n  AccountIdentified(\"accountId\", \"www.domain.tld\"),\n  [UserIdentified(\"userId1\", \"user1@domain.tld\"), UserIdentified(\"userId2\", \"user2@domain.tld\")]\n)"}],"x-key-permissions":["TrackData"]}},"/events":{"get":{"description":"Endpoint to list events.","operationId":"getEvents","responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"properties":{"data":{"items":{"description":"Event details","properties":{"group":{"description":"Event group details","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name","id"],"type":"object"},"id":{"type":"string"},"name":{"type":"string"}},"required":["name","id"],"type":"object"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":"Events","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Get events","tags":["Events"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.getEvents();"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->getEvents();"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.results import Success\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nclient.get_events()"}],"x-key-permissions":["ReadEvents"]},"post":{"deprecated":true,"description":"Endpoint used to track an event for a user or an account.\n\nThis endpoint is moved to [Track](#operation/trackEvent).","operationId":"trackJourneyEvent","requestBody":{"content":{"application/json":{"schema":{"description":"Event for a user or an account","properties":{"identification":{"description":"Event identification requires a user, account or both","minProperties":1,"properties":{"account":{"description":"Account identification requires an accountId, domain or both","minProperties":1,"properties":{"accountId":{"description":"Unique identifier for the account in your database","format":"account-id","type":"string"},"domain":{"description":"The domain associated with the account (e.g. acme-inc.com)","format":"top-level-domain","type":"string"}},"type":"object"},"user":{"description":"User identification requires a userId, email or both","minProperties":1,"properties":{"email":{"description":"Email address of the user","format":"email","type":"string"},"userId":{"description":"Unique identifier for the user in your database","format":"user-id","type":"string"}},"type":"object"}},"type":"object"},"metadata":{"additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"}]},"description":"Event metadata, possible values are strings, booleans, numbers and datetimes (ISO 8601)","type":"object"},"name":{"format":"event-name","type":"string"},"triggeredAt":{"description":"If left blank this defaults to the current datetime","format":"datetime","type":"string"}},"required":["identification","name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Object was created","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Track event","tags":["Events"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client, Event, UserIdentified, AccountIdentified } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nevent = Event.forUser(\"login\", UserIdentified.byUserId(\"userId\"));\n\nevent = Event.forUser(\"some_historic_event\", UserIdentified.byUserId(\"userId\"))\n  .happenedAt(new Date(...))\n;\n\nevent = Event.forAccount(\"reached_monthly_volume\", AccountIdentified.byAccountId(\"accountId\"))\n  .withMetadata({\n    \"number\": 1313,\n    \"string\": \"string\",\n    \"boolean\": true,\n  })\n;\n\nevent = Event.forUserInAccount(\n  \"updated_settings\",\n  UserIdentified.byUserId(\"userId\"),\n  AccountIdentified.byAccountId(\"accountId\")\n);\n\nawait client.addEvent(event);"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\nuse JournyIO\\SDK\\Event;\nuse JournyIO\\SDK\\UserIdentified;\nuse JournyIO\\SDK\\AccountIdentified;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$event = Event::forUser(\"login\", UserIdentified::byUserId(\"userId\"));\n\n$event = Event::forUser(\"some_historic_event\", UserIdentified::byUserId(\"userId\"))\n    ->happenedAt(new \\DateTimeImmutable(\"now\"))\n;\n\n$event = Event::forAccount(\"reached_monthly_volume\", AccountIdentified::byAccountId(\"accountId\"))\n    ->withMetadata([\n        \"number\" => 13313,\n        \"string\" => \"string\",\n        \"boolean\" => true,\n    ])\n;\n\n$event = Event::forUserInAccount(\n    \"updated_settings\",\n    UserIdentified::byUserId(\"userId\"),\n    AccountIdentified::byAccountId(\"accountId\")\n);\n\n$client->addEvent($event);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom datetime import datetime\nfrom journyio.events import Event, Metadata\nfrom journyio.account_identified import AccountIdentified\nfrom journyio.user_identified import UserIdentified\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\naccount = AccountIdentified(\"accountId\", \"www.domain.tld\")\nuser = UserIdentified(\"userId\", \"name@domain.tld\")\n\nmetadata = Metadata()\nmetadata[\"number\"] = 454554\nmetadata[\"boolean\"] = False\nmetadata[\"string\"] = \"string\"\n\nevent = Event()\n    .for_user_in_account(\"settings_updated\", user, account)\n    .happened_at(datetime.now())\n    .with_metadata(metadata)\n\nclient.add_event(event)"}],"x-key-permissions":["TrackData"]}},"/link":{"post":{"description":"💡 You don't need to use this endpoint if you use our JavaScript snippet in your application.\n\nThis endpoint is used to link web activity to a user in your application. This will help you discover which channels and campaigns work best.\n\nWhen our JavaScript snippet is embedded on your website, blog or landing pages, a cookie named \"__journey\" will be set.\n\nThis will only work if your website and application are under the same top level domain.\n\nWebsite, blog or landing pages\n* www.my-domain.tld\n* blog.my-domain.tld\n* landing-page.my-domain.tld\n\nApplication\n* app.my-domain.tld\n\nThe cookie on my-domain.tld will also be send to your app domain.\n\nYou should call this endpoint after the user succesfully logged in (so that you know the user's ID). Use the value of the cookie as device ID.","operationId":"link","requestBody":{"content":{"application/json":{"schema":{"description":"Link web activity to user","properties":{"deviceId":{"format":"non-empty-string","type":"string"},"identification":{"description":"User identification requires a userId, email or both","minProperties":1,"properties":{"email":{"description":"Email address of the user","format":"email","type":"string"},"userId":{"description":"Unique identifier for the user in your database","format":"user-id","type":"string"}},"type":"object"}},"required":["deviceId","identification"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Object was created","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Link web activity to user","tags":["Users"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.link({\n  deviceId: request.cookies[\"__journey\"],\n\n  userId: request.user.id,\n  // or\n  email: request.user.email,\n});"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->link([\n    \"deviceId\" => \"deviceId\",\n\n    \"userId\" => \"userId\",\n    // or\n    \"email\" => \"email\",\n]);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.user_identified import UserIdentified\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nuser = UserIdentified(\"userId\", \"name@domain.tld\")\n# or\nuser = UserIdentified.by_user_id(\"userId\")\n# or\nuser = UserIdentified.by_email(\"name@domain.tld\")\n\nclient.link(user, \"deviceId\")"}],"x-key-permissions":["TrackData"]}},"/properties/accounts":{"get":{"description":"Endpoint to list account properties.","operationId":"getAccountProperties","responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"properties":{"data":{"items":{"description":"Properties details","properties":{"group":{"description":"Property group details","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name","id"],"type":"object"},"isComputed":{"type":"boolean"},"label":{"type":"string"},"name":{"type":"string"}},"required":["name","label","isComputed"],"type":"object"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":"Account Properties","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Get account properties","tags":["Properties"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.getAccountProperties();"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->getAccountProperties();"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.results import Success\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nclient.get_account_properties()"}],"x-key-permissions":["ReadProperties"]}},"/properties/users":{"get":{"description":"Endpoint to list user properties.","operationId":"getUserProperties","responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"properties":{"data":{"items":{"description":"Properties details","properties":{"group":{"description":"Property group details","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name","id"],"type":"object"},"isComputed":{"type":"boolean"},"label":{"type":"string"},"name":{"type":"string"}},"required":["name","label","isComputed"],"type":"object"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":"User Properties","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Get user properties","tags":["Properties"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.getUserProperties();"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->getUserProperties();"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.results import Success\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nclient.get_user_properties()"}],"x-key-permissions":["ReadProperties"]}},"/segments/accounts":{"get":{"description":"Endpoint to list account segments.","operationId":"getAccountSegments","responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"properties":{"data":{"items":{"description":"Segment details","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name","id"],"type":"object"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":"Account Segments","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Get account segments","tags":["Segments"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\nimport { Client } from \"@journyio/sdk\";\nconst client = Client.withDefaults('your-api-key');\nawait client.getAccountSegments();"},{"lang":"PHP","source":"<?php\n// https://github.com/journy-io/php-sdk\nuse JournyIO\\SDK\\Client;\n$client = Client::withDefaults(\"your-api-key\");\n$client->getAccountSegments();"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\nfrom journyio.client import Client, Config\nfrom journyio.results import Success\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\nclient.get_account_segments()"}],"x-key-permissions":["ReadSegments"]}},"/segments/users":{"get":{"description":"Endpoint to list user segments.","operationId":"getUserSegments","responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"properties":{"data":{"items":{"description":"Segment details","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["name","id"],"type":"object"},"type":"array"}},"required":["data"],"type":"object"}]}}},"description":"User Segments","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Get user segments","tags":["Segments"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\nimport { Client } from \"@journyio/sdk\";\nconst client = Client.withDefaults('your-api-key');\nawait client.getUserSegments();"},{"lang":"PHP","source":"<?php\n// https://github.com/journy-io/php-sdk\nuse JournyIO\\SDK\\Client;\n$client = Client::withDefaults(\"your-api-key\");\n$client->getUserSegments();"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\nfrom journyio.client import Client, Config\nfrom journyio.results import Success\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\nclient.get_user_segments()"}],"x-key-permissions":["ReadSegments"]}},"/track":{"post":{"description":"Endpoint used to track an event for a user or an account.","operationId":"trackEvent","requestBody":{"content":{"application/json":{"schema":{"description":"Event for a user or an account","properties":{"identification":{"description":"Event identification requires a user, account or both","minProperties":1,"properties":{"account":{"description":"Account identification requires an accountId, domain or both","minProperties":1,"properties":{"accountId":{"description":"Unique identifier for the account in your database","format":"account-id","type":"string"},"domain":{"description":"The domain associated with the account (e.g. acme-inc.com)","format":"top-level-domain","type":"string"}},"type":"object"},"user":{"description":"User identification requires a userId, email or both","minProperties":1,"properties":{"email":{"description":"Email address of the user","format":"email","type":"string"},"userId":{"description":"Unique identifier for the user in your database","format":"user-id","type":"string"}},"type":"object"}},"type":"object"},"metadata":{"additionalProperties":{"oneOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"format":"datetime","type":"string"}]},"description":"Event metadata, possible values are strings, booleans, numbers and datetimes (ISO 8601)","type":"object"},"name":{"format":"event-name","type":"string"},"triggeredAt":{"description":"If left blank this defaults to the current datetime","format":"datetime","type":"string"}},"required":["identification","name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Object was created","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Track event","tags":["Track"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client, Event, UserIdentified, AccountIdentified } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nevent = Event.forUser(\"login\", UserIdentified.byUserId(\"userId\"));\n\nevent = Event.forUser(\"some_historic_event\", UserIdentified.byUserId(\"userId\"))\n  .happenedAt(new Date(...))\n;\n\nevent = Event.forAccount(\"reached_monthly_volume\", AccountIdentified.byAccountId(\"accountId\"))\n  .withMetadata({\n    \"number\": 1313,\n    \"string\": \"string\",\n    \"boolean\": true,\n  })\n;\n\nevent = Event.forUserInAccount(\n  \"updated_settings\",\n  UserIdentified.byUserId(\"userId\"),\n  AccountIdentified.byAccountId(\"accountId\")\n);\n\nawait client.addEvent(event);"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\nuse JournyIO\\SDK\\Event;\nuse JournyIO\\SDK\\UserIdentified;\nuse JournyIO\\SDK\\AccountIdentified;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$event = Event::forUser(\"login\", UserIdentified::byUserId(\"userId\"));\n\n$event = Event::forUser(\"some_historic_event\", UserIdentified::byUserId(\"userId\"))\n    ->happenedAt(new \\DateTimeImmutable(\"now\"))\n;\n\n$event = Event::forAccount(\"reached_monthly_volume\", AccountIdentified::byAccountId(\"accountId\"))\n    ->withMetadata([\n        \"number\" => 13313,\n        \"string\" => \"string\",\n        \"boolean\" => true,\n    ])\n;\n\n$event = Event::forUserInAccount(\n    \"updated_settings\",\n    UserIdentified::byUserId(\"userId\"),\n    AccountIdentified::byAccountId(\"accountId\")\n);\n\n$client->addEvent($event);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom datetime import datetime\nfrom journyio.events import Event, Metadata\nfrom journyio.account_identified import AccountIdentified\nfrom journyio.user_identified import UserIdentified\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\naccount = AccountIdentified(\"accountId\", \"www.domain.tld\")\nuser = UserIdentified(\"userId\", \"name@domain.tld\")\n\nmetadata = Metadata()\nmetadata[\"number\"] = 454554\nmetadata[\"boolean\"] = False\nmetadata[\"string\"] = \"string\"\n\nevent = Event()\n    .for_user_in_account(\"settings_updated\", user, account)\n    .happened_at(datetime.now())\n    .with_metadata(metadata)\n\nclient.add_event(event)"}],"x-key-permissions":["TrackData"]}},"/tracking/snippet":{"get":{"description":"Endpoint used to get a snippet for a website.","operationId":"getTrackingSnippet","parameters":[{"description":"The domain you want to receive a snippet for","in":"query","name":"domain","required":true,"schema":{"format":"domain","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"properties":{"data":{"description":"A snippet","properties":{"domain":{"format":"domain","type":"string"},"snippet":{"type":"string"}},"required":["domain","snippet"],"type":"object"}},"required":["data"],"type":"object"}]}}},"description":"Snippet","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"404":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Not found","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Get snippet for a website","tags":["Websites"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nconst result = await client.getTrackingSnippet({\n  domain: \"www.journy.io\",\n});\n\nif (result.success) {\n  console.log(result.data.snippet); // string\n  console.log(result.data.domain); // string\n}"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$call = $client->getTrackingSnippet(\"blog.acme.com\");\n\nif ($call->succeeded()) {\n    $result = $call->result();\n\n    if ($result instanceof TrackingSnippet) {\n        var_dump($result->getSnippet()); // string\n        var_dump($result->getDomain()); // string\n    }\n} else {\n    var_dump($call->errors());\n}"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.results import Success\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nclient.get_tracking_snippet(\"blog.acme.com\")\n\nif isinstance(result, Success):\n  print(result.request_id)  # str\n  print(result.calls_remaining)  # int\n  print(result.data)  # TrackingSnippetResonse\n  print(result.domain)  # str\n  print(result.snippet)  # str"}],"x-key-permissions":["GetTrackingSnippet"]}},"/users":{"delete":{"description":"Endpoint to delete a user.","operationId":"deleteUser","requestBody":{"content":{"application/json":{"schema":{"description":"Delete a user","properties":{"identification":{"description":"User identification requires a userId, email or both","minProperties":1,"properties":{"email":{"description":"Email address of the user","format":"email","type":"string"},"userId":{"description":"Unique identifier for the user in your database","format":"user-id","type":"string"}},"type":"object"}},"required":["identification"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Accepted","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Delete user","tags":["Users"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.deleteUser({\n  // required\n  userId: \"userId\",\n  email: \"name@domain.tld\",\n});"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->deleteUser([\n    // required\n    \"userId\" => \"userId\",\n    \"email\" => \"name@domain.tld\",\n]);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.client import Properties\nfrom journyio.user_identified import UserIdentified\nfrom datetime import datetime\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nuser = UserIdentified(\"userId\", \"name@domain.tld\")\n# or\nuser = UserIdentified.by_user_id(\"userId\")\n# or\nuser = UserIdentified.by_email(\"name@domain.tld\")\n\nclient.delete_user(user)"}],"x-key-permissions":["TrackData"]}},"/users/upsert":{"post":{"description":"Endpoint to create or update a user.","operationId":"upsertUser","requestBody":{"content":{"application/json":{"schema":{"description":"Update properties of a user","properties":{"identification":{"description":"User identification requires a userId, email or both","minProperties":1,"properties":{"email":{"description":"Email address of the user","format":"email","type":"string"},"userId":{"description":"Unique identifier for the user in your database","format":"user-id","type":"string"}},"type":"object"},"properties":{"additionalProperties":{"oneOf":[{"nullable":true,"type":"string"},{"type":"boolean"},{"type":"number"},{"items":{"format":"non-empty-string","type":"string"},"type":"array"}]},"description":"The properties being set, possible values are strings, booleans, numbers and datetimes (ISO 8601)","type":"object"}},"required":["identification"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"example":"User will be created or updated","type":"string"}},"required":["message"],"type":"object"},{"description":"Specifies if any warnings occurred when validating the properties","properties":{"rejected":{"additionalProperties":{"type":"string"},"description":"If validation fails, specifies property name and error description","example":{"created_at":"Expected a date but found a boolean."},"type":"object"}},"type":"object"}]}}},"description":"User will be created","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"allOf":[{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]},{"description":"Specify the fields and/ or parameters that had errors","properties":{"errors":{"description":"Map that sums up all received values that seemed incorrect","properties":{"fields":{"additionalProperties":{"type":"string"},"description":"All input fields that seemed incorrect","type":"object"},"parameters":{"description":"All query-, header- and path- parameters that seemed incorrect","properties":{"header":{"additionalProperties":{"type":"string"},"type":"object"},"path":{"additionalProperties":{"type":"string"},"type":"object"},"query":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}},"type":"object"}},"required":["errors"],"type":"object"}]}}},"description":"Bad request, some fields or parameters are incorrect","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Create or update user","tags":["Users"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nawait client.upsertUser({\n  // required\n  userId: \"userId\",\n  email: \"name@domain.tld\",\n\n  // optional\n  properties: {\n    full_name: \"John Doe\",\n    first_name: \"John\",\n    last_name: \"Doe\",\n    phone: \"123\",\n    registered_at: new Date(/* ... */),\n    is_admin: true,\n    age: 26,\n    array_of_values: [\"value1\", \"value2\"],\n    key_with_empty_value: \"\",\n    this_property_will_be_deleted: null,\n  },\n});"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$client->upsertUser([\n    // required\n    \"userId\" => \"userId\",\n    \"email\" => \"name@domain.tld\",\n\n    // optional\n    \"properties\" => [\n        \"full_name\" => \"John Doe\",\n        \"first_name\" => \"John\",\n        \"last_name\" => \"Doe\",\n        \"phone\" => \"123\",\n        \"is_admin\" => true,\n        \"registered_at\" => new \\DateTimeImmutable(\"...\"),\n        \"age\" => 26,\n        \"array_of_values\" => [\"value1\", \"value2\"],\n        \"key_with_empty_value\" => \"\",\n        \"this_property_will_be_deleted\" => null,\n    ],\n]);"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.client import Properties\nfrom journyio.user_identified import UserIdentified\nfrom datetime import datetime\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nuser = UserIdentified(\"userId\", \"name@domain.tld\")\n# or\nuser = UserIdentified.by_user_id(\"userId\")\n# or\nuser = UserIdentified.by_email(\"name@domain.tld\")\n\nproperties = Properties()\nproperties[\"full_name\"] = \"John Doe\"\nproperties[\"first_name\"] = \"John\"\nproperties[\"last_name\"] = \"Doe\"\nproperties[\"phone\"] = \"123\"\nproperties[\"is_admin\"] = True\nproperties[\"registered_at\"] = datetime.now()\nproperties[\"age\"] = 26\nproperties[\"array_of_values\"] = [\"value1\", \"value2\"]\nproperties[\"key_with_empty_value\"] = \"\"\nproperties[\"this_property_will_be_deleted\"] = None\n\nclient.upsert_user(user, properties)"}],"x-key-permissions":["TrackData"]}},"/validate":{"get":{"description":"Endpoint used to test the validity and some basic information about a specific API Key.","operationId":"getValidity","responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"properties":{"data":{"description":"Validation of API Key","properties":{"permissions":{"items":{"type":"string"},"type":"array"}},"required":["permissions"],"type":"object"}},"required":["data"],"type":"object"}]}}},"description":"Key validation","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"No API Key was provided or the key is not authorised to perform the action","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"403":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"The API Key provided is currently not enabled","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"429":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"Too many API requests were send","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}},"500":{"content":{"application/json":{"schema":{"allOf":[{"description":"The basic response containing the unique ID of the request and the response status","properties":{"meta":{"properties":{"requestId":{"type":"string"},"status":{"type":"number"}},"required":["requestId","status"],"type":"object"}},"required":["meta"],"type":"object"},{"description":"The message specifies what is done","properties":{"message":{"type":"string"}},"required":["message"],"type":"object"}]}}},"description":"An unexpected error occurred","headers":{"X-RateLimit-Limit":{"description":"Request limit per minute.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"The number of requests left for the time window.","schema":{"type":"integer"}}}}},"summary":"Validate API key","tags":["Validation"],"x-codeSamples":[{"lang":"JavaScript","source":"// https://github.com/journy-io/js-sdk\n\nimport { Client } from \"@journyio/sdk\";\n\nconst client = Client.withDefaults('your-api-key');\n\nconst result = await client.getApiKeyDetails();\n\nif (result.success) {\n  console.log(result.data.permissions); // string[]\n}"},{"lang":"PHP","source":"<?php\n\n// https://github.com/journy-io/php-sdk\n\nuse JournyIO\\SDK\\Client;\n\n$client = Client::withDefaults(\"your-api-key\");\n\n$call = $client->getApiKeyDetails();\n\nif ($call->succeeded()) {\n    $result = $call->result();\n\n    if ($result instanceof ApiKeyDetails) {\n        var_dump($result->getPermissions()); // string[]\n    }\n} else {\n    var_dump($call->errors());\n}"},{"lang":"Python","source":"# https://github.com/journy-io/python-sdk\n\nfrom journyio.client import Client, Config\nfrom journyio.results import Success\n\nconfig = Config(\"api-key-secret\")\nhttp_client = HttpClientRequests()\nclient = Client(http_client, config)\n\nclient.get_api_key_details()\n\nif isinstance(result, Success):\n    print(result.request_id)  # str\n    print(result.calls_remaining)  # int\n    print(result.data)  # ApiKeyDetails\n    print(result.permissions)  # list of strings denoting the permissions"}]}}},"x-tagGroups":[{"name":"API Endpoints","tags":["Users","Accounts","Track","Properties","Events","Segments","Websites","Validation"]}]}