btcpayserver/BTCPayServer/wwwroot/swagger/v1/swagger.template.json

101 lines
5.8 KiB
JSON

{
"openapi": "3.0.0",
"info": {
"title": "BTCPay Greenfield API",
"description": "A full API to use your BTCPay Server",
"contact": {
"name": "BTCPay Server",
"url": "https://btcpayserver.org"
},
"version": "v1"
},
"servers": [
],
"components": {
"schemas": {
"ValidationProblemDetails": {
"type": "array",
"description": "An array of validation errors of the request",
"items": {
"type": "object",
"description": "A specific validation error on a json property",
"properties": {
"path": {
"type": "string",
"nullable": false,
"description": "The json path of the property which failed validation"
},
"message": {
"type": "string",
"nullable": false,
"description": "User friendly error message about the validation"
}
}
}
},
"ProblemDetails": {
"type": "object",
"description": "Description of an error happening during processing of the request",
"properties": {
"code": {
"type": "string",
"nullable": false,
"description": "An error code describing the error"
},
"message": {
"type": "string",
"nullable": false,
"description": "User friendly error message about the error"
}
}
},
"UnixTimestamp": {
"type": "number",
"format": "Unix timestamp in seconds",
"example": 1592312018,
"description": "A unix timestamp in seconds"
},
"TimeSpan": {
"type": "number",
"format": "int32",
"example": 90
},
"TimeSpanSeconds": {
"allOf": [ {"$ref": "#/components/schemas/TimeSpan"}],
"format": "seconds",
"description": "A span of times in seconds"
},
"TimeSpanMinutes": {
"allOf": [ {"$ref": "#/components/schemas/TimeSpan"}],
"format": "minutes",
"description": "A span of times in minutes"
}
},
"securitySchemes": {
"API Key": {
"type": "apiKey",
"description": "BTCPay Server supports authenticating and authorizing users through an API Key that is generated by them. Send the API Key as a header value to Authorization with the format: `token {token}`. For a smoother experience, you can generate a url that redirects users to an API key creation screen.\n\n The following permissions are available to the context of the user creating the API Key:\n\n* `unrestricted`: Unrestricted access\n* `btcpay.user.candeleteuser`: Delete user\n* `btcpay.user.canviewprofile`: View your profile\n* `btcpay.user.canmodifyprofile`: Manage your profile\n* `btcpay.user.canmanagenotificationsforuser`: Manage your notifications\n* `btcpay.user.canviewnotificationsforuser`: View your notifications\n\nThe following permissions are available if the user is an administrator:\n\n* `btcpay.server.cancreateuser`: Create new users\n* `btcpay.server.canmodifyserversettings`: Manage your server\n* `btcpay.server.canuseinternallightningnode`: Use the internal lightning node\n* `btcpay.server.cancreatelightninginvoiceinternalnode`: Create invoices with internal lightning node\n\nThe following permissions applies to all stores of the user, you can limit to a specific store with the following format: `btcpay.store.cancreateinvoice:6HSHAEU4iYWtjxtyRs9KyPjM9GAQp8kw2T9VWbGG1FnZ`:\n\n* `btcpay.store.canmodifystoresettings`: Modify your stores\n* `btcpay.store.webhooks.canmodifywebhooks`: Modify stores webhooks\n* `btcpay.store.canviewstoresettings`: View your stores\n* `btcpay.store.cancreateinvoice`: Create an invoice\n* `btcpay.store.canviewinvoices`: View invoices\n* `btcpay.store.canmodifypaymentrequests`: Modify your payment requests\n* `btcpay.store.canviewpaymentrequests`: View your payment requests\n* `btcpay.store.canuselightningnode`: Use the lightning nodes associated with your stores\n* `btcpay.store.cancreatelightninginvoice`: Create invoices the lightning nodes associated with your stores\n\nNote that API Keys only limits permission of a user and can never expand it. If an API Key has the permission `btcpay.server.canmodifyserversettings` but that the user account creating this API Key is not administrator, the API Key will not be able to modify the server settings.\nSome permissions may include other permissions, see [this operation](#operation/permissionsMetadata).\n",
"name": "Authorization",
"in": "header",
"scheme": "token"
},
"Basic": {
"type": "http",
"description": "BTCPay Server supports authenticating and authorizing users through the Basic HTTP authentication scheme. Send the user and password encoded in base64 with the format `Basic {base64(username:password)}`. Using this authentication method implicitly provides you with the `unrestricted` permission",
"name": "Authorization",
"in": "header",
"scheme": "Basic"
}
}
},
"security": [
{
"API Key": [],
"Basic": []
}
],
"tags": []
}