{
  "swagger": "2.0",
  "info": {
    "version": "",
    "title": "bambleweeny",
    "description": ""
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "oauth2": {
      "type": "oauth2",
      "flow": "password",
      "scopes": {},
      "tokenUrl": "/auth/token"
    }
  },
  "paths": {
    "/auth/token": {
      "post": {
        "operationId": "POST_auth-token",
        "summary": "Get Access Token",
        "tags": [
          "Authentication"
        ],
        "description": "This endpoint is used to retrieve an access token to perform authenticated requests against the 'resources' endpoints. Login with username (email) and password. For admin, the username is simply 'admin'.",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string"
                },
                "password": {
                  "type": "string"
                }
              },
              "example": {
                "username": "joe",
                "password": "secret"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "access_token": {
                  "type": "string"
                },
                "token_type": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "application/json": {
                "access_token": "token",
                "token_type": "bearer"
              }
            }
          },
          "403": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "application/json": {
                "message": "info"
              }
            }
          }
        }
      }
    },
    "/keys/": {
      "get": {
        "operationId": "READ-key",
        "summary": "List Keys",
        "tags": [
          "Keys"
        ],
        "description": "List all keys.",
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/keys/(id}": {
      "get": {
        "operationId": "READ-key",
        "summary": "Read Key",
        "tags": [
          "Keys"
        ],
        "description": "Read a key.",
        "produces": [
          "text/plain"
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      },
      "put": {
        "operationId": "WRITE-key",
        "summary": "Write Key",
        "tags": [
          "Keys"
        ],
        "description": "Set key to a specific value. Key names contain numbers, characters, underscores and colons. Valid key names are 'foo', 'my_key1', 'debug:b1:Hello' 'RogerRabbit'.",
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      },
      "delete": {
        "operationId": "DEL-key",
        "summary": "Delete Key",
        "tags": [
          "Keys"
        ],
        "description": "Deletes a key.",
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object"
            }
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/incr/(id}": {
      "get": {
        "operationId": "INCR-key",
        "summary": "Increase Key",
        "tags": [
          "Keys"
        ],
        "description": "Increments the number stored at key by one.",
        "produces": [
          "text/plain"
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/resources/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "get": {
        "operationId": "GET-resource",
        "summary": "Get Resource",
        "tags": [
          "Resources"
        ],
        "description": "Retrieve a resource identified by the UUID.",
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "string"
                },
                "owner": {
                  "type": "string"
                },
                "acl": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "application/json": {
                "content": "lorem ipsum",
                "owner": "1",
                "acl": ""
              }
            }
          },
          "401": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      },
      "delete": {
        "operationId": "DELETE-resource",
        "summary": "Delete Resource",
        "tags": [
          "Resources"
        ],
        "description": "Delete a resource identified by a UUID.",
        "responses": {
          "401": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/resources": {
      "get": {
        "operationId": "LIST-resources",
        "summary": "List Resources",
        "tags": [
          "Resources"
        ],
        "description": "List all resources of the user. Admin will see a list of resources for all users.",
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "resources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "owner": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "acl": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            },
            "examples": {
              "application/json": {
                "resources": [
                  {
                    "owner": "1",
                    "id": "d67a0e8c-87f0-4687-9fee-d9c4c2c94ebc",
                    "acl": "nil"
                  },
                  {
                    "owner": "1",
                    "id": "4dd8dbf3-e9fe-434a-b9cc-93f5113d32ed",
                    "acl": "nil"
                  },
                  {
                    "owner": "1",
                    "id": "318a9347-b97d-4c24-8a50-472a6374604a",
                    "acl": "nil"
                  },
                  {
                    "owner": "1",
                    "id": "8b7b42c2-c30b-46f8-a8f2-acfbbd71d155",
                    "acl": "nil"
                  },
                  {
                    "owner": "1",
                    "id": "db08a864-900d-4acd-b80f-ed7c9ac25664",
                    "acl": "nil"
                  }
                ]
              }
            }
          },
          "401": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      },
      "post": {
        "operationId": "POST-resource",
        "summary": "Create Resource",
        "tags": [
          "Resources"
        ],
        "description": "Create a resource from JSON data.",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "string"
                }
              },
              "example": {
                "content": "lorem ipsum"
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "schema": {
              "type": "object"
            }
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/users/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "type": "string"
        }
      ],
      "get": {
        "operationId": "GET-user",
        "summary": "Get User",
        "tags": [
          "User Management"
        ],
        "description": "Get a user record identified by a numceric user id.",
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "quota": {
                  "type": "string"
                }
              },
              "required": [
                "email",
                "quota"
              ]
            },
            "examples": {
              "application/json": {
                "email": "me@privacy.net",
                "quota": "19"
              }
            }
          },
          "401": {
            "description": "",
            "schema": {
              "type": "object"
            }
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      },
      "put": {
        "operationId": "PUT-user",
        "summary": "Set Quota",
        "tags": [
          "User Management"
        ],
        "description": "Set the quota for a user (number of resources a user can have).",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "quota": {
                  "type": "string"
                }
              },
              "required": [
                "quota"
              ],
              "example": {
                "quota": "19"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "application/json": {
                "message": "quota updated"
              }
            }
          },
          "401": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      },
      "delete": {
        "operationId": "DELETE-user",
        "summary": "Delete User",
        "tags": [
          "User Management"
        ],
        "description": "Delete a user record identified by a numceric user id.",
        "responses": {
          "200": {
            "description": ""
          },
          "401": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/users": {
      "get": {
        "operationId": "LIST-users",
        "summary": "List Users",
        "tags": [
          "User Management"
        ],
        "description": "List all users in the system.",
        "responses": {
          "200": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "users": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "quota": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            },
            "examples": {
              "application/json": {
                "output": [
                  {
                    "id": "1",
                    "email": "me@privacy.net",
                    "quota": "0"
                  },
                  {
                    "id": "2",
                    "email": "me2@privacy.net",
                    "quota": "0"
                  }
                ]
              }
            }
          },
          "401": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      },
      "post": {
        "operationId": "POST-user",
        "summary": "Create User",
        "tags": [
          "User Management"
        ],
        "description": "Create a user. The new user can then make authenticated requests with access tokens retrieved from the /auth/token endpoint.",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "password": {
                  "type": "string"
                }
              },
              "example": {
                "email": "me@privacy.net",
                "password": "changeme"
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "schema": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "application/json": {
                "id": "1"
              }
            }
          },
          "401": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/config/admin": {
      "put": {
        "operationId": "PUT_config-admin",
        "summary": "Change Admin Password",
        "tags": [
          "Configuration"
        ],
        "description": "Update the admin password - default password is 'changeme'.",
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "schema": {
              "type": "object",
              "properties": {
                "password": {
                  "type": "string"
                }
              },
              "example": {
                "password": "c5XU3l901Jp"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          },
          "400": {
            "description": ""
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    }
  },
  "definitions": {}
}