Skip to content

Instantly share code, notes, and snippets.

@aerosol
Last active September 28, 2023 08:45
Show Gist options
  • Save aerosol/197d3d37bccc6c3c55af1e4572efb32d to your computer and use it in GitHub Desktop.
Save aerosol/197d3d37bccc6c3c55af1e4572efb32d to your computer and use it in GitHub Desktop.
{
"components": {
"responses": {},
"schemas": {
"Error": {
"description": "An explanation of an error that occurred within the Plugins API\n",
"properties": {
"detail": {
"type": "string"
}
},
"required": [
"detail"
],
"title": "Error",
"type": "object"
},
"Link": {
"properties": {
"url": {
"type": "string"
}
},
"required": [
"url"
],
"title": "Link",
"type": "object"
},
"NotFoundError": {
"description": "The response that is returned when the user makes a request to a non-existing resource\n",
"properties": {
"errors": {
"items": {
"$ref": "#/components/schemas/Error"
},
"type": "array"
}
},
"required": [
"errors"
],
"title": "NotFoundError",
"type": "object"
},
"PaginationMetadata": {
"description": "Pagination meta data",
"properties": {
"has_next_page": {
"type": "boolean"
},
"has_prev_page": {
"type": "boolean"
},
"links": {
"items": {
"$ref": "#/components/schemas/Link"
},
"properties": {
"next": {
"$ref": "#/components/schemas/Link"
},
"prev": {
"$ref": "#/components/schemas/Link"
}
},
"type": "object"
}
},
"required": [
"has_next_page",
"has_prev_page"
],
"title": "PaginationMetadata",
"type": "object"
},
"SharedLink": {
"description": "Shared Link object",
"properties": {
"data": {
"properties": {
"href": {
"description": "Shared Link URL",
"type": "string"
},
"id": {
"description": "Shared Link ID",
"type": "integer"
},
"name": {
"description": "Shared Link Name",
"type": "string"
},
"password_protected": {
"description": "Shared Link Has Password",
"type": "boolean"
}
},
"required": [
"id",
"name",
"password_protected",
"href"
],
"type": "object"
}
},
"required": [
"data"
],
"title": "SharedLink",
"type": "object"
},
"SharedLink.CreateRequest": {
"description": "Shared Links creation params",
"example": {
"name": "My Shared Dashboard"
},
"properties": {
"name": {
"description": "Shared Link Name",
"type": "string"
},
"password": {
"description": "Shared Link Password",
"type": "string"
}
},
"required": [
"name"
],
"title": "SharedLink.CreateRequest",
"type": "object"
},
"SharedLink.ListResponse": {
"description": "Shared Links list response",
"properties": {
"data": {
"items": {
"$ref": "#/components/schemas/SharedLink"
},
"type": "array"
},
"meta": {
"items": {
"$ref": "#/components/schemas/PaginationMetadata"
},
"properties": {
"pagination": {
"$ref": "#/components/schemas/PaginationMetadata"
}
},
"required": [
"pagination"
],
"type": "object"
}
},
"required": [
"data",
"meta"
],
"title": "SharedLink.ListResponse",
"type": "object"
},
"UnauthorizedError": {
"description": "The response that is returned when the user makes an unauthorized request.\n",
"properties": {
"errors": {
"items": {
"$ref": "#/components/schemas/Error"
},
"type": "array"
}
},
"required": [
"errors"
],
"title": "UnauthorizedError",
"type": "object"
},
"UnprocessableEntityError": {
"description": "The response that is returned when the user makes a request that cannot be\nprocessed.\n",
"properties": {
"errors": {
"items": {
"$ref": "#/components/schemas/Error"
},
"type": "array"
}
},
"required": [
"errors"
],
"title": "UnprocessableEntityError",
"type": "object"
}
},
"securitySchemes": {
"basic_auth": {
"description": "HTTP basic access authentication using your Site domain as the\nusername and the Plugins API Token contents as the password.\n\nFor more information see\nhttps://en.wikipedia.org/wiki/Basic_access_authentication\n",
"scheme": "basic",
"type": "http"
}
}
},
"info": {
"title": "Plausible Plugins API",
"version": "1.0-rc"
},
"openapi": "3.0.0",
"paths": {
"/v1/shared_links": {
"get": {
"callbacks": {},
"operationId": "PlausibleWeb.Plugins.API.Controllers.SharedLinks.index",
"parameters": [
{
"description": "Maximum entries per page",
"example": 10,
"in": "query",
"name": "limit",
"required": false,
"schema": {
"type": "integer"
}
},
{
"description": "Cursor value to seek after - generated internally",
"in": "query",
"name": "after",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Cursor value to seek before - generated internally",
"in": "query",
"name": "before",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLink.ListResponse"
}
}
},
"description": "Shared Links response"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
},
"description": "Unauthorized"
}
},
"summary": "Retrieve Shared Links",
"tags": []
},
"post": {
"callbacks": {},
"operationId": "PlausibleWeb.Plugins.API.Controllers.SharedLinks.create",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLink.CreateRequest"
}
}
},
"description": "Shared Link params",
"required": false
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLink"
}
}
},
"description": "Shared Link"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
},
"description": "Unauthorized"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnprocessableEntityError"
}
}
},
"description": "Unprocessable entity"
}
},
"summary": "Create Shared Link",
"tags": []
}
},
"/v1/shared_links/{id}": {
"get": {
"callbacks": {},
"operationId": "PlausibleWeb.Plugins.API.Controllers.SharedLinks.get",
"parameters": [
{
"description": "Shared Link ID",
"example": 123,
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SharedLink"
}
}
},
"description": "Shared Link"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedError"
}
}
},
"description": "Unauthorized"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotFoundError"
}
}
},
"description": "NotFound"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnprocessableEntityError"
}
}
},
"description": "Unprocessable entity"
}
},
"summary": "Retrieve Shared Link by ID",
"tags": []
}
}
},
"security": [
{
"basic_auth": []
}
],
"servers": [
{
"description": "Local server",
"url": "http://localhost:8000/api/plugins",
"variables": {}
},
{
"description": "Staging server",
"url": "https://staging.plausible.io/api/plugins",
"variables": {}
},
{
"description": "Production server",
"url": "https://plausible.io/api/plugins",
"variables": {}
}
],
"tags": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment