CINXE.COM
Consent Kit API docs | Consent Kit
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- Begin Jekyll SEO tag v2.8.0 --> <title>Consent Kit API docs | Consent Kit</title> <meta name="generator" content="Jekyll v4.2.2" /> <meta property="og:title" content="Consent Kit API docs" /> <meta property="og:locale" content="en_GB" /> <meta name="description" content="The Consent Kit API uses standard REST API best practices. The complete reference documentation for the Consent Kit API, including code snippets and examples." /> <meta property="og:description" content="The Consent Kit API uses standard REST API best practices. The complete reference documentation for the Consent Kit API, including code snippets and examples." /> <link rel="canonical" href="https://consentkit.com/docs/api" /> <meta property="og:url" content="https://consentkit.com/docs/api" /> <meta property="og:site_name" content="Consent Kit" /> <meta property="og:image" content="https://consentkit.com/assets/images/opengraph/default-1200x630.png" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary_large_image" /> <meta property="twitter:image" content="https://consentkit.com/assets/images/opengraph/default-1200x630.png" /> <meta property="twitter:title" content="Consent Kit API docs" /> <meta name="twitter:site" content="@consentkit" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","dateModified":"2020-01-30T00:00:00+00:00","description":"The Consent Kit API uses standard REST API best practices. The complete reference documentation for the Consent Kit API, including code snippets and examples.","headline":"Consent Kit API docs","image":"https://consentkit.com/assets/images/opengraph/default-1200x630.png","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://consentkit.com/assets/images/logomark.svg"}},"url":"https://consentkit.com/docs/api"}</script> <!-- End Jekyll SEO tag --> <link type="application/atom+xml" rel="alternate" href="https://consentkit.com/feed.xml" title="Consent Kit" /> <link rel="stylesheet" href="/assets/css/main.css" /> <link rel="icon" type="image/png" href="/assets/images/icons/favicon.png" /> <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js" integrity="sha256-qXBd/EfAdjOA2FGrGAG+b3YBn2tn5A6bhz+LSgYD96k=" crossorigin="anonymous"></script> <script type="text/javascript" src="/assets/js/bundle.js"></script> <script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js" integrity="sha384-SlE991lGASHoBfWbelyBPLsUlwY1GwNDJo3jSJO04KZ33K2bwfV9YBauFfnzvynJ" crossorigin="anonymous"></script> <!-- Start cookieyes banner (has to be the first script we load) --> <script id="cookieyes" type="text/javascript" src="https://cdn-cookieyes.com/client_data/7a5afe69865ffdd2581d3820/script.js"></script> <!-- End cookieyes banner --> <!-- Hotjar Tracking Code for https://www.consentkit.com --> <script> (function (h, o, t, j, a, r) { h.hj = h.hj || function () { (h.hj.q = h.hj.q || []).push(arguments); }; h._hjSettings = { hjid: 3266144, hjsv: 6 }; a = o.getElementsByTagName("head")[0]; r = o.createElement("script"); r.async = 1; r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv; a.appendChild(r); })(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv="); </script> <script> (function (ss, ex) { window.ldfdr = window.ldfdr || function () { (ldfdr._q = ldfdr._q || []).push([].slice.call(arguments)); }; (function (d, s) { fs = d.getElementsByTagName(s)[0]; function ce(src) { var cs = d.createElement(s); cs.src = src; cs.async = 1; fs.parentNode.insertBefore(cs, fs); } ce("https://sc.lfeeder.com/lftracker_v1_" + ss + (ex ? "_" + ex : "") + ".js"); })(document, "script"); })("bElvO73y5yGaZMqj"); </script> <script src="https://cdn.usefathom.com/script.js" data-site="TVDJIUYS" defer></script> <script> (function (ss, ex) { window.ldfdr = window.ldfdr || function () { (ldfdr._q = ldfdr._q || []).push([].slice.call(arguments)); }; (function (d, s) { fs = d.getElementsByTagName(s)[0]; function ce(src) { var cs = d.createElement(s); cs.src = src; cs.async = 1; fs.parentNode.insertBefore(cs, fs); } ce("https://sc.lfeeder.com/lftracker_v1_" + ss + (ex ? "_" + ex : "") + ".js"); })(document, "script"); })("bElvO73y5yGaZMqj"); </script> </head> <body> <a href="#content" class="sr-only">Skip to main content</a> <div class="h-screen flex overflow-hidden bg-white" data-controller="dropdown"> <!-- Off-canvas menu for mobile, show/hide based on off-canvas menu state. --> <div class="hidden md:hidden" data-dropdown-target="menu"><div class="fixed inset-0 flex z-40"> <!-- Off-canvas menu overlay, show/hide based on off-canvas menu state. Entering: "transition-opacity ease-linear duration-300" From: "opacity-0" To: "opacity-100" Leaving: "transition-opacity ease-linear duration-300" From: "opacity-100" To: "opacity-0" --> <div class="fixed inset-0"> <div class="absolute inset-0 bg-gray-600 opacity-75"></div> </div> <!-- Off-canvas menu, show/hide based on off-canvas menu state. Entering: "transition ease-in-out duration-300 transform" From: "-translate-x-full" To: "translate-x-0" Leaving: "transition ease-in-out duration-300 transform" From: "translate-x-0" To: "-translate-x-full" --> <div class="relative flex-1 flex flex-col max-w-xs w-full bg-white"> <div class="absolute top-0 right-0 -mr-12 pt-2"> <button class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white" data-action="click->dropdown#toggle click@window->dropdown#hide" > <span class="sr-only">Close sidebar</span> <!-- Heroicon name: outline/x --> <svg class="h-6 w-6 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> </svg> </button> </div> <div class="flex-1 h-0 pt-5 pb-4 overflow-y-auto"> <div class="flex-shrink-0 flex items-center px-4"> <a href="/" class="flex items-center"> <img class="h-4 sm:h-5" src="/assets/images/logo.svg" alt="Consent Kit logo" width="30" height="40" /> <h2 class="md:block text-lg ml-2 font-display font-medium"> Consent Kit <span class="text-green-500 ml-2">API</span> </h2> </a> </div> <nav class="mt-5 px-2 space-y-1"> <a href="/docs/api#authentication" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md" data-action="click->dropdown#toggle click@window->dropdown#hide" >Authentication</a > <a href="/docs/api#projects" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md" data-action="click->dropdown#toggle click@window->dropdown#hide" >Responses</a > <a href="/docs/api#projects" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md" data-action="click->dropdown#toggle click@window->dropdown#hide" >Projects</a > <a href="/docs/api#events" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md" data-action="click->dropdown#toggle click@window->dropdown#hide" >Studies</a > <a href="/docs/api#participants" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md" data-action="click->dropdown#toggle click@window->dropdown#hide" >Participants</a > <a href="/docs/api#consents" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md" data-action="click->dropdown#toggle click@window->dropdown#hide" >Consents</a > <a href="/docs/api#data-links" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md" data-action="click->dropdown#toggle click@window->dropdown#hide" >Data Links</a > </nav> </div> <div class="flex-shrink-0 flex border-t border-gray-200 p-4"> <a href="mailto:help@consentkit.com" class="flex-shrink-0 w-full group block" target="_blank" data-action="click->dropdown#toggle click@window->dropdown#hide" > <i class="fas fa-envelope"></i> Contact support </a> </div> </div> <div class="flex-shrink-0 w-14"> <!-- Force sidebar to shrink to fit close icon --> </div> </div> </div> <!-- Static sidebar for desktop --> <div class="hidden md:flex md:flex-shrink-0"> <div class="flex flex-col w-64"> <div class="flex flex-col h-0 flex-1 border-r border-gray-200 bg-white"> <div class="flex-1 flex flex-col pt-5 pb-4 overflow-y-auto"> <div class="flex items-center flex-shrink-0 px-4"> <a href="/" class="flex items-center"> <img class="h-4 sm:h-5" src="/assets/images/logo.svg" alt="Consent Kit logo" width="30" height="40" /> <h2 class="md:block text-lg ml-2 font-display font-medium"> Consent Kit <span class="text-green-500 ml-2">API</span> </h2> </a> </div> <nav class="mt-5 flex-1 px-2 bg-white space-y-1"> <a href="/docs/api#authentication" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">Authentication</a> <a href="/docs/api#projects" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">Responses</a> <a href="/docs/api#projects" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">Projects</a> <a href="/docs/api#events" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">Studies</a> <a href="/docs/api#participants" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">Participants</a> <a href="/docs/api#consents" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">Consents</a> <a href="/docs/api#data-links" class="text-gray-600 hover:bg-gray-50 hover:text-gray-900 group flex items-center px-2 py-2 text-sm font-medium rounded-md">Data Links</a> <!-- Current: "bg-gray-100 text-gray-900", Default: "text-gray-600 hover:bg-gray-50 hover:text-gray-900" --> </nav> </div> <div class="flex-shrink-0 flex border-t border-gray-200 p-4"> <a href="mailto:help@consentkit.com" class="flex-shrink-0 w-full group block" target="_blank"> <i class="fas fa-envelope"></i> Contact support </a> </div> </div> </div> </div> <div class="flex flex-col w-0 flex-1 overflow-hidden"> <div class="md:hidden pl-1 pt-1 sm:pl-3 sm:pt-3"> <button class="-ml-0.5 -mt-0.5 h-12 w-12 inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500" data-action="click->dropdown#toggle click@window->dropdown#hide" data-dropdown-id-value="mobile" > <span class="sr-only">Open sidebar</span> <!-- Heroicon name: outline/menu --> <svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /> </svg> </button> </div> <main class="flex-1 relative z-0 overflow-y-auto focus:outline-none" tabindex="0"> <div class="py-6"> <!-- <div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8"> <h1 class="text-2xl font-semibold text-gray-900">Consent Kit API docs</h1> </div> --> <div class="max-w-7xl mx-auto px-4 sm:px-6 md:px-8 prose prose-api prose-indigo lg:grid lg:grid-cols-2 lg:gap-x-24 lg:gap-y-12"><div class="col-span-2 mt-6"> <h1 id="intro" title="Introduction" class="font-display">API Reference</h1> </div> <div> <p> The consent Kit API uses standard REST practices. Resource-orientated URLs, returns JSON encoded responses and uses standard HTTP response codes, authentication and verbs. </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md"> <h3 class="bg-gray-200 px-4 py-2">Base url</h3> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>https://api.consentkit.com</code></pre></figure> </div> </aside> <div class="col-span-2 border-gray-200 border-t"> <h2 id="authentication" class="font-display">Authentication</h2> </div> <div> <p>All the API endpoints for Consent Kit require authentication. We allow the following methods</p> <ul> <li>OAuth2 tokens</li> <li>API keys (coming soon)</li> </ul> </div> <aside> <p>At the moment API access is request only. Get in touch and we can set you up.</p> </aside> <div> <h3>Oauth2 tokens</h3> <p>You can use the OAuth2 token by passing it in the header</p> </div> <aside><div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">Authenticated request</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/participants'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> </aside> <div class="col-span-2 border-gray-200 border-t"> <h2 id="projects" class="font-display">Responses</h2> </div> <div> <p>We use conventional HTTP response codes to indicate the success or failure of an API request</p> <ul> <li> <code>2xx</code> range indicates a success</li> <li> <code>4xx</code> range indicates an an error that there was some missing provided information</li> <li> <code>5xx</code> range means there is something wrong on our end</li> </ul> <h2>Common errors</h2> </div> <aside></aside> <div> <h3>400</h3> <p> This only usually happens on creating objects when a validation error is caused. Usually missing a required field </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"errors"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"recorded_at"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"Enter the date"</span><span class="p">]</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"validation_error"</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <div> <h3>401</h3> <p>When an invalid key or token is provided</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"error"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Invalid API Key provided: TOKEN"</span><span class="p">,</span><span class="w"> </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"invalid_request_error"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <div> <h3>404</h3> <p> A 404 is caused when a missing resource is requested. For example when the resource with the requested id does not exist </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"error"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Couldn't find participant using participant_id: foo"</span><span class="p">,</span><span class="w"> </span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"invalid_request_error"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <div class="col-span-2 border-gray-200 border-t"> <h2 id="projects" class="font-display">Projects</h2> </div> <div> <p><code>project</code> objects represent the projects that are within your organisation.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Endpoints</h3> <ul class="list-none"> <li class="font-mono">GET <a href="#project-index">/v1/projects</a></li> <li class="font-mono">GET <a href="#project-show">/v1/projects/:id</a></li> </ul> </div> </aside> <!-- Object --> <div> <h2 id="project-object" title="The project object">The project object</h2> <h3>Attributes</h3> <ul class="list-properties"> <li> <h4>id</h4> <span>string</span> <p>Unique identifier for the object</p> </li> <li> <h4>object</h4> <span>string</span> <p>Name of the object type</p> </li> <li> <h4>created_at</h4> <span>timestamp</span> <p>When the object was created</p> </li> <li> <h4>updated_at</h4> <span>timestamp</span> <p>When the object was last updated</p> </li> <li> <h4>app_url</h4> <span>string</span> <p>The URL for the project within the Consent Kit App</p> </li> </ul> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Project name"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-01-18T10:06:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-01-18T10:06:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /Object --> <!-- index --> <div> <h2 id="project-index">List all projects</h2> <p>Returns a list of all your organisations projects. Sorted by creation date.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>limit</h4> <span>optional</span> <p>A limit on the number of objects returned, the default is 20</p> </li> <li> <h4>page</h4> <span>optional</span> <p>Combined with a limit or the default to be able to paginate through all the objects, the default is 1</p> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> A list object with a data property that contains an array of up to <code>limit</code> projects, using the <code>page</code> as a starting point. Each entry in the array is a separate project object. If no more project are available, the resulting array will be empty. </p> <p>This request should never return an error.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/projects</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/projects'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"list"</span><span class="p">,</span><span class="w"> </span><span class="nl">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"> </span><span class="nl">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Project name"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-01-18T10:06:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-01-18T10:06:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">}</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /index --> <!-- show --> <div> <h2 id="project-show">Retrieve a project</h2> <p>Retrieves the details for a project. You only need to supply the unique project identifier.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <span>None</span> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4">Returns a project object if a valid identifier was provided.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/projects/:id</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Project name"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-01-18T10:06:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-01-18T10:06:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /show --> <div class="col-span-2 border-gray-200 border-t"> <h2 id="events" class="font-display">Studies</h2> </div> <div> <p><code>Study</code> objects represent the events that are within your organisation.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Endpoints</h3> <ul class="list-none"> <li class="font-mono">POST <a href="#event-create">/v1/events</a></li> <li class="font-mono">GET <a href="#event-index">/v1/events</a></li> <li class="font-mono">GET <a href="#event-show">/v1/events/:id</a></li> <li class="font-mono">DELETE <a href="#event-delete">/v1/events/:id</a></li> </ul> </div> </aside> <!-- object --> <div> <h2 id="event-object" title="The event object">The event object</h2> <h3>Attributes</h3> <ul class="list-properties"> <li> <h4>id</h4> <span>string</span> <p>Unique identifier for the object</p> </li> <li> <h4>object</h4> <span>string</span> <p>Name of the object type. This will be "event".</p> </li> <li> <h4>created_at</h4> <span>timestamp</span> <p>When the object was created</p> </li> <li> <h4>updated_at</h4> <span>timestamp</span> <p>When the object was last updated</p> </li> <li> <h4>app_url</h4> <span>string</span> <p>The URL for the event within the Consent Kit App</p> </li> <li> <h4>project</h4> <span>object</span> <p>The project that the event is associated with.</p> </li> </ul> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Project name"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /object --> <!-- create --> <div> <h2 id="event-create">Create a study</h2> <p>Create a study within a project.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>project_id</h4> <span>required</span> <p>The unique identifier for a project</p> </li> <li> <h4>name</h4> <span>required</span> <p>The name for the new event</p> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> Returns the event object if the create succeeded. Returns an error if create parameters are invalid </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h4 class="bg-gray-200 px-4 py-2 font-mono">POST /v1/events</h4> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/events'</span> <span class="se">\</span> <span class="nt">-X</span> POST <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span> <span class="nt">-d</span> <span class="s1">'{ "project_id": "proj_rNW9MurEP8gJ3S4cY2Lu7JH8", "name": "Interview with customers" }'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Project name"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /create --> <!-- index --> <div> <h2 id="#event-index">List all events</h2> <p>Returns a list of all your organisations events. Sorted by creation date.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>limit</h4> <span>optional</span> <p>A limit on the number of objects returned, the default is 20</p> </li> <li> <h4>page</h4> <span>optional</span> <p>Combined with a limit or the default to be able to paginate through all the objects, the default is 1</p> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> A list object with a data property that contains an array of up to <code>limit</code> events, using the <code>page</code> as a starting point. Each entry in the array is a separate event object. If no more event are available, the resulting array will be empty. </p> <p>This request should never return an error.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/events</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/events'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"list"</span><span class="p">,</span><span class="w"> </span><span class="nl">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"> </span><span class="nl">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Project name"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">}</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /index --> <!-- show --> <div> <h2 id="event-show">Retrieve a event</h2> <p>Retrieves the details for a event. You only need to supply the unique event identifier.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <span>None</span> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4">Returns a event object if a valid identifier was provided.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/events/:id</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/events/evt_8SaYJK8AgbpG6FXpddJgfsVM'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"project"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Project name"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/projects/proj_rNW9MurEP8gJ3S4cY2Lu7JH8"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /show --> <!-- delete --> <div> <h2 id="event-delete">Delete a event</h2> <p>Delete a study. You only need to supply the unique event identifier.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <span>None</span> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> Returns an object with a deleted parameter on success. If the event id does not exist, this call returns an error. </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">DELETE /v1/events/:id</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/events/evt_8SaYJK8AgbpG6FXpddJgfsVM'</span> <span class="se">\</span> <span class="nt">-X</span> DELETE <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"deleted"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /delete --> <div class="col-span-2 border-gray-200 border-t"> <h2 id="participants" class="font-display">Participants</h2> </div> <div> <p><code>Participant</code> objects represent the participants that are within your organisation.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Endpoints</h3> <ul class="list-none"> <li class="font-mono">POST <a href="#participant-create">/v1/participants</a></li> <li class="font-mono">GET <a href="#participant-index">/v1/participants</a></li> <li class="font-mono">GET <a href="#participant-show">/v1/participants/:id</a></li> </ul> </div> </aside> <!-- object --> <div> <h2 id="participant-object" title="The participant object">The participant object</h2> <h3>Attributes</h3> <ul class="list-properties"> <li> <h4>id</h4> <span>string</span> <p>Unique identifier for the object</p> </li> <li> <h4>object</h4> <span>string</span> <p>Name of the object type. This will be "participant"</p> </li> <li> <h4>first_name</h4> <span>string</span> <p>The first name of the participant.</p> </li> <li> <h4>email</h4> <span>string</span> <p>The email of the participant.</p> </li> <li> <h4>created_at</h4> <span>timestamp</span> <p>When the object was created</p> </li> <li> <h4>updated_at</h4> <span>timestamp</span> <p>When the object was last updated</p> </li> <li> <h4>anonymous_id</h4> <span>string</span> <p> The id of the participant that is unique to that participant for the event. Can be used instead of PII as a human friendly identifier </p> </li> <li> <h4>app_url</h4> <span>string</span> <p>The URL for the participant within the Consent Kit App</p> </li> <li> <h4>event</h4> <span>object</span> <p>The event that the participant is taking part in.</p> </li> </ul> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"participant"</span><span class="p">,</span><span class="w"> </span><span class="nl">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Alice"</span><span class="p">,</span><span class="w"> </span><span class="nl">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@example.com"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"anonymous_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P1"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM/participants/par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_id"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /object --> <!-- create --> <div> <h2 id="participant-create">Create a participant</h2> <p>Creates a participant.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>name</h4> <span>required</span> <p>The participants full name.</p> </li> <li> <h4>email</h4> <span>required</span> <p>The participants email address. Used to send the consent remotely and for communications.</p> </li> <li> <h4>event_id</h4> <span>required</span> <p>The unique identifier for the event that the participant is participating in.</p> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> Returns the participant object if the create succeeded. Returns an error if create parameters are invalid </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h4 class="bg-gray-200 px-4 py-2 font-mono">POST /v1/participants</h4> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/participants'</span> <span class="se">\</span> <span class="nt">-X</span> POST <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span> <span class="nt">-d</span> <span class="s1">'{ "name": "Alice Apple", "email": "test@example.com", "event_id": "evt_8SaYJK8AgbpG6FXpddJgfsVM", }'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"participant"</span><span class="p">,</span><span class="w"> </span><span class="nl">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Alice"</span><span class="p">,</span><span class="w"> </span><span class="nl">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@example.com"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"anonymous_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P1"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM/participants/par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_id"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /create --> <!-- index --> <div> <h2 id="participant-index">List all participants</h2> <p>Returns a list of all your organisations participants. Sorted by creation date.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>limit</h4> <span>optional</span> <p>A limit on the number of objects returned, the default is 20</p> </li> <li> <h4>page</h4> <span>optional</span> <p>Combined with a limit or the default to be able to paginate through all the objects, the default is 1</p> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> A list object with a data property that contains an array of up to <code>limit</code> participants, using the <code>page</code> as a starting point. Each entry in the array is a separate participant object. If no more participant are available, the resulting array will be empty. </p> <p>This request should never return an error.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/participants</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/participants'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"list"</span><span class="p">,</span><span class="w"> </span><span class="nl">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"> </span><span class="nl">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"participant"</span><span class="p">,</span><span class="w"> </span><span class="nl">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Alice"</span><span class="p">,</span><span class="w"> </span><span class="nl">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@example.com"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"anonymous_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P1"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM/participants/par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_id"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">}</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /index --> <!-- show --> <div> <h2 id="participant-show">Retrieve a participant</h2> <p>Retrieves the details for a participant. You only need to supply the unique participant identifier.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <span>None</span> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4">Returns a participant object if a valid identifier was provided.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/participants/:id</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/participants/par_TBuhrZgWc41kUa3gL6zxhJUq'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"participant"</span><span class="p">,</span><span class="w"> </span><span class="nl">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Alice"</span><span class="p">,</span><span class="w"> </span><span class="nl">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@example.com"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"anonymous_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P1"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM/participants/par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_id"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /show --> <div class="col-span-2 border-gray-200 border-t"> <h2 id="consents" class="font-display">Consents</h2> </div> <div> <p><code>Consent</code> objects represent the consents that are within your organisation.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Endpoints</h3> <ul class="list-none"> <li class="font-mono">GET <a href="#consent-index">/v1/consents</a></li> <li class="font-mono">GET <a href="#consent-show">/v1/consents/:id</a></li> </ul> </div> </aside> <!-- object --> <div> <h2 id="consent-object" title="The consent object">The consent object</h2> <h3>Attributes</h3> <ul class="list-properties"> <li> <h4>id</h4> <span>string</span> <p>Unique identifier for the object</p> </li> <li> <h4>object</h4> <span>string</span> <p>Name of the object type. This will be "consent"</p> </li> <li> <h4>created_at</h4> <span>timestamp</span> <p>When the object was created</p> </li> <li> <h4>updated_at</h4> <span>timestamp</span> <p>When the object was last updated</p> </li> <li> <h4>consented_at</h4> <span>timestamp</span> <p>When the consent was given or refused</p> </li> <li> <h4>status</h4> <span>string</span> <p>If the consent was given. One of <code>agreed</code> or <code>refused</code></p> </li> <li> <h4>permissions</h4> <span>array</span> <p>A list of strings which are the permissions that the participant has given</p> </li> <li> <h4>participant</h4> <span>object</span> <p>The participant the consent is attached to</p> </li> </ul> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"con_LZp1rZc9mGBirpdTosvbvuo3"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"consent"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"consented_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"agreed"</span><span class="p">,</span><span class="w"> </span><span class="nl">"permissions"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"I agree ..."</span><span class="p">,</span><span class="w"> </span><span class="s2">"..."</span><span class="p">],</span><span class="w"> </span><span class="nl">"participant"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"participant"</span><span class="p">,</span><span class="w"> </span><span class="nl">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Alice"</span><span class="p">,</span><span class="w"> </span><span class="nl">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@example.com"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"anonymous_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P1"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM/participants/par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_id"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /object --> <!-- index --> <div> <h2 id="consent-index">List all consents</h2> <p>Returns a list of all your organisations consents. Sorted by creation date.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>limit</h4> <span>optional</span> <p>A limit on the number of objects returned, the default is 20</p> </li> <li> <h4>page</h4> <span>optional</span> <p>Combined with a limit or the default to be able to paginate through all the objects, the default is 1</p> </li> <li> <h4>status</h4> <span>optional</span> <p>Filter the consents by the status. One of <code>agreed</code> or <code>refused</code></p> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> A list object with a data property that contains an array of up to <code>limit</code> consents, using the <code>page</code> as a starting point. Each entry in the array is a separate consent object. If no more consent are available, the resulting array will be empty. </p> <p>This request should never return an error.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/consents</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/consents'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"list"</span><span class="p">,</span><span class="w"> </span><span class="nl">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"> </span><span class="nl">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"con_LZp1rZc9mGBirpdTosvbvuo3"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"consent"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"consented_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"agreed"</span><span class="p">,</span><span class="w"> </span><span class="nl">"permissions"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"I agree ..."</span><span class="p">,</span><span class="w"> </span><span class="s2">"..."</span><span class="p">],</span><span class="w"> </span><span class="nl">"participant"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"participant"</span><span class="p">,</span><span class="w"> </span><span class="nl">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Alice"</span><span class="p">,</span><span class="w"> </span><span class="nl">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@example.com"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"anonymous_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P1"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM/participants/par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_id"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">}</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /index --> <!-- show --> <div> <h2 id="consent-show">Retrieve a consent</h2> <p>Retrieves the details for a consent. You only need to supply the unique consent identifier.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <span>None</span> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4">Returns a consent object if a valid identifier was provided.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/consents/:id</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/consents/con_LZp1rZc9mGBirpdTosvbvuo3'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"con_LZp1rZc9mGBirpdTosvbvuo3"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"consent"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"consented_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"agreed"</span><span class="p">,</span><span class="w"> </span><span class="nl">"permissions"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"I agree ..."</span><span class="p">,</span><span class="w"> </span><span class="s2">"..."</span><span class="p">],</span><span class="w"> </span><span class="nl">"participant"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"participant"</span><span class="p">,</span><span class="w"> </span><span class="nl">"first_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Alice"</span><span class="p">,</span><span class="w"> </span><span class="nl">"email"</span><span class="p">:</span><span class="w"> </span><span class="s2">"test@example.com"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"anonymous_id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"P1"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM/participants/par_TBuhrZgWc41kUa3gL6zxhJUq"</span><span class="p">,</span><span class="w"> </span><span class="nl">"event"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"evt_id"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"event"</span><span class="p">,</span><span class="w"> </span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Interview with customers"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"app_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/events/evt_8SaYJK8AgbpG6FXpddJgfsVM"</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /show --> <div class="col-span-2 border-gray-200 border-t"> <h2 id="data-links" class="font-display">Data Links</h2> </div> <div> <p>To associate data with a participant you can create a <code>DataLink</code></p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Endpoints</h3> <ul class="list-none"> <li class="font-mono">POST <a href="#data-link-create">/v1/data-links</a></li> <li class="font-mono">GET <a href="#data-link-index">/v1/data-links</a></li> <li class="font-mono">DELETE <a href="#data-link-delete">/v1/data-links</a></li> </ul> </div> </aside> <!-- object --> <div> <h2 id="data-link-object" title="The data-link object">The data-link object</h2> <h3>Attributes</h3> <ul class="list-properties"> <li> <h4>id</h4> <span>string</span> <p>Unique identifier for the object</p> </li> <li> <h4>object</h4> <span>string</span> <p>Name of the object type. This will be "data_link"</p> </li> <li> <h4>title</h4> <span>string</span> <p>Name or title of the data</p> </li> <li> <h4>url</h4> <span>string</span> <p>An accessible url to the data</p> </li> <li> <h4>reminder_on</h4> <span>timestamp</span> <p>If set, when a reminder to delete the data will be sent</p> </li> <li> <h4>created_at</h4> <span>timestamp</span> <p>When the object was created</p> </li> <li> <h4>updated_at</h4> <span>timestamp</span> <p>When the object was last updated</p> </li> <li> <h4>recorded_at</h4> <span>timestamp</span> <p>When the data was collected or created</p> </li> </ul> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"link_58cfjco9KcR3EeNjvjjFnoaE"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"data_link"</span><span class="p">,</span><span class="w"> </span><span class="nl">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Recording 0"</span><span class="p">,</span><span class="w"> </span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://example.com/2/0"</span><span class="p">,</span><span class="w"> </span><span class="nl">"reminder_on"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-17"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"recorded_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16"</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /object --> <!-- create --> <div> <h2 id="data-link-create">Create a data link</h2> <p>Creates a data links.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>url</h4> <span>required</span> <p>The url where the data is. Should be accessible to people in your organisation</p> </li> <li> <h4>recorded_at</h4> <span>required, date</span> <p>The date the data was collected or created. This works with ISO 8601 format e.g. YYYY-MM-DD</p> </li> <li> <h4>participant_id</h4> <span>required</span> <p>The unique identifier for the participant the data is being linked to</p> </li> <li> <h4>title</h4> <span>optional</span> <p>The title or name of the data being linked</p> </li> <!-- <li> <h4>skip_reminder</h4> <span>optional, boolean</span> <p>Skip setting a reminder to delete the data</p> </li> --> </ul> <h3>Returns</h3> <p class="border-t pt-4"> Returns the data link object if the create succeeded. Returns an error if create parameters are invalid </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h4 class="bg-gray-200 px-4 py-2 font-mono">POST /v1/data-links</h4> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/data-links'</span> <span class="se">\</span> <span class="nt">-X</span> POST <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span> <span class="nt">-d</span> <span class="s1">'{ "url": "https://example.com/2/0", "recorded_at": "2021-04-04", "participant_id": "par_TBuhrZgWc41kUa3gL6zxhJUq", "title": "Interview with P1" }'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"list"</span><span class="p">,</span><span class="w"> </span><span class="nl">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"> </span><span class="nl">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"link_58cfjco9KcR3EeNjvjjFnoaE"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"data_link"</span><span class="p">,</span><span class="w"> </span><span class="nl">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Recording 0"</span><span class="p">,</span><span class="w"> </span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://example.com/2/0"</span><span class="p">,</span><span class="w"> </span><span class="nl">"reminder_on"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-17"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"recorded_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">}</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /create --> <!-- index --> <div> <h2 id="data-link-index">List all data links</h2> <p>Returns a list of all your organisations data links. Sorted by creation date.</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <h4>limit</h4> <span>optional</span> <p>A limit on the number of objects returned, the default is 20</p> </li> <li> <h4>page</h4> <span>optional</span> <p>Combined with a limit or the default to be able to paginate through all the objects, the default is 1</p> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> A list object with a data property that contains an array of up to <code>limit</code> data links, using the <code>page</code> as a starting point. Each entry in the array is a separate data link object. If no more data link are available, the resulting array will be empty. </p> <p>This request should never return an error.</p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">GET /v1/data-links</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/data-links'</span> <span class="se">\</span> <span class="nt">-X</span> GET <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"list"</span><span class="p">,</span><span class="w"> </span><span class="nl">"count"</span><span class="p">:</span><span class="w"> </span><span class="mi">99</span><span class="p">,</span><span class="w"> </span><span class="nl">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"link_58cfjco9KcR3EeNjvjjFnoaE"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"data_link"</span><span class="p">,</span><span class="w"> </span><span class="nl">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Recording 0"</span><span class="p">,</span><span class="w"> </span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://example.com/2/0"</span><span class="p">,</span><span class="w"> </span><span class="nl">"reminder_on"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-05-17"</span><span class="p">,</span><span class="w"> </span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"updated_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16T10:29:30+00:00"</span><span class="p">,</span><span class="w"> </span><span class="nl">"recorded_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-02-16"</span><span class="w"> </span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">},</span><span class="w"> </span><span class="p">{</span><span class="err">...</span><span class="p">}</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /index --> <!-- delete --> <div> <h2 id="data-link-delete">Delete a data-link</h2> <p>This deletes or unlinks data from a participant</p> <h3>Parameters</h3> <ul class="list-properties"> <li> <span>None</span> </li> </ul> <h3>Returns</h3> <p class="border-t pt-4"> Returns an object with a deleted parameter on success. If the data link id does not exist, this call returns an error. </p> </div> <aside> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2 font-mono">DELETE /v1/data-links/:id</h3> <!-- prettier-ignore --> <figure class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>curl <span class="s1">'https://api.consentkit.com/v1/data-links/link_58cfjco9KcR3EeNjvjjFnoaE'</span> <span class="se">\</span> <span class="nt">-X</span> DELETE <span class="se">\</span> <span class="nt">-H</span> <span class="s2">"Accept: application/json"</span> <span class="se">\</span> <span class="nt">-H</span> <span class="s1">'Authorization: Bearer TOKEN'</span> </code></pre></figure> </div> <div class="bg-gray-50 border border-gray-200 rounded-md mt-6"> <h3 class="bg-gray-200 px-4 py-2">Response</h3> <figure class="highlight"><pre><code class="language-json" data-lang="json"><span class="p">{</span><span class="w"> </span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"link_58cfjco9KcR3EeNjvjjFnoaE"</span><span class="p">,</span><span class="w"> </span><span class="nl">"object"</span><span class="p">:</span><span class="w"> </span><span class="s2">"data_link"</span><span class="p">,</span><span class="w"> </span><span class="nl">"deleted"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="w"> </span><span class="p">}</span></code></pre></figure> </div> </aside> <!-- /delete --> </div> </div> </main> </div> </div> </body> </html>