{
  "swagger": "2.0",
  "new": "true",
  "info": {
    "title": "fiskaly Management API",
    "description": "\nImprint: [fiskaly.com/impressum](https://fiskaly.com/impressum) | Privacy Policy: [fiskaly.com/datenschutz](https://fiskaly.com/datenschutz) \n\n# Introduction\n\nThe fiskaly Management API is a RESTful API that can be used for automatizing concerns within the [fiskaly dashboard](/).\n      ",
    "version": "v0.1.0-draft",
    "contact": {
      "name": "fiskaly GmbH",
      "url": "https://fiskaly.com",
      "email": "info@fiskaly.com"
    }
  },
  "basePath": "/api/v0",
  "consumes": ["application/json"],
  "produces": ["application/json"],
  "tags": [
    {
      "name": "Authentication",
      "description": "\nOur API uses [JWT](#section/Authentication/JWT) tokens to authenticate requests. \nAPI requests without authentication will fail.\nAll API requests have to be made over HTTP**S**, while requests made over plain HTTP will fail.\n\n<!-- ReDoc-Inject: <security-definitions> -->\n        "
    },
    {
      "name": "Organizations",
      "description": "Endpoints for managing Organizations."
    },
    {
      "name": "Users",
      "description": "Endpoints for managing User Accounts / Logins."
    },
    { "name": "API Keys", "description": "Endpoints for managing API Keys." }
  ],
  "securityDefinitions": {
    "JWT": {
      "description": "\nA JSON Web Token (JWT) used for access control and authorization.\n\nAPI keys have to be obtained via the [fiskaly dashboard](/).\n\n- Usage format: `Bearer <JWT>`\n- Example HTTP header: `Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`\n      ",
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "JWT"
    }
  },
  "paths": {
    "/auth": {
      "post": {
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "example": { "api_key": "...", "api_secret": "..." },
              "type": "object",
              "oneOf": [
                {
                  "properties": {
                    "api_key": { "type": "string" },
                    "api_secret": { "type": "string" }
                  },
                  "required": ["api_key", "api_secret"]
                },
                {
                  "properties": { "refresh_token": { "type": "string" } },
                  "required": ["refresh_token"]
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "schema": {
              "type": "object",
              "description": "Successful authentication",
              "properties": {
                "access_token": { "type": "string" },
                "access_token_expires_in": {
                  "type": "integer",
                  "example": 300
                },
                "access_token_expires_at": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "A timestamp / point in time measured in seconds since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time)",
                  "example": 1577833200
                },
                "refresh_token": { "type": "string" },
                "refresh_token_expires_in": {
                  "type": "integer",
                  "example": 300
                },
                "refresh_token_expires_at": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "A timestamp / point in time measured in seconds since the [Unix epoch](https://en.wikipedia.org/wiki/Unix_time)",
                  "example": 1577833200
                }
              }
            },
            "description": "Successful authentication"
          }
        },
        "operationId": "authenticate",
        "summary": "Retrieve a token",
        "description": "\nAccess to our API is only granted with a valid JWT / authorization token that must be obtained using this endpoint.\n\nNote: If you don't have an `api_key` yet, you can [request an API key](#tag/Authentication).\n      ",
        "tags": ["Authentication"]
      }
    },
    "/organizations": {
      "get": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "listOrganizations",
        "summary": "List Organizations",
        "description": "\nfoo\n      ",
        "tags": ["Organizations"]
      },
      "post": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "createOrganization",
        "summary": "Create an Organization",
        "description": "\nfoo\n      ",
        "tags": ["Organizations"]
      }
    },
    "/organizations/{organization_id}": {
      "get": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "retrieveOrganization",
        "summary": "Retrieve an Organization",
        "description": "\nfoo\n      ",
        "tags": ["Organizations"]
      },
      "put": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "updateOrganization",
        "summary": "Update an Organization",
        "description": "\nfoo\n      ",
        "tags": ["Organizations"]
      },
      "delete": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "deleteOrganization",
        "summary": "Delete an Organization",
        "description": "\nfoo\n      ",
        "tags": ["Organizations"]
      }
    },
    "/organizations/{organization_id}/users": {
      "get": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "listUsers",
        "summary": "List Users",
        "description": "\nfoo\n      ",
        "tags": ["Users"]
      }
    },
    "/organizations/{organization_id}/users/{email}": {
      "post": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "inviteUser",
        "summary": "Invite a User",
        "description": "\nfoo\n      ",
        "tags": ["Users"]
      }
    },
    "/organizations/{organization_id}/users/{user_id}": {
      "get": {
        "parameters": [
          { "name": "body", "in": "body", "schema": { "type": "object" } }
        ],
        "responses": {
          "200": {
            "schema": { "type": "object" },
            "description": "Default Response"
          }
        },
        "operationId": "getUser",
        "summary": "Retrieve a User",
        "description": "\nfoo\n      ",
        "tags": ["Users"]
      }
    },
    "/organizations/{organization_id}/api-keys": {
      "get": {
        "parameters": [
          {
            "type": "string",
            "description": "Specifies the property to sort by",
            "enum": ["name", "kind", "status"],
            "required": false,
            "name": "order_by",
            "in": "query"
          },
          {
            "type": "string",
            "description": "Determines the sorting order",
            "enum": ["asc", "desc"],
            "default": "asc",
            "required": false,
            "name": "order",
            "in": "query"
          },
          {
            "description": "Limits the number of returned results",
            "type": "integer",
            "maximum": 100,
            "default": 100,
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "description": "Skips the specified number of results from the result set",
            "type": "integer",
            "default": 0,
            "required": false,
            "name": "offset",
            "in": "query"
          },
          {
            "description": "Filter to include only a specific kind",
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["test", "live"],
              "uniqueItems": true
            },
            "required": false,
            "name": "kind",
            "in": "query"
          },
          {
            "description": "Filter to include only a specific status",
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["enabled", "disabled"],
              "uniqueItems": true
            },
            "required": false,
            "name": "status",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "schema": {
              "type": "object",
              "description": "Returns the API Key list",
              "properties": {
                "data": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "pattern": "^[a-z0-9-]{3,30}$",
                        "description": "Name of the API Key"
                      },
                      "kind": { "type": "string", "enum": ["test", "live"] },
                      "status": {
                        "type": "string",
                        "enum": ["enabled", "disabled"]
                      },
                      "metadata": {
                        "type": "object",
                        "description": "\nYou can use this parameter to attach custom key-value data to an object.\nMetadata is useful for storing additional, structured information on an object.\nNote: You can specify up to 20 keys, with key names up to 40 characters long and values up to 500 characters long.\n    ",
                        "example": {
                          "my_property_1": "1234",
                          "my_property_2": "https://my-internal-system/path/to/resource/1234"
                        },
                        "maxProperties": 20,
                        "propertyNames": { "type": "string", "maxLength": 40 },
                        "additionalProperties": { "type": "string" }
                      },
                      "_id": {
                        "type": "string",
                        "description": "ID of the API Key"
                      },
                      "_name": {
                        "type": "string",
                        "pattern": "^[a-z0-9-]{3,30}$",
                        "description": "Name of the API Key"
                      },
                      "_type": {
                        "type": "string",
                        "const": "API_KEY",
                        "example": "API_KEY"
                      }
                    },
                    "required": [
                      "name",
                      "kind",
                      "status",
                      "_id",
                      "_name",
                      "_type"
                    ]
                  }
                },
                "count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Number of available data items"
                },
                "_type": {
                  "type": "string",
                  "const": "API_KEY_LIST",
                  "example": "API_KEY_LIST"
                }
              }
            },
            "description": "Returns the API Key list"
          },
          "403": {
            "schema": {
              "type": "object",
              "description": "Forbidden. Resource access denied.",
              "properties": {
                "code": { "type": "string" },
                "message": { "type": "string" },
                "status_code": { "type": "number", "example": 403 },
                "error": { "type": "string", "example": "Forbidden" }
              }
            },
            "description": "Forbidden. Resource access denied."
          }
        },
        "operationId": "listApiKeys",
        "summary": "List API Keys",
        "description": "\nList API Keys\n      ",
        "tags": ["API Keys"]
      }
    },
    "/organizations/{organization_id}/api-keys/{key_name}": {
      "post": {
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "kind": { "type": "string", "enum": ["test", "live"] },
                "status": { "type": "string", "enum": ["enabled", "disabled"] },
                "metadata": {
                  "type": "object",
                  "description": "\nYou can use this parameter to attach custom key-value data to an object.\nMetadata is useful for storing additional, structured information on an object.\nNote: You can specify up to 20 keys, with key names up to 40 characters long and values up to 500 characters long.\n    ",
                  "example": {
                    "my_property_1": "1234",
                    "my_property_2": "https://my-internal-system/path/to/resource/1234"
                  },
                  "maxProperties": 20,
                  "propertyNames": { "type": "string", "maxLength": 40 },
                  "additionalProperties": { "type": "string" }
                }
              },
              "required": ["kind", "status"]
            }
          },
          {
            "type": "string",
            "pattern": "^[a-z0-9-]{3,30}$",
            "description": "Name of the API Key",
            "name": "key_name",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{3,30}$",
                  "description": "Name of the API Key"
                },
                "kind": { "type": "string", "enum": ["test", "live"] },
                "status": { "type": "string", "enum": ["enabled", "disabled"] },
                "metadata": {
                  "type": "object",
                  "description": "\nYou can use this parameter to attach custom key-value data to an object.\nMetadata is useful for storing additional, structured information on an object.\nNote: You can specify up to 20 keys, with key names up to 40 characters long and values up to 500 characters long.\n    ",
                  "example": {
                    "my_property_1": "1234",
                    "my_property_2": "https://my-internal-system/path/to/resource/1234"
                  },
                  "maxProperties": 20,
                  "propertyNames": { "type": "string", "maxLength": 40 },
                  "additionalProperties": { "type": "string" }
                },
                "_id": { "type": "string", "description": "ID of the API Key" },
                "_name": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{3,30}$",
                  "description": "Name of the API Key"
                },
                "_type": {
                  "type": "string",
                  "const": "API_KEY",
                  "example": "API_KEY"
                },
                "secret": { "type": "string" }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "schema": {
              "type": "object",
              "description": "Bad Request. An API Key with this name already exists.",
              "properties": {
                "code": { "type": "string" },
                "message": { "type": "string" },
                "status_code": { "type": "number", "example": 400 },
                "error": { "type": "string", "example": "Bad Request" }
              }
            },
            "description": "Bad Request. An API Key with this name already exists."
          },
          "403": {
            "schema": {
              "type": "object",
              "description": "Forbidden. Resource access denied.",
              "properties": {
                "code": { "type": "string" },
                "message": { "type": "string" },
                "status_code": { "type": "number", "example": 403 },
                "error": { "type": "string", "example": "Forbidden" }
              }
            },
            "description": "Forbidden. Resource access denied."
          }
        },
        "operationId": "createApiKey",
        "summary": "Create API Key",
        "description": "\nCreate an API Key\n      ",
        "tags": ["API Keys"]
      },
      "put": {
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "status": { "type": "string", "enum": ["enabled", "disabled"] }
              }
            }
          },
          {
            "type": "string",
            "pattern": "^[a-z0-9-]{3,30}$",
            "description": "Name of the API Key",
            "name": "key_name",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{3,30}$",
                  "description": "Name of the API Key"
                },
                "kind": { "type": "string", "enum": ["test", "live"] },
                "status": { "type": "string", "enum": ["enabled", "disabled"] },
                "metadata": {
                  "type": "object",
                  "description": "\nYou can use this parameter to attach custom key-value data to an object.\nMetadata is useful for storing additional, structured information on an object.\nNote: You can specify up to 20 keys, with key names up to 40 characters long and values up to 500 characters long.\n    ",
                  "example": {
                    "my_property_1": "1234",
                    "my_property_2": "https://my-internal-system/path/to/resource/1234"
                  },
                  "maxProperties": 20,
                  "propertyNames": { "type": "string", "maxLength": 40 },
                  "additionalProperties": { "type": "string" }
                },
                "_id": { "type": "string", "description": "ID of the API Key" },
                "_name": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{3,30}$",
                  "description": "Name of the API Key"
                },
                "_type": {
                  "type": "string",
                  "const": "API_KEY",
                  "example": "API_KEY"
                }
              },
              "required": ["name", "kind", "status", "_id", "_name", "_type"]
            },
            "description": "Default Response"
          },
          "403": {
            "schema": {
              "type": "object",
              "description": "Forbidden. Resource access denied.",
              "properties": {
                "code": { "type": "string" },
                "message": { "type": "string" },
                "status_code": { "type": "number", "example": 403 },
                "error": { "type": "string", "example": "Forbidden" }
              }
            },
            "description": "Forbidden. Resource access denied."
          }
        },
        "operationId": "updateApiKeyStatus",
        "summary": "Update API Key Status",
        "description": "\nUpdate an API Key Status\n      ",
        "tags": ["API Keys"]
      },
      "get": {
        "parameters": [
          {
            "type": "string",
            "pattern": "^[a-z0-9-]{3,30}$",
            "description": "Name of the API Key",
            "name": "key_name",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{3,30}$",
                  "description": "Name of the API Key"
                },
                "kind": { "type": "string", "enum": ["test", "live"] },
                "status": { "type": "string", "enum": ["enabled", "disabled"] },
                "metadata": {
                  "type": "object",
                  "description": "\nYou can use this parameter to attach custom key-value data to an object.\nMetadata is useful for storing additional, structured information on an object.\nNote: You can specify up to 20 keys, with key names up to 40 characters long and values up to 500 characters long.\n    ",
                  "example": {
                    "my_property_1": "1234",
                    "my_property_2": "https://my-internal-system/path/to/resource/1234"
                  },
                  "maxProperties": 20,
                  "propertyNames": { "type": "string", "maxLength": 40 },
                  "additionalProperties": { "type": "string" }
                },
                "_id": { "type": "string", "description": "ID of the API Key" },
                "_name": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{3,30}$",
                  "description": "Name of the API Key"
                },
                "_type": {
                  "type": "string",
                  "const": "API_KEY",
                  "example": "API_KEY"
                }
              },
              "required": ["name", "kind", "status", "_id", "_name", "_type"]
            },
            "description": "Default Response"
          },
          "403": {
            "schema": {
              "type": "object",
              "description": "Forbidden. Resource access denied.",
              "properties": {
                "code": { "type": "string" },
                "message": { "type": "string" },
                "status_code": { "type": "number", "example": 403 },
                "error": { "type": "string", "example": "Forbidden" }
              }
            },
            "description": "Forbidden. Resource access denied."
          }
        },
        "operationId": "retrieveApiKey",
        "summary": "Retrieve API Key",
        "description": "\nRetrieve an existing API Key\n      ",
        "tags": ["API Keys"]
      },
      "delete": {
        "parameters": [
          {
            "type": "string",
            "pattern": "^[a-z0-9-]{3,30}$",
            "description": "Name of the API Key",
            "name": "key_name",
            "in": "path",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "schema": {
              "type": "object",
              "properties": { "deleted": { "type": "boolean" } },
              "required": ["deleted"]
            },
            "description": "Default Response"
          },
          "403": {
            "schema": {
              "type": "object",
              "description": "Forbidden. Resource access denied.",
              "properties": {
                "code": { "type": "string" },
                "message": { "type": "string" },
                "status_code": { "type": "number", "example": 403 },
                "error": { "type": "string", "example": "Forbidden" }
              }
            },
            "description": "Forbidden. Resource access denied."
          }
        },
        "operationId": "deleteApiKey",
        "summary": "Delete API Key",
        "description": "\nDelete an existing API Key\n      ",
        "tags": ["API Keys"]
      }
    }
  }
}
