{
  "swagger": "2.0",
  "x-navigateMethodsByName": true,
  "info": {
    "description": "This is the specification for our Organization REST API.",
    "version": "0.1.0",
    "title": "Organization REST API",
    "termsOfService": "https://www.snapaddy.com/de/agb.html",
    "contact": {
      "email": "info@snapaddy.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "api.snapaddy.com",
  "basePath": "/organization/v1",
  "tags": [
    {
      "name": "current-user",
      "description": "Current User"
    },
    {
      "name": "orga-users",
      "description": "Organization Users"
    }
  ],
  "schemes": [
    "https"
  ],
  "paths": {
    "/me": {
      "get": {
        "tags": [
          "current-user"
        ],
        "summary": "Retrieve info about your own user account",
        "description": "Retrieve info about rights and permissions of your own user account.",
        "operationId": "getCurrentUserInfo",
        "parameters": [],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/User"
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/usernames": {
      "get": {
        "tags": [
          "orga-users"
        ],
        "summary": "Retrieve info about users in your own organization",
        "description": "Retrieve a list of objects with info about rights and permissions of users in your own organization.",
        "operationId": "getOrganizationUsersInfo",
        "parameters": [],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/ListOfUsers"
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    }
  },
  "securityDefinitions": {
    "api_key": {
      "type": "apiKey",
      "name": "x-api-token",
      "in": "header"
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "definitions": {
    "User": {
      "description": "An object with user details and permissions",
      "title": "User",
      "type": "object",
      "required": [
        "id",
        "name",
        "username",
        "is_deleted",
        "is_terminal_user",
        "permissions"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The id of the user"
        },
        "name": {
          "type": "string",
          "description": "The full name of the user"
        },
        "username": {
          "type": "string",
          "description": ""
        },
        "is_deleted": {
          "type": "boolean",
          "description": "Flags the user as deleted"
        },
        "is_terminal_user": {
          "type": "boolean",
          "description": "Flags the user as a terminal user"
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of permissions the user has"
        }
      }
    },
    "ListOfUsers": {
      "title": "ListOfUsers",
      "type": "array",
      "items": {
        "$ref": "#/definitions/User"
      }
    },
    "StringDictionary": {
      "title": "StringDictionary",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "example": {
        "de": "deutscher Text",
        "en": "English text"
      }
    },
    "ValidationDictionary": {
      "description": "A dictionary with question types as keys and corresponding rule dictionaries as values.",
      "title": "ValidationDictionary",
      "properties": {
        "questionType": {
          "$ref": "#/definitions/RulesDictionary"
        }
      }
    },
    "RulesDictionary": {
      "description": "A dictionary with rule names as key and corresponding rule objects as values.",
      "title": "RulesDictionary",
      "type": "object",
      "additionalProperties": {
        "type": "object"
      }
    },
    "BasicError": {
      "title": "BasicError",
      "properties": {
        "ERROR": {
          "type": "string",
          "description": "The corresponding error code"
        }
      }
    },
    "401Error": {
      "title": "HTTP 401 Error",
      "description": "The request was missing authentication headers or the sent headers were invalid.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/definitions/BasicError"
        }
      ]
    },
    "404Error": {
      "title": "HTTP 404 Error",
      "description": "The requested resource could not be found.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/definitions/BasicError"
        }
      ]
    },
    "500Error": {
      "title": "HTTP 500 Error",
      "description": "There was an internal server error. Please try again later.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/definitions/BasicError"
        }
      ]
    }
  }
}
