You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sites-api.md
+91Lines changed: 91 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,9 @@ The Plausible Site provisioning API offers a way to create and manage sites in y
16
16
* List existing goals
17
17
* Find or create a goal by type and value (learn more about [goals and custom events](goal-conversions.md))
18
18
* Delete an existing goal
19
+
* List existing custom properties
20
+
* Create a custom property
21
+
* Delete an existing custom property
19
22
* List site guests/invitations
20
23
* Create site guest invitations
21
24
* Delete site guests/invitations
@@ -418,6 +421,94 @@ Id of your site in Plausible.
418
421
419
422
<hr / >
420
423
424
+
### GET /api/v1/sites/custom-props
425
+
426
+
Gets a list of existing custom properties for a given `site_id` (use the site domain as the ID).
427
+
428
+
```bash title="Try it yourself"
429
+
curl -X GET https://plausible.io/api/v1/sites/custom-props?site_id=test-domain.com \
430
+
-H "Authorization: Bearer ${TOKEN}"
431
+
```
432
+
433
+
```json title="Response 200 OK"
434
+
{
435
+
"custom_properties": [
436
+
{
437
+
"property": "author"
438
+
},
439
+
{
440
+
"property": "title"
441
+
}
442
+
]
443
+
}
444
+
```
445
+
446
+
#### Query parameters
447
+
<hr / >
448
+
449
+
**site_id** <Required />
450
+
451
+
Id of your site in Plausible.
452
+
453
+
<hr / >
454
+
455
+
### PUT /api/v1/sites/custom-props
456
+
457
+
Creates a custom property for a given `site_id` (use the site domain as the ID). This endpoint is idempotent, it won't fail if a custom property with the provided name already exists.
458
+
459
+
```bash title="Try it yourself"
460
+
curl -X PUT https://plausible.io/api/v1/sites/custom-props \
461
+
-H "Authorization: Bearer ${TOKEN}" \
462
+
-F 'site_id="test-domain.com"' \
463
+
-F 'property="title"'
464
+
```
465
+
466
+
```json title="Response 200 OK"
467
+
{
468
+
"created": true
469
+
}
470
+
```
471
+
472
+
#### Body parameters
473
+
<hr / >
474
+
475
+
**site_id** <Required />
476
+
477
+
Id of your site in Plausible.
478
+
479
+
<hr / >
480
+
481
+
**property** <Required />
482
+
483
+
Name of the custom property
484
+
485
+
<hr / >
486
+
487
+
### DELETE /api/v1/sites/custom-props/:property
488
+
489
+
Deletes a custom property from your Plausible account. The API key must belong to the owner of the site. The site must owned by the current user.
0 commit comments