{"openapi":"3.0.0","info":{"version":"1.0.0","title":"99cs API","license":{"name":"BSD"}},"servers":[{"url":"http://127.0.0.1:5000/api/v1","description":"development server"},{"url":"https://99cs.io/api/v1","description":"production server"}],"paths":{"/github/organizations":{"get":{"summary":"Get user github organizations.","operationId":"listGithubOrganizations","tags":["github"],"responses":{"200":{"description":"List of user organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubOrganizations"}}}},"401":{"description":"Service not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/github/organizations/{organizationName}":{"get":{"summary":"Get user repositories for an organization","operationId":"listGithubOrganizationsRepositories","tags":["github"],"parameters":[{"name":"organizationName","in":"path","required":true,"description":"Name of an Github organization","schema":{"type":"string"}}],"responses":{"200":{"description":"List of user organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubRepositories"}}}},"401":{"description":"Service not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/github/repositories/{RepositoryName}":{"get":{"summary":"Get repository information","operationId":"getGithubRepositoryInfo","tags":["github"],"parameters":[{"name":"RepositoryName","in":"path","required":true,"description":"Name of an Github repository","schema":{"type":"string"}}],"responses":{"200":{"description":"List of user organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubRepositoryInfo"}}}},"401":{"description":"Service not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/github/watchers":{"get":{"summary":"List watchers available for GitHub","operationId":"listGithubWatchers","tags":["github"],"responses":{"200":{"description":"List of GitHub watchers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubWatchers"}}}},"400":{"description":"Invalid Request format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Service not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create new GitHub watcher","operationId":"CreateGithubWatcher","tags":["github"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GithubWatcherRequest"}}}},"responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"Invalid Request format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Service not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/github/watchers/run":{"post":{"summary":"Run GitHub Watcher","operationId":"RunGithubWatcher","tags":["github"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["watcherId"],"properties":{"watcherId":{"type":"string","description":"Watcher identifier"}}}}}},"responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"Invalid Request format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Service not connected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/me":{"get":{"summary":"Get user information","operationId":"getUserInfo","tags":["auth"],"responses":{"200":{"description":"user information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"400":{"description":"Invalid Request format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/tokens":{"get":{"summary":"List user available tokens","operationId":"listAPITokens","tags":["auth"],"responses":{"200":{"description":"List of tokens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTokens"}}}},"400":{"description":"Invalid Request format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create new API token","operationId":"CreateAPIToken","tags":["auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"token name"}}}}}},"responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"Invalid Request format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/tokens/{token}":{"delete":{"summary":"Deletes API token","operationId":"deleteAPIToken","tags":["auth"],"parameters":[{"name":"token","in":"path","required":true,"description":"token tokenId","schema":{"type":"string"}}],"responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"Invalid Request format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"GithubOrganizations":{"type":"array","items":{"$ref":"#/components/schemas/GithubOrganization"}},"GithubOrganization":{"type":"object","required":["name","avatar"],"properties":{"name":{"type":"string","description":"organization name"},"avatar":{"type":"string","description":"URL for Organization avatar"}}},"GithubRepositories":{"type":"array","items":{"$ref":"#/components/schemas/GithubRepository"}},"GithubRepository":{"type":"object","required":["name","url","private"],"properties":{"name":{"type":"string","description":"repository name, including user / organization it belongs"},"url":{"type":"string","description":"complete URL for repository"},"private":{"type":"boolean","description":"true for private repositories. false otherwise"}}},"GithubRepositoryInfo":{"type":"object","required":["defaultBranch","userPlan","branches"],"properties":{"defaultBranch":{"type":"string","description":"repository name, including user / organization it belongs"},"userPlan":{"type":"string","description":"complete URL for repository","enum":["hobbies","developer","team","enterprise"]},"branches":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"git branch name"}}},"description":"list of branches available for this repository"}}},"UserInfo":{"type":"object","required":["email","nick","picture","roles","credit"],"properties":{"credit":{"type":"integer","description":"available credit for user"},"description":{"type":"string","description":"user description"},"email":{"type":"string","description":"user email. Unique in the system"},"nick":{"type":"string","description":"user nick. Unique in the system"},"picture":{"type":"string","description":"url of user profile picture"},"roles":{"type":"array","default":["developer"],"items":{"type":"string"},"example":{"roles":["developer"]}},"availableProviders":{"type":"array","items":{"type":"string"},"example":{"availableProviders":["github"]}}}},"AuthTokens":{"type":"array","items":{"$ref":"#/components/schemas/AuthToken"}},"AuthToken":{"type":"object","required":["id","name","token","created"],"properties":{"id":{"type":"string","description":"token ID"},"name":{"type":"string","description":"token name"},"token":{"type":"string","description":"API Token value"},"created":{"type":"string","description":"date in format YYYY/MM/DD"}}},"GithubWatchers":{"type":"array","items":{"$ref":"#/components/schemas/GithubWatcher"}},"GithubWatcherRequest":{"type":"object","required":["branch","id","sync"],"properties":{"id":{"type":"string","description":"ID of the watcher in UUID format"},"branch":{"type":"string","description":"branch name active"},"sync":{"type":"string","description":"method used to launch new analysis. Allowed valued depends of your user plan billed","enum":["manual","webhook","scheduled"]}}},"GithubWatcher":{"type":"object","required":["id","branch","sync","repository","lastAnalysis","status"],"properties":{"id":{"type":"string","description":"ID of the watcher in UUID format"},"branch":{"type":"string","description":"branch name active"},"sync":{"type":"string","description":"method used to launch new analysis","enum":["manual","webhook","scheduled"]},"repository":{"type":"string","description":"repository name in format - [USER | ORGANIZATION]/[REPOSITORY_NAME]"},"lastAnalysis":{"type":"object","description":"last analysis. This field could be null if still there's not any\nanalysis jet.\n","properties":{"time":{"type":"string","description":"time in format - \"hh:mm:ss\""},"data":{"type":"string","description":"date in format - \"yyyy/mm/dd\""}}},"status":{"type":"integer","description":"number of issues found in the las analysis. If still\nthere's no results it will return \"-1\". Otherwise it will return\nthe number of issues\n"}}},"Error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}