Attentive API
Attentive REST API v1 - subscriptions, custom attributes/events, ecommerce events, offers/coupons, product catalog, identity, privacy requests, and webhooks.
Attentive REST API v1 - subscriptions, custom attributes/events, ecommerce events, offers/coupons, product catalog, identity, privacy requests, and webhooks.
{"openapi":"3.0.3","info":{"description":"For any questions, reach out to your Attentive point of contact (if applicable) or [api@attentivemobile.com](mailto:api@attentivemobile.com).","title":"Attentive API","version":""},"servers":[{"url":"https://api.attentivemobile.com/v1","description":"Attentive API"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Test Authentication","description":"Use the Test Authentication endpoint to test your unique token that you received from Attentive. Make sure to save your token because all API requests are authenticated using bearer tokens. The response should include information specific to your company.\n"},{"name":"Access Token","description":"Public applications must authenticate using the OAuth 2.0 specification to use Attentive’s API resources. Attentive uses OAuth 2.0’s authorization code grant flow to issue access tokens on behalf of users. When an application is installed on our platform, an authorization code is generated automatically. This authorization code must be exchanged for an access token to authenticate grant and control permissions for your application.\n"},{"name":"Webhooks","description":"Create and manage webhooks"},{"name":"eCommerce","description":"Use the eCommerce API to trigger an event when a user views a product, adds a product to their shopping cart, or makes a purchase.","x-beta":false},{"name":"Offers","description":"You can use the Offers API to add discount codes to an existing offer. <br> <h2> Create an offer </h2> <ol> <li> Navigate to the [Offers](https://ui.attentivemobile.com/offers) page. </li> <li> Click **+ Create offer** in the top-right corner. </li> <li> On the **Choose an offer type** window, select **Unique discount codes** </li> <li> Enter a unique name for your offer in the **Discount name** field. </li> <li> Choose the **Distribution window**. <br> **Note**: If you include start and end dates in your API call, the distribution window automatically updates to **Custom time period**. </li> <li> **Click Create.** </li> <li> Click back into the offer and retrieve the numeric ID at the end of the URL string. This is the ID you will need for the POST </li> </ol>","x-beta":true},{"name":"Custom Events","description":"Use the Custom Events API to send user actions to use in the Attentive Segment Builder and Journey Builder for both email and text messages. This data cannot contain any sensitive or special categories of information as defined in applicable data protection and privacy laws, including the California Consumer Privacy Act (CCPA) and California Privacy Rights Act (CPRA). See a list of specific categories of data you cannot share with Attentive [here](https://docs.attentivemobile.com/pages/legal-docs/pi-disclaimer/).","x-beta":false},{"name":"Custom Attributes","description":"Use the Custom Attributes API to apply customizable data or characteristics to each of your subscribers. This API will either create a new custom attribute if it doesn't already exist or update an existing one with the new value provided. You can then build segments based on that information to send targeted campaigns and journeys. This data cannot contain any sensitive or special categories of information as defined in applicable data protection and privacy laws, including the California Consumer Privacy Act (CCPA) and California Privacy Rights Act (CPRA). See a list of specific categories of data you cannot share with Attentive [here](https://docs.attentivemobile.com/pages/legal-docs/pi-disclaimer/).\n","x-beta":false},{"name":"Subscribers","description":"Use the Subscribers API to manage subscriptions. With this API, you can programmatically subscribe and unsubscribe users from subscriptions.\n","x-beta":false},{"name":"Product Catalog","description":"Our product catalog API unlocks the ability to send high-performing journeys such as back in stock, low inventory, and price drop. It also lets you segment your customers and branch journeys using product data.\n- **Create high performing journeys**, such as back in stock, low inventory, and price drop.\n- **Segment customers** based on their past browsing, add to cart, and purchasing activity using product data such as name, category, tag, price, and other attributes.\n- **Branch journeys** based on product attributes or inventory, such as only sending a message if the product is in stock.\n\nAttentive also has several integrations with popular e-commerce platforms that sync product data to Attentive. These are available in the Integrations tab.\n\n## Important note for testing/QA\n\nWhen you're testing journeys that use product catalog data (like price drop, back in stock, or low inventory), *we strongly recommend adding a **[Wait step](https://help.attentivemobile.com/hc/en-us/articles/360056415972-Add-steps-to-a-journey#h_01EY4TST8MRRG9GDZP2AT0EV9E)** of at least one hour as the very first step in the journey.* This initial wait step allows sufficient time for our system to process changes to your product catalog. \n\nAn initial wait step is generally *not* necessary for your actual live journeys. In most non-testing scenarios, subscribers will enter the journey after catalog updates have already been processed.\n\nWhen testing back in stock journeys specifically, keep in mind that back in stock journeys are triggered when `availableForPurchase` is `false`, not when `inventoryQuantity` is `0` (or less than the threshold amount if you're using [inventory thresholds](https://help.attentivemobile.com/hc/en-us/articles/4404286271380-Create-a-back-in-stock-journey)).\n\n## How to Get Started\n1. [Create an Attentive app to get an api key](https://docs.attentivemobile.com/pages/create-and-manage-custom-apps/)\n2. [Review the authentication workflow](https://docs.attentivemobile.com/pages/authentication/)\n3. Read through the product catalog file format you'll need to generate to send us your product catalog.\n4. Either use the sample script below to send us the file(s) you've generated, or implement something similar.\n5. By default, `validateOnly` will be set to `true` when initiating the upload, in order for you to develop without \nsaving the catalog Attentive side. Once you're ready for production, go ahead and set `validateOnly` to `false`.\n6. Once the file has been uploaded, contact your CSM to confirm that the data quality is high enough for the Attentive product data features to be enabled.\n\n### Sample CLI Utility Script\nFeel free to reuse and adapt this Python3 script to send Attentive the catalog files you've generated.\n```python\nimport argparse\nimport requests # you may need to install this https://docs.python-requests.org/en/latest/user/install/\nimport json\nimport time\n\nfrom distutils.util import strtobool\n\n\nAPI_KEY = '' # Set this\nAPI_BASE_URL = 'https://api.attentivemobile.com'\nSTATUS_INTERVAL = 10\n\n\ndef initiate_catalog_upload(validate_only, api_key):\n post_url = API_BASE_URL + '/v1/product-catalog/uploads'\n r = requests.post(\n post_url,\n json={'validateOnly': validate_only},\n headers={'Authorization': 'Bearer ' + api_key},\n )\n assert r.status_code == 200, \"Are you sure your api key is correct?\"\n resp = r.json()\n return resp['uploadId'], resp['uploadUrl']\n\n\ndef print_errors(errors):\n print(\"Validation Errors:\")\n for error in errors:\n print(json.dumps(error))\n\n\ndef wait_for_validation(upload_id, validate_only, api_key, counter):\n \"\"\"\n The file at this point should now be queued up and we are awaiting validation. If there are any\n validation errors, we'll print them out from here. You may want to integrate your own more\n advanced monitoring.\n \"\"\"\n time.sleep(STATUS_INTERVAL)\n get_url = API_BASE_URL + '/v1/product-catalog/uploads/' + upload_id\n r = requests.get(get_url, headers={'Authorization': 'Bearer ' + api_key}).json()\n if r['errors']:\n # Consider implementing alerting over here\n print_errors(r['errors'])\n if r['status'] == 'validated':\n return\n # waiting approximately an hour before giving up. Totally up to you how long, but Attentive should\n # rarely be behind an hour behind in processing\n if counter == 360:\n print(\"Giving up on waiting for validation for \" + upload_id)\n return\n\n wait_for_validation(upload_id, validate_only, api_key, counter + 1)\n\n\ndef upload_catalog(filepath, validate_only, api_key):\n upload_id, upload_url = initiate_catalog_upload(validate_only, api_key)\n with open(filepath, 'rb') as f:\n r = requests.put(upload_url, data=f)\n assert r.status_code == 200, 'Unexpected issue uploading'\n wait_for_validation(upload_id, validate_only, api_key, 0)\n return upload_id\n\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(\n description='CLI utility script to demonstrate and assist in sending your generated product catalog to Attentive via its API'\n )\n parser.add_argument('filepath', help='Path to your catalog file')\n parser.add_argument(\n '--validateOnly',\n default=True,\n dest='validate_only',\n type=lambda x: bool(strtobool(x)),\n help='Boolean flag to choose whether or not Attentive should only validate the file for correctness only or not. '\n 'Defaults to True to prevent saving invalid data during development. Set to False when everything passes without errors.',\n )\n parser.add_argument(\n '--apiKey',\n dest='api_key',\n help='You can pass the API Key in here as an argument or set it in the API_KEY variable at the top of this file',\n )\n args = parser.parse_args()\n\n key = args.api_key or API_KEY\n assert key, (\n 'Please either pass in the apiKey argument to this script, or '\n 'update the API_KEY variable at the top of this file to authenticate to Attentive'\n )\n id = upload_catalog(args.filepath, args.validate_only, key)\n```\n## Product catalog file format\nYou can use the Product Catalog API to provide Attentive with your entire product catalog\nprogrammatically in order to segment or branch on different product attributes to send more\ntargeted SMS messages. It also unlocks other unique product features (e.g. Back In-Stock Journeys).\n\nIn order to use the Product Catalog API, you must first provide Attentive with your full or\npartial product catalog as a **ndjson format file** to be HTTP file uploaded to a specified URL. *Each\nline in the file represents a full product, as described in the sample below*. This article\noutlines the structure of each product/row, as well as the definitions of each object and field.\n\n```\nTop-level product\n{\n \"name\": string, *\n \"id\": string, *\n \"description\": string,\n \"brand\": string,\n \"link\": string, *\n \"lastUpdated\": timestamp, *\n \"categories\": Array<string>,\n \"tags\": Array<string>,\n \"productOptions\": Array<ProductOption>,\n \"images\": Array<Image>,\n \"attributes\": Array<Attribute>\n \"variants\": Array<Variant> *,\n \"collections\": Array<String>\n}\n\nProduct Option\n{\n \"name\": string, *\n \"position\": int, *\n \"values\": Array<string> *\n}\n\nImage\n{\n \"position\": int,\n \"alt\": string,\n \"src\": string, *\n \"width\": int,\n \"height\": int,\n \"variantIds\": Array<string>\n}\n\nAttribute\n{\n \"name\": string, *\n \"value\": string *\n}\n\nVariant\n{\n \"name\": string, * full name\n \"id\": string, *\n \"position\": int,\n \"prices\": Array<Price>,\n \"availableForPurchase\": boolean, *\n \"inventoryQuantity\": int, *\n \"productOptionValues\": Array<ProductOptionValue>,\n \"link\": string, *\n \"lastUpdated\": timestamp, *\n \"attributes\": Array<Attribute>\n}\n\nProduct Option Value\n{\n \"productOptionName\": string, *\n \"value\": string *\n}\n\nPrice\n{\n \"currencyCode\": string, *\n \"amount\": string, *\n \"compareAtPrice\": string,\n}\n```\n\n### Definition of terms\n\n#### Product\nProducts are the goods that you are selling on your website. For example, it can be a t-shirt\nor a pair of shoes. This is the root JSON object on each line and is inherently required.\n\n| Field | Description | Type | Required |\n| ----- | ----- | -------- | ---- |\n| id | This is your product ID and the field we key off of. It must be unique across your catalog. You need this unique ID to make any updates to the product by uploading your product with the same id. The maximum length of the ID is 256 characters. | string | Required |\n| name | The name of your product. Note that this is how it appears in messages. The maximum length of the name is 256 characters. | string | Required |\n| description | A short description of your product. The maximum length of the description is 1024 characters. | string | Optional |\n| brand | Brand for your product. Maximum length of brand is 256 characters. | string | Optional |\n| link | The link to your product's detail page online. Maximum length of link is 2048 characters. (http(s) required) | string | Required |\n| lastUpdated | The date and time (in UTC) of when your product was last updated. | [timestamp](https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC) | Required |\n| categories | One or more categories in your taxonomy associated with this product. You can specify up to 100 categories per product and each category can be up to 750 characters long. | Array<string> | Optional |\n| tags | One or more tags that are associated with and used to categorize this product. You can specify up to 250 tags per product and each tag can be up to 64 characters long. | Array<string> | Optional |\n| productOptions | See [Product Option](#product-option). Up to 25 ProductOptions are allowed per product and up to 200 values are allowed per option. | Array<ProductOption> | Optional |\n| images | See [Image](#image). Up to 250 images are allowed per product. | Array<Image> | Optional |\n| attributes | See [Attribute](#attribute). Up to 100 attributes are allowed per product. | Array<Attribute> | Optional |\n| variants | See [Variant](#variant). Up to 200 variants are allowed per product. | Array<Variant> | Required |\n| collections | The grouping of products that this product belongs to. Up to 50 collections per product are allowed. | Array<string> | Optional |\n\n\n#### Variant\nA variant can be added to a Product to represent one version of a product with several options.\nThe Product has a variant for every possible combination of its options. Following the example\nin [Product](#product), a variant is a size small and color black. An order can begin fulfillment once a\nvariant is selected. Each product must have at least one variant\n\n| Field | Description | Type | Required |\n| ----- | ----- | -------- | ---- |\n| id | This is your variant ID and the field we key off of. It must be unique across your catalog. You need this unique ID to make any updates to the product by uploading your variant with the same id. The maximum length of the ID is 256 characters. | string | Required |\n| name | The name of this variant. Note that this is how it appears in messages to your subscribers. The maximum length of the name is 256 characters. | string | Required |\n| position | The order in which this variant appears among all the other variants that belong to this product. The variant with the lowest number is the default variant. This value must be greater than or equal to 0. | int | Optional |\n| link | The link to your variant's detail page online. If there is no link for your variant, you can use your product link. The maximum length of the link is 2048 characters. (http(s) required) | string | Required |\n| prices | See [Price](#price) | Array<Price> | Required\n| availableForPurchase | Is this variant still being sold? | boolean | Required |\n| inventoryQuantity | The current inventory count for this variant. Required for Low Inventory and Back in Stock journeys to function correctly. | int | Required |\n| productOptionValues | The combination of options that this variant represents for the product. See [Product Options](#product-option) section for details. | Array<ProductOption> | Optional |\n| attributes | See [Attribute](#attribute). Up to 100 Variants allowed. | Array<Attribute> | Optional |\n| lastUpdated | The date and time (in UTC) of when your product or variant was last updated. | [timestamp](https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC) | Required |\n\n\n#### Product Option\nProduct options are the dimensions or choices that a customer has to select to add a variant\nto their cart. Following our previous [Product](#product) example above with the t-shirt, the\ncustomer needs to select the size and color they want. In this example, size and color are the\nproduct options.\n\n| Field | Description | Type | Required |\n| ----- | ----- | -------- | ---- |\n| name | The name/title of this product option. Up to 256 characters long | string | Required |\n| position | The order in which this option appears among all the other options. The option with the lowest number is first in the order. This value must be greater than or equal to 0. | int | Required |\n| values | The different possible values for this product option. Up to 256 characters long for each value. | Array<string> | Required |\n\n\n#### Product Option Value\nProduct option values are the unique product option selections associated with a given variant.\nThese are contextualized within the Variant object.\n\n| Field | Description | Type | Required |\n| ----- | ----- | -------- | ---- |\n| productOptionName | The product option name | string | Required |\n| value | The selection or value for this variant | string | Required |\n\n\n#### Attribute\nGeneric key/value data for products/variants that can be used for categorizing.\n\n| Field | Description | Type | Required |\n| ----- | ----- | -------- | ---- |\n| name | The attribute name. Up to 64 characters long. | string | Required |\n| value | The attribute value. Up to 256 characters long. | string | Required |\n\n\n#### Image\nData for the images associated with your products and variants that can be used for Attentive product\nmessaging and experiences.\n\n| Field | Description | Type | Required |\n| ----- | ----- | -------- | ---- |\n| src | The URL to the image (http(s) required). | string | Required |\n| alt | The alt text for the image. This is used as a back up in case an image can't be displayed and standard on the web. Up to 512 characters allowed. | string | Optional |\n| width | The width of the image in pixels | int | Optional |\n| height | The height of the image in pixels | int | Optional |\n| variantIds | The list of variant IDs this image applies to. Each id must match the ID of the field of one of the variants. | Array<string> | Optional |\n| position | The order in which images are considered for a product or variant. The image with the lowest position will be the default image. In other words, ascending order. Defaults to 0. | int | Optional |\n\n\n#### Price\nA price associated with the variant. You may have more than one price and currency associated\nwith a variant. In those cases, Attentive will likely choose the lowest available price in\nmessaging experiences.\n\n| Field | Description | Type | Required |\n| ----- | ----- | -------- | ---- |\n| currencyCode | This follows the three letter currency codes (e.g. USD). For more info, see [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html). | string | Required |\n| amount | The price amount | string | Required |\n| compareAtPrice | This is another price field, and use of this field implies the variant is on sale. This is the price buyers compare against to evaluate how good a sale is. Example: \"The price was <compareAtPrice> but now is <amount>! Get it while it lasts\" | string | Optional |\n\n\n### Formatted example of one product\nThe below example is formatted in json to clearly show the object schema. The file you pass to the API should be in **ndjson format**.\n```\n{\n \"name\": \"Nasa T-Shirt\",\n \"id\": \"PD-123\",\n \"description\": \"A very popular T-Shirt\",\n \"brand\": \"NASA\",\n \"link\": \"https://www.google.com\",\n \"lastUpdated\": \"2021-10-05T18:08:28+00:00\",\n \"categories\": [\"Shirts\"],\n \"tags\": [\"Summer Sale\", \"Space\"],\n \"productOptions\": [\n {\"name\": \"Color\", \"position\": 0, \"values\": [\"Blue\", \"Black\"]},\n {\"name\": \"Size\", \"position\": 1, \"values\": [\"Small\", \"Medium\", \"Large\"]}\n ],\n \"images\": [\n {\"src\": \"https://www.google.com\", \"alt\": \"Picture of Nasa T-Shirt in Blue\", \"position\": 0, \"height\": 250, \"width\": 400, \"variantIds\": [\"VD-234\"]},\n {\"src\": \"https://www.google.com\", \"alt\": \"Another Picture of Nasa T-Shirt in Black\", \"position\": 0, \"height\": 250, \"width\": 400, \"variantIds\": [\"VD-235\", \"VD-236\"]}\n ],\n \"attributes\": [{\"name\": \"Fabric\", \"value\": \"Cotton\"}],\n \"variants\": [\n {\n \"name\": \"Nasa T-Shirt - Blue - Small\",\n \"id\": \"VD-234\",\n \"position\": 0,\n \"prices\": [\n {\"currencyCode\": \"USD\", \"amount\": \"10.00\"}\n ],\n \"availableForPurchase\": true,\n \"inventoryQuantity\": 10,\n \"productOptionValues\": [\n {\"productOptionName\": \"Color\", \"value\": \"Blue\"},\n {\"productOptionName\": \"Size\", \"value\": \"Small\"}\n ],\n \"link\": \"https://www.google.com\",\n \"lastUpdated\": \"2021-10-05T18:08:28+00:00\"\n },\n {\n \"name\": \"Nasa T-Shirt - Black - Medium\",\n \"id\": \"VD-235\",\n \"position\": 1,\n \"prices\": [\n {\"currencyCode\": \"USD\", \"amount\": \"10.00\"}\n ],\n \"availableForPurchase\": true,\n \"inventoryQuantity\": 5,\n \"productOptionValues\": [\n {\"productOptionName\": \"Color\", \"value\": \"Black\"},\n {\"productOptionName\": \"Size\", \"value\": \"Medium\"}\n ],\n \"link\": \"https://www.google.com\",\n \"lastUpdated\": \"2021-10-05T18:08:28+00:00\"\n },\n {\n \"name\": \"Nasa T-Shirt - Black - Large\",\n \"id\": \"VD-236\",\n \"position\": 2,\n \"prices\": [\n {\"currencyCode\": \"USD\", \"amount\": \"10.00\"}\n ],\n \"availableForPurchase\": true,\n \"inventoryQuantity\": 0,\n \"productOptionValues\": [\n {\"productOptionName\": \"Color\", \"value\": \"Black\"},\n {\"productOptionName\": \"Size\", \"value\": \"Large\"}\n ],\n \"link\": \"https://www.google.com\",\n \"lastUpdated\": \"2021-10-05T18:08:28+00:00\"\n }\n ]\n}\n ```\n### Development Workflow Tips\n- As you're developing your code to generate this catalog file for Attentive, it's helpful to\nvalidate your generated files without any side effects on Attentive. To do that, please set\nthe `validateOnly` boolean to `true` when calling `/product-catalog/uploads`. Please note\nyour file is not immediately processed once the upload compeletes, but you can check the\nstatus of your upload with the same endpoint.\n- The cadence of uploading your catalog to Attentive is up to you. A daily job works great for most\nof our users, but we'd prefer we limit it to no more than every few hours if you're sending us\nyour entire catalog on every upload. However, if you would like to send us \"delta uploads\"\n(only products/variants which have changed since your last upload), please feel free to be more\nliberal with your cadence. If we find there are upload frequency issues, we'll be sure to reach\nout.\n- If you have any questions as to how to map your catalog to the Attentive format above,\nplease reach out to your client strategy partner at Attentive.\n\n### File Upload Limits\n- All files need to be UTF-8 encoded.\n- 2GB maximum file size\n- 4mb maximum line/product size\n- 500k line/product limit per file","x-beta":false},{"name":"Privacy Request","description":"You can use the Privacy Request API in order to comply with [California Consumer Privacy Act](https://epic.org/california-consumer-privacy-act-ccpa/)\ndeletion requests through Attentive. For more information, you can review [Attentive’s FAQs for CCPA](https://attentivemobile.atlassian.net/wiki/download/attachments/629309474/Attentive%20FAQs%20for%20CCPA.pdf?version=4&modificationDate=1585845052142&cacheVersion=1&api=v2)\nor the [Important Notice Regarding the CCPA of 2018](https://attentivemobile.atlassian.net/wiki/download/attachments/629309474/Important%20Notice%20Regarding%20the%20California%20Consumer%20Privacy%20Act%20of%202018%20(CCPA).pdf?version=1&modificationDate=1579115568586&cacheVersion=1&api=v2).\n\nIf you submit an email address or phone number that matches a user for the identified Company or Brand, Attentive will process your deletion request for the matching user(s) only. A user's data may not be deleted if it does not match at least one of the data elements you submitted in the request (email address or phone number). Attentive may reach out to you if we require additional instructions to process your request.\n","x-beta":false},{"name":"Identity","description":"Use the Identity API to manage user identifiers. With this API, you can programmatically add a client user identifier or custom identifier(s) to a user.\nYou should only use clientUserId and customIdentifiers to send Attentive your system-assigned unique identifiers (even when testing).\n\nNotes:\n - Sending duplicate values could lead to unintentionally bridging users together.\n - Don't use customIdentifiers to send attributes (e.g., first name, last name). To send those types of attributes,\n use our [Custom Attributes API](https://docs.attentivemobile.com/openapi/reference/tag/Custom-Attributes/).\n - Avoid sending null values or empty strings. If you don't have a valid identifier, you should omit the field\n from the payload.\n","x-beta":true}],"paths":{"/me":{"x-external":true,"get":{"x-external":true,"x-emits-event":true,"summary":"Me","description":"Make a call to this endpoint to test your unique token that you generate in the Attentive product.","operationId":"getMe","tags":["Test Authentication"],"responses":{"200":{"description":"Get information about the authenticated user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMeResponseDto"}}}},"400":{"$ref":"#/components/responses/InvalidParameter"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks":{"x-external":true,"get":{"x-external":true,"x-emits-event":true,"security":[{"OAuthFlow":["webhooks:write"]}],"summary":"List webhooks","description":"Make an API call to this endpoint to list existing webhooks.","operationId":"getWebhooks","tags":["Webhooks"],"responses":{"200":{"description":"existing webhooks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetWebhooksResponseDto"}}}},"400":{"$ref":"#/components/responses/InvalidParameter"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"x-external":true,"x-emits-event":true,"security":[{"OAuthFlow":["webhooks:write"]}],"summary":"Create webhook","description":"Make an API call to this endpoint to subscribe to a webhook.\n\nEvents are a collection of strings of the following types:\n* `sms.subscribed`\n* `sms.sent`\n* `sms.message_link_click`\n* `email.subscribed`\n* `email.unsubscribed`\n* `email.message_link_click`\n* `email.opened`\n* `custom_attribute.set`\n\nEvent types are case sensitive.\n\nAll events included will be sent to the URL.\n","operationId":"createWebhook","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequestDto"}}}},"responses":{"201":{"description":"Webhook has been created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookResponseDto"}}}},"400":{"$ref":"#/components/responses/InvalidParameter"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/webhooks/{webhookId}":{"delete":{"x-external":true,"x-emits-event":true,"security":[{"OAuthFlow":["webhooks:write"]}],"summary":"Delete webhook","description":"Make an API call to this endpoint to remove a webhook.","operationId":"deleteWebhook","parameters":[{"name":"webhookId","in":"path","description":"id of the webhook to delete","required":true,"schema":{"type":"string"}}],"tags":["Webhooks"],"responses":{"204":{"description":"Webhook has been deleted"},"400":{"$ref":"#/components/responses/InvalidParameter"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"x-external":true,"x-emits-event":true,"security":[{"OAuthFlow":["webhooks:write"]}],"summary":"Update webhook","description":"Make an API call to this endpoint to update a webhook","operationId":"updateWebhook","parameters":[{"name":"webhookId","in":"path","description":"The id of the webhook to update","required":true,"schema":{"type":"string"}}],"tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequestDto"}}}},"responses":{"200":{"description":"Webhook has been updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookResponseDto"}}}},"400":{"$ref":"#/components/responses/InvalidParameter"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/authorization-codes/tokens":{"x-external":true,"x-requires-auth":false,"x-sensitive":true,"post":{"x-external":true,"summary":"Access Token","description":"Make a call to this endpoint to exchange a temporary authorization code for an access token.","operationId":"createTokenViaAuthorizationCode","tags":["Access Token"],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","description":"Type of grant. Currently, authorization_code is the only accepted type.","example":"authorization_code"},"code":{"type":"string","description":"Authorization code provided after the user authorizes the scopes during the application install process.","example":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3"},"redirect_uri":{"type":"string","description":"The same redirect URI that was used when requesting the authorization code.","example":"https://test.com"},"client_id":{"type":"string","description":"The application’s client ID which can be found on the Manage Distribution tab for the application.","example":"9f7a2f11a4f849f59268869ec766111c"},"client_secret":{"type":"string","description":"The application’s client secret which can be found on the Manage Distribution tab for the application.","example":"0FvaRpPi5KBC4Izj9ALA0AG8J2WdcBhU"}}}}}},"responses":{"200":{"description":"Token generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenResponseDto"}}}}}}},"/events/ecommerce/product-view":{"x-external":true,"post":{"x-external":true,"x-emits-event":true,"security":[{"OAuthFlow":["ecommerce:write"]}],"summary":"Product view","description":"Make a call to this endpoint when a user views a product.","operationId":"postProductViewEvents","tags":["eCommerce"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductViewRequest"}}}},"responses":{"200":{"description":"Ok"},"400":{"$ref":"#/components/responses/InvalidParameter"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Intern
# --- truncated at 32 KB (281 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/attentive/refs/heads/main/openapi/attentive-v1-openapi.yaml