{"info":{"_postman_id":"d0b59d13-2054-44fe-b311-e9a3a8303b09","name":"Alvas API documentation","description":"<html><head></head><body><h1 id=\"get-started\">📄 Get started</h1>\n<p>The Alvas API enables you to personalize every email you send at scale, giving you higher open, click and conversion rates.</p>\n<p>You can transform datapoints into relevant subject lines, preview lines and body content for any type of email tempaltes.</p>\n<p>Simply just include a datapoint in the request and use it inside a prompt in the Alvas platform.</p>\n<h2 id=\"🔖-how-the-alvas-api-works\">🔖 How the Alvas API works</h2>\n<p>The Alvas API consists of 2 endpoints.</p>\n<ul>\n<li><p>Generate</p>\n</li>\n<li><p>Retrieve</p>\n</li>\n</ul>\n<p>It takes Alvas about 1-2 minutes to generate an email, and to avoid timeouts you need to generate a log from the first endpoint, and retreive the texts for that log in the second endpoint.</p>\n<p>We recommend adding a timedelay of 10 minutes in between requests. However you will be able to retrieve the texts as soon as they are done generating, also if that time is before the 10 minutes.</p>\n<hr>\n<h2 id=\"getting-started-guide\"><strong>Getting started guide</strong></h2>\n<p>To start using the Alvas API, here are a few key things to know:</p>\n<ul>\n<li><p>You must use a valid API Key to send requests to the API endpoints. You can get your API key from Alvas <a href=\"https://app.alvas.ai/settings/integrations\">integrations dashboard</a>.</p>\n</li>\n<li><p>The API returns request responses in JSON format. When an API request returns an error, it is sent in the JSON response as an error key.</p>\n</li>\n<li><p>Use the <a href=\"https://app.alvas.ai/dashboard\">Alvas platform</a> to monitor logs, see analytics and change prompts.</p>\n</li>\n</ul>\n<h2 id=\"authentication\">Authentication</h2>\n<p>The Alvas API authenticates the response, with a <code>x-alvas-api-key</code>header.</p>\n<p>Alvas uses API keys for authentication. You can find your API key in the <a href=\"https://app.alvas.ai/settings/integrations\">API keys</a> section of your Alvas team settings.</p>\n<p>You must include an API key in each request to the Postman API with the<code>x-alvas-api-key</code> request header.</p>\n<h3 id=\"authentication-error-response\">Authentication error response</h3>\n<p>If an API key is missing, malformed, or invalid, you will receive an HTTP 401 Unauthorized response code.</p>\n<h3 id=\"need-some-help\"><strong>Need some help?</strong></h3>\n<p>In case you have questions, go through our written toturials <a href=\"https://alvas.ai/academy/\">https://alvas.ai/academy/,</a> our video toturials on <a href=\"https://www.youtube.com/@alvas-ai\">https://www.youtube.com/@alvas-ai</a> or reach out to us at <a href=\"https://mailto:villads@alvas.ai\">villads@alvas.ai</a>.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"📄 Get started","slug":"get-started"}],"owner":"28181219","collectionId":"d0b59d13-2054-44fe-b311-e9a3a8303b09","publishedId":"2sA3kRL4sU","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-07-17T16:37:44.000Z"},"item":[{"name":"Generate","id":"f25a8c1e-3bb6-4412-a476-db545b7e9ab0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-alvas-api-key"},{"key":"value","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"productData\": [\n        {\n            \"product_id\": \"000001\",\n            \"product_name\": \"Nike Air Max Plus\",\n            \"product_url\": \"https://www.nike.com/dk/en/t/air-max-plus-older-shoes-TM2lTJ/CD0609-001\",\n            \"product_image_url\": \"https://static.nike.com/a/images/t_PDP_1728_v1/f_auto,q_auto:eco/zvggo9fhlalzrv9hc7j1/air-max-plus-older-shoes-TM2lTJ.png\",\n            \"product_price\": \"200\",\n            \"product_price_currency\": \"USD\"\n        },\n        {\n            \"product_id\": \"000002\",\n            \"product_name\": \"Nike Air Force 1 Sage Low\",\n            \"product_url\": \"https://www.nike.com/dk/en/t/air-force-1-sage-low-shoe-JzTZP0/AR5339-100\",\n            \"product_image_url\": \"https://static.nike.com/a/images/t_PDP_1728_v1/f_auto,q_auto:eco/ylzjsomnnwbiqj8ssv7v/air-force-1-sage-low-shoe-JzTZP0.png\",\n            \"product_price\": \"180\",\n            \"product_price_currency\": \"USD\"\n        }\n    ],\n    \"profileData\": {\n        \"profile_id\": \"1234\",\n        \"profile_first_name\": \"Doe\",\n        \"profile_last_name\": \"John\",\n        \"profile_city\": \"New York City\",\n        \"profile_country\": \"USA\",\n        \"profile_email\": \"john.doe@gmail.com\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://webhook.alvas.ai/api/integrations/api/email/webhook?emailId={{EMAIL_ID}}","description":"<p>This endpoint receives data about a person, and one or multiple products, and triggers an email generation in Alvas.</p>\n<p>It returns a Log ID, that should be stored as a custom attribute on a profile, so it can be used in the call to retrieve the generated texts.</p>\n<p>You can see the log inside the platform: <a href=\"https://app.alvas.ai/logs.\">https://app.alvas.ai/logs.</a></p>\n<p>It is possible to send over data in another format and add custom datapoints. Please contact villads at <a href=\"mailto:villads@alvas.ai\">villads@alvas.ai</a>, and send an example of the JSON body you want to send over to Alvas via the API.</p>\n<p>He will configure how data is received for your team.</p>\n","urlObject":{"protocol":"https","path":["api","integrations","api","email","webhook"],"host":["webhook","alvas","ai"],"query":[{"key":"emailId","value":"{{EMAIL_ID}}"}],"variable":[]}},"response":[{"id":"7c2e4114-0f62-4421-894f-6e5a900d2ae3","name":"Generate","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"productData\": [\n        {\n            \"product_id\": \"000001\",\n            \"product_name\": \"Nike Air Max Plus\",\n            \"product_url\": \"https://www.nike.com/dk/en/t/air-max-plus-older-shoes-TM2lTJ/CD0609-001\",\n            \"product_image_url\": \"https://static.nike.com/a/images/t_PDP_1728_v1/f_auto,q_auto:eco/zvggo9fhlalzrv9hc7j1/air-max-plus-older-shoes-TM2lTJ.png\",\n            \"product_price\": \"200\",\n            \"product_price_currency\": \"USD\"\n        },\n        {\n            \"product_id\": \"000002\",\n            \"product_name\": \"Nike Air Force 1 Sage Low\",\n            \"product_url\": \"https://www.nike.com/dk/en/t/air-force-1-sage-low-shoe-JzTZP0/AR5339-100\",\n            \"product_image_url\": \"https://static.nike.com/a/images/t_PDP_1728_v1/f_auto,q_auto:eco/ylzjsomnnwbiqj8ssv7v/air-force-1-sage-low-shoe-JzTZP0.png\",\n            \"product_price\": \"180\",\n            \"product_price_currency\": \"USD\"\n        }\n    ],\n    \"profileData\": {\n        \"profile_id\": \"1234\",\n        \"profile_first_name\": \"Doe\",\n        \"profile_last_name\": \"John\",\n        \"profile_city\": \"New York City\",\n        \"profile_country\": \"USA\",\n        \"profile_email\": \"john.doe@gmail.com\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://webhook.alvas.ai/api/integrations/api/email/webhook?emailId=1022","protocol":"https","host":["webhook","alvas","ai"],"path":["api","integrations","api","email","webhook"],"query":[{"key":"emailId","value":"1022"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"access-control-allow-origin","value":"*"},{"key":"content-type","value":"application/json; charset=utf-8"},{"key":"etag","value":"\"108b6ga5kawr\""},{"key":"content-length","value":"27"},{"key":"vary","value":"Accept-Encoding"},{"key":"date","value":"Wed, 17 Jul 2024 16:42:33 GMT"},{"key":"server","value":"railway"}],"cookie":[],"responseTime":null,"body":"{\n    \"email_log_id\": 1000474120\n}"}],"_postman_id":"f25a8c1e-3bb6-4412-a476-db545b7e9ab0"},{"name":"Retrieve","id":"ffa946c1-e01e-4a43-aa62-f93b6e78bd36","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-alvas-api-key"},{"key":"value","value":"{{token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email_log_id\": \"1000474120\",\n    \"profile_email\": \"john.doe@gmail.com\"\n}","options":{"raw":{"language":"json"}}},"url":"https://webhook.alvas.ai/api/integrations/api/email/log/get-custom-email-log","description":"<p>This endpoint is for you to retrieve the generated texts.</p>\n<p>Call it with a Log ID and an email address to receive the texts from the email.</p>\n<p>It typically takes 2-3 minutes to generate an email, so be sure to keep a wait between the Generate and the Retrieve endpoints.</p>\n","urlObject":{"protocol":"https","path":["api","integrations","api","email","log","get-custom-email-log"],"host":["webhook","alvas","ai"],"query":[],"variable":[]}},"response":[{"id":"9f4a893a-9a5c-40e7-a94a-15e7e4668790","name":"Retrieve","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email_log_id\": \"1000474120\",\n    \"profile_email\": \"john.doe@gmail.com\"\n}","options":{"raw":{"language":"json"}}},"url":"https://webhook.alvas.ai/api/integrations/api/email/log/get-custom-email-log"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json; charset=utf-8"},{"key":"etag","value":"\"7m5d2cder8ib\""},{"key":"content-length","value":"665"},{"key":"vary","value":"Accept-Encoding"},{"key":"date","value":"Wed, 17 Jul 2024 16:44:46 GMT"},{"key":"server","value":"railway"}],"cookie":[],"responseTime":null,"body":"{\n    \"Alvas_Email_1022_cta\": \"SHOP NOW\",\n    \"Alvas_Email_1022_body\": \"Hey John, imagine striding through NYC with the Nike Air Max Plus! It offers premium cushioning and a wavy design that's sure to stand out. The Nike Air Force 1 Sage Low adds a bold twist to the classic AF1, perfect for making a statement. Own your style your way!\",\n    \"Alvas_Email_1022_headline\": \"Score your kicks today\",\n    \"Alvas_Email_1022_preview_line\": \"Your new Nikes await you! 👟🔥\",\n    \"Alvas_Email_1022_product_text\": \"The Nike Air Max Plus is a sneaker.\",\n    \"Alvas_Email_1022_subject_line\": \"Don't miss out on your cart 🛒\",\n    \"Alvas_Email_1022_product_text_2\": \"The Nike Air Force 1 Sage Low is a sneaker.\"\n}"}],"_postman_id":"ffa946c1-e01e-4a43-aa62-f93b6e78bd36"}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-alvas-api-key"},{"key":"value","value":"{{token}}"}]}},"event":[{"listen":"prerequest","script":{"id":"935d1f67-e343-4426-9f8b-d1f18e15c036","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"875a1852-fab7-41ab-bbaa-5d1facc4faca","type":"text/javascript","exec":[""]}}],"variable":[{"key":"baseUrl","value":"https://farming-simulator.pstmn.io"}]}