swagger: "2.0" info: title: Casdoor API description: Documentation of Casdoor API version: 1.0.0 contact: email: admin@casbin.org basePath: /api paths: /api/add-application: post: tags: - api description: add an application operationId: ApiController.AddApplication parameters: - in: body name: body description: The details of the application required: true schema: $ref: '#/definitions/object.Application' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/add-organization: post: tags: - api description: add organization operationId: ApiController.AddOrganization parameters: - in: body name: body description: The details of the organization required: true schema: $ref: '#/definitions/object.Organization' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/add-provider: post: tags: - api description: add provider operationId: ApiController.AddProvider parameters: - in: body name: body description: The details of the provider required: true schema: $ref: '#/definitions/object.Provider' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/add-token: post: tags: - api description: add token operationId: ApiController.AddToken parameters: - in: body name: body description: Details of the token required: true schema: $ref: '#/definitions/object.Token' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/add-user: post: tags: - api description: add user operationId: ApiController.AddUser parameters: - in: body name: body description: The details of the user required: true schema: $ref: '#/definitions/object.User' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/delete-application: post: tags: - api description: delete an application operationId: ApiController.DeleteApplication parameters: - in: body name: body description: The details of the application required: true schema: $ref: '#/definitions/object.Application' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/delete-organization: post: tags: - api description: delete organization operationId: ApiController.DeleteOrganization parameters: - in: body name: body description: The details of the organization required: true schema: $ref: '#/definitions/object.Organization' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/delete-provider: post: tags: - api description: delete provider operationId: ApiController.DeleteProvider parameters: - in: body name: body description: The details of the provider required: true schema: $ref: '#/definitions/object.Provider' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/delete-token: post: tags: - api description: delete token operationId: ApiController.DeleteToken parameters: - in: body name: body description: Details of the token required: true schema: $ref: '#/definitions/object.Token' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/delete-user: post: tags: - api description: delete user operationId: ApiController.DeleteUser parameters: - in: body name: body description: The details of the user required: true schema: $ref: '#/definitions/object.User' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/get-account: get: tags: - api description: get the details of the current account operationId: ApiController.GetAccount responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/get-application: get: tags: - api description: get the detail of an application operationId: ApiController.GetApplication parameters: - in: query name: id description: The id of the application. required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Application' /api/get-applications: get: tags: - api description: get all applications operationId: ApiController.GetApplications parameters: - in: query name: owner description: The owner of applications. required: true type: string responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.Application' /api/get-default-application: get: tags: - api description: get the detail of the default application operationId: ApiController.GetDefaultApplication parameters: - in: query name: owner description: The owner of the application. required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Application' /api/get-email-and-phone: post: tags: - api description: get email and phone by username operationId: ApiController.GetEmailAndPhone parameters: - in: formData name: username description: The username of the user required: true type: string - in: formData name: organization description: The organization of the user required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/get-global-users: get: tags: - api description: get global users operationId: ApiController.GetGlobalUsers responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.User' /api/get-organization: get: tags: - api description: get organization operationId: ApiController.GetOrganization parameters: - in: query name: id description: organization id required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Organization' /api/get-organizations: get: tags: - api description: get organizations operationId: ApiController.GetOrganizations parameters: - in: query name: owner description: owner required: true type: string responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.Organization' /api/get-provider: get: tags: - api description: get provider operationId: ApiController.GetProvider parameters: - in: query name: id description: The id of the provider required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Provider' /api/get-providers: get: tags: - api description: get providers operationId: ApiController.GetProviders parameters: - in: query name: owner description: The owner of providers required: true type: string responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.Provider' /api/get-records: get: tags: - api description: get all records operationId: ApiController.GetRecords responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.Records' /api/get-records-filter: post: tags: - api description: get records by filter operationId: ApiController.GetRecordsByFilter parameters: - in: body name: body description: filter Record message required: true schema: $ref: '#/definitions/object.Records' responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.Records' /api/get-token: get: tags: - api description: get token operationId: ApiController.GetToken parameters: - in: query name: id description: The id of token required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.Token' /api/get-tokens: get: tags: - api description: get tokens operationId: ApiController.GetTokens parameters: - in: query name: owner description: The owner of tokens required: true type: string responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.Token' /api/get-user: get: tags: - api description: get user operationId: ApiController.GetUser parameters: - in: query name: id description: The id of the user required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.User' /api/get-users: get: tags: - api operationId: ApiController.GetUsers parameters: - in: query name: owner description: The owner of users required: true type: string responses: "200": description: The Response object schema: type: array items: $ref: '#/definitions/object.User' /api/login: post: tags: - api description: login operationId: ApiController.Login parameters: - in: query name: oAuthParams description: oAuth parameters required: true type: string - in: body name: body description: Login information required: true schema: $ref: '#/definitions/RequestForm' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.api_controller.Response' /api/login/oauth/access_token: post: tags: - api description: get oAuth token operationId: ApiController.GetOAuthToken parameters: - in: query name: grant_type description: oAuth grant type required: true type: string - in: query name: client_id description: oAuth client id required: true type: string - in: query name: client_secret description: oAuth client secret required: true type: string - in: query name: code description: oAuth code required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/object.TokenWrapper' /api/logout: post: tags: - api description: logout the current user operationId: ApiController.Logout responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/set-password: post: tags: - api description: set password operationId: ApiController.SetPassword parameters: - in: formData name: userOwner description: The owner of the user required: true type: string - in: formData name: userName description: The name of the user required: true type: string - in: formData name: oldPassword description: The old password of the user required: true type: string - in: formData name: newPassword description: The new password of the user required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/signup: post: tags: - api description: sign up a new user operationId: ApiController.Signup parameters: - in: formData name: username description: The username to sign up required: true type: string - in: formData name: password description: The password required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/update-application: get: tags: - api description: get application login operationId: ApiController.GetApplicationLogin parameters: - in: query name: clientId description: client id required: true type: string - in: query name: responseType description: response type required: true type: string - in: query name: redirectUri description: redirect uri required: true type: string - in: query name: scope description: scope required: true type: string - in: query name: state description: state required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.api_controller.Response' post: tags: - api description: update an application operationId: ApiController.UpdateApplication parameters: - in: query name: id description: The id of the application required: true type: string - in: body name: body description: The details of the application required: true schema: $ref: '#/definitions/object.Application' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/update-organization: post: tags: - api description: update organization operationId: ApiController.UpdateOrganization parameters: - in: query name: id description: The id of the organization required: true type: string - in: body name: body description: The details of the organization required: true schema: $ref: '#/definitions/object.Organization' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/update-provider: post: tags: - api description: update provider operationId: ApiController.UpdateProvider parameters: - in: query name: id description: The id of the provider required: true type: string - in: body name: body description: The details of the provider required: true schema: $ref: '#/definitions/object.Provider' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/update-token: post: tags: - api description: update token operationId: ApiController.UpdateToken parameters: - in: query name: id description: The id of token required: true type: string - in: body name: body description: Details of the token required: true schema: $ref: '#/definitions/object.Token' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/update-user: post: tags: - api description: update user operationId: ApiController.UpdateUser parameters: - in: query name: id description: The id of the user required: true type: string - in: body name: body description: The details of the user required: true schema: $ref: '#/definitions/object.User' responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' /api/upload-avatar: post: tags: - api description: upload avatar operationId: ApiController.UploadAvatar parameters: - in: formData name: avatarfile description: The base64 encode of avatarfile required: true type: string - in: formData name: password description: The password required: true type: string responses: "200": description: The Response object schema: $ref: '#/definitions/controllers.Response' definitions: 1671.0xc00044ab10.false: title: "false" type: object 1705.0xc00044ab40.false: title: "false" type: object RequestForm: title: RequestForm type: object controllers.Response: title: Response type: object properties: data: $ref: '#/definitions/1671.0xc00044ab10.false' data2: $ref: '#/definitions/1705.0xc00044ab40.false' msg: type: string status: type: string controllers.api_controller.Response: title: Response type: object properties: data: $ref: '#/definitions/1671.0xc00044ab10.false' data2: $ref: '#/definitions/1705.0xc00044ab40.false' msg: type: string status: type: string object.Application: title: Application type: object properties: affiliationUrl: type: string clientId: type: string clientSecret: type: string createdTime: type: string description: type: string displayName: type: string enablePassword: type: boolean enableSignUp: type: boolean expireInHours: type: integer format: int64 forgetUrl: type: string homepageUrl: type: string logo: type: string name: type: string organization: type: string organizationObj: $ref: '#/definitions/object.Organization' owner: type: string providers: type: array items: $ref: '#/definitions/object.ProviderItem' redirectUris: type: array items: type: string signinUrl: type: string signupItems: type: array items: $ref: '#/definitions/object.SignupItem' signupUrl: type: string object.Organization: title: Organization type: object properties: createdTime: type: string defaultAvatar: type: string displayName: type: string favicon: type: string name: type: string owner: type: string passwordSalt: type: string passwordType: type: string phonePrefix: type: string websiteUrl: type: string object.Provider: title: Provider type: object properties: appId: type: string category: type: string clientId: type: string clientSecret: type: string content: type: string createdTime: type: string displayName: type: string host: type: string name: type: string owner: type: string port: type: integer format: int64 providerUrl: type: string regionId: type: string signName: type: string templateCode: type: string title: type: string type: type: string object.ProviderItem: title: ProviderItem type: object properties: alertType: type: string canSignIn: type: boolean canSignUp: type: boolean canUnlink: type: boolean name: type: string prompted: type: boolean provider: $ref: '#/definitions/object.Provider' object.Records: title: Records type: object properties: Record: $ref: '#/definitions/util.Record' id: type: integer format: int64 object.SignupItem: title: SignupItem type: object properties: name: type: string prompted: type: boolean required: type: boolean rule: type: string visible: type: boolean object.Token: title: Token type: object properties: accessToken: type: string application: type: string code: type: string createdTime: type: string expiresIn: type: integer format: int64 name: type: string organization: type: string owner: type: string scope: type: string tokenType: type: string user: type: string object.TokenWrapper: title: TokenWrapper type: object properties: access_token: type: string expires_in: type: integer format: int64 scope: type: string token_type: type: string object.User: title: User type: object properties: address: type: array items: type: string affiliation: type: string avatar: type: string createdTime: type: string dingtalk: type: string displayName: type: string email: type: string facebook: type: string gitee: type: string github: type: string google: type: string hash: type: string id: type: string isAdmin: type: boolean isForbidden: type: boolean isGlobalAdmin: type: boolean language: type: string name: type: string owner: type: string password: type: string phone: type: string preHash: type: string properties: additionalProperties: type: string qq: type: string score: type: integer format: int64 signupApplication: type: string tag: type: string type: type: string updatedTime: type: string wechat: type: string weibo: type: string util.Record: title: Record type: object properties: ip: type: string organization: type: string requestTime: type: string requestUri: type: string urlpath: type: string username: type: string