btcpayserver/BTCPayServer/wwwroot/swagger/v1/swagger.template.api-keys.json
Umar Bolatov aab1eb0d36
Ensure Swagger docs are semantically and structurally correct (#3390)
* Remove "delete" method from "/api/v1/stores/{storeId}/invoices/{invoiceId}/payment-methods" docs

* Remove "requestBody" from "delete" method of "/api/v1/stores/{storeId}/webhooks/{webhookId}"

* Rename "API Key" to "API_Key"

* Remove "scheme" from API_Key security scheme

* Remove "name" and "in" properties from "Basic"security scheme
2022-02-02 20:12:48 +09:00

172 lines
6.1 KiB
JSON

{
"paths": {
"/api/v1/api-keys/{apikey}": {
"delete": {
"tags": [
"API Keys"
],
"summary": "Revoke an API Key",
"description": "Revoke the current API key so that it cannot be used anymore",
"parameters": [
{
"name": "apikey",
"in": "path",
"required": true,
"description": "The API Key to revoke",
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "The key has been deleted"
},
"404": {
"description": "The key is not found for this user"
}
},
"security": [
{
"API_Key": [ "unrestricted" ],
"Basic": []
}
]
}
},
"/api/v1/api-keys/current": {
"get": {
"tags": [
"API Keys"
],
"summary": "Get the current API Key information",
"description": "View information about the current API key",
"responses": {
"200": {
"description": "Information about the current api key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKeyData"
}
}
}
}
},
"security": [
{
"API_Key": []
}
]
},
"delete": {
"tags": [
"API Keys"
],
"summary": "Revoke the current API Key",
"description": "Revoke the current API key so that it cannot be used anymore",
"responses": {
"200": {
"description": "The key was revoked and is no longer usable",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKeyData"
}
}
}
}
},
"security": [
{
"API_Key": []
}
]
}
},
"/api/v1/api-keys": {
"post": {
"tags": [
"API Keys"
],
"summary": "Create a new API Key",
"description": "Create a new API Key",
"responses": {
"200": {
"description": "Information about the new api key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiKeyData"
}
}
}
}
},
"requestBody": {
"x-name": "request",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"label": {
"type": "string",
"description": "The label of the new API Key",
"nullable": true
},
"permissions": {
"type": "array",
"description": "The permissions granted to this API Key (See API Key Authentication)",
"nullable": true,
"items": {
"type": "string"
}
}
}
}
}
}
},
"security": [
{
"API_Key": [ "unrestricted" ],
"Basic": []
}
]
}
}
},
"components": {
"schemas": {
"ApiKeyData": {
"type": "object",
"additionalProperties": false,
"properties": {
"apiKey": {
"type": "string",
"description": "The API Key to use for API Key Authentication",
"nullable": false
},
"label": {
"type": "string",
"description": "The label given by the user to this API Key",
"nullable": false
},
"permissions": {
"type": "array",
"description": "The permissions associated to this API Key",
"nullable": false,
"items": {
"type": "string"
}
}
}
}
}
},
"tags": [
{
"name": "API Keys"
}
]
}