From 9f53fd760ca616a7f899489d33e7727e7ccaace3 Mon Sep 17 00:00:00 2001 From: Marko Saric <34340819+metmarkosaric@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:24:10 +0200 Subject: [PATCH 1/5] sites API key in settings --- docs/sites-api.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/sites-api.md b/docs/sites-api.md index b74fb99c..cdbefe8e 100644 --- a/docs/sites-api.md +++ b/docs/sites-api.md @@ -22,6 +22,16 @@ The Plausible Site provisioning API offers a way to create and manage sites in y Each request must be authenticated with an API key using the Bearer Token method. Please [contact us](https://plausible.io/contact) to discuss your needs and to get an API key with permissions for the endpoints listed in this document. +## Authentication + +To create a new sites API key, log in to your Plausible Analytics account. In the top-right menu, click on your account name and select "**Settings**". + +Next, go to the "**API Keys**" section in the left-hand sidebar. Click the "**New API Key**" button. Be sure to save the key as it will only be shown once. After saving the key, click on "**Create API Key**" to confirm its creation. + +The key will be valid for all sites that you own. + +After creating an API key, you can authenticate your request by sending the key in the Authorization header of your request. + ## Endpoints ### GET /api/v1/sites From 6f877dc9a528c93aa956dab8f979459a21b5b9f9 Mon Sep 17 00:00:00 2001 From: Marko Saric <34340819+metmarkosaric@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:28:06 +0200 Subject: [PATCH 2/5] Update stats-api.md --- docs/stats-api.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/stats-api.md b/docs/stats-api.md index df72e622..a54a3324 100644 --- a/docs/stats-api.md +++ b/docs/stats-api.md @@ -19,9 +19,11 @@ Take a look at our [Events API Reference](events-api.md) if you want to record p ## Authentication -You can create a new stats API key by going to your Plausible Analytics account, navigating to "**Account Settings**" and clicking on the section called "**API Keys**". The key will be valid for all sites that you own. +To create a new stats API key, log in to your Plausible Analytics account. In the top-right menu, click on your account name and go to settings. -Click "**New API Key**" and be sure you save the result as you will only see the key once. However, you can always delete the key and create a new one if you no longer remember what it is. +Next, go to the "**API Keys**" section in the left-hand sidebar. Click the "**New API Key**" button, choose "**Stats API**" and save the key as it will only be shown once. After saving the key, click on "**Create API Key**" to confirm its creation. + +The key will be valid for all sites that you have access to. After creating an API key, you can authenticate your request by sending the key in the Authorization header of your request. From 1c5137132cf1e5649022c9f2bebc171bab47038a Mon Sep 17 00:00:00 2001 From: Marko Saric <34340819+metmarkosaric@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:29:28 +0200 Subject: [PATCH 3/5] Update sites-api.md --- docs/sites-api.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/sites-api.md b/docs/sites-api.md index cdbefe8e..0c954bf8 100644 --- a/docs/sites-api.md +++ b/docs/sites-api.md @@ -26,9 +26,7 @@ Each request must be authenticated with an API key using the Bearer Token method To create a new sites API key, log in to your Plausible Analytics account. In the top-right menu, click on your account name and select "**Settings**". -Next, go to the "**API Keys**" section in the left-hand sidebar. Click the "**New API Key**" button. Be sure to save the key as it will only be shown once. After saving the key, click on "**Create API Key**" to confirm its creation. - -The key will be valid for all sites that you own. +Next, go to the "**API Keys**" section in the left-hand sidebar. Click the "**New API Key**" button, choose "**Sites API**" and save the key as it will only be shown once. After saving the key, click on "**Create API Key**" to confirm its creation. After creating an API key, you can authenticate your request by sending the key in the Authorization header of your request. From 016e53118484742a213aad70f68125e466942fdf Mon Sep 17 00:00:00 2001 From: Marko Saric <34340819+metmarkosaric@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:29:51 +0200 Subject: [PATCH 4/5] Update stats-api.md --- docs/stats-api.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/stats-api.md b/docs/stats-api.md index a54a3324..0643aea5 100644 --- a/docs/stats-api.md +++ b/docs/stats-api.md @@ -23,8 +23,6 @@ To create a new stats API key, log in to your Plausible Analytics account. In th Next, go to the "**API Keys**" section in the left-hand sidebar. Click the "**New API Key**" button, choose "**Stats API**" and save the key as it will only be shown once. After saving the key, click on "**Create API Key**" to confirm its creation. -The key will be valid for all sites that you have access to. - After creating an API key, you can authenticate your request by sending the key in the Authorization header of your request. ### Example curl request From 2b1e4b3603c9046fa663b2b8890422d374d7c4e3 Mon Sep 17 00:00:00 2001 From: Marko Saric <34340819+metmarkosaric@users.noreply.github.com> Date: Tue, 29 Apr 2025 14:35:13 +0200 Subject: [PATCH 5/5] Update sites-api.md --- docs/sites-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sites-api.md b/docs/sites-api.md index 0c954bf8..a26740ac 100644 --- a/docs/sites-api.md +++ b/docs/sites-api.md @@ -24,7 +24,7 @@ Each request must be authenticated with an API key using the Bearer Token method ## Authentication -To create a new sites API key, log in to your Plausible Analytics account. In the top-right menu, click on your account name and select "**Settings**". +To create a new sites API key, log in to your Plausible Analytics account. In the top-right menu, click on your account name and go to settings. Next, go to the "**API Keys**" section in the left-hand sidebar. Click the "**New API Key**" button, choose "**Sites API**" and save the key as it will only be shown once. After saving the key, click on "**Create API Key**" to confirm its creation.