openapi: 3.0.1 info: title: Admin Portal API description: API documentation for Admin Portal version: "1.0" contact: name: WSO2 Identity Server url: 'https://wso2.com/identity-and-access-management/' email: architecture@wso2.org license: name: Apache 2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' servers: - url: https://localhost:8081/api/v1 description: Generated server url security: - bearerAuth: [] paths: /organizations/tier/update: post: tags: - Tier summary: Create tier update request. description: This endpoint is used to create a tier update request. operationId: TierRequest requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateRequestBody" required: true responses: "201": description: tier update request created content: "application/json": schema: type: string "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /tiers: get: tags: - Tier operationId: getTiers summary: get the tiers that are supported by subscription service description: get the details of the tiers that are supported by subscription service responses: "200": description: OK content: "application/json": schema: type: array items: $ref: "#/components/schemas/TiersList" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /organizations/delete: post: tags: - Organization summary: Create organization deletion request. description: This endpoint is used to create a organization deletion request. operationId: OrganizationRequest requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateRequestBody" required: true responses: "201": description: organization deletion request created "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /organizations/.search: post: tags: - Organization operationId: getOrganizationDetailsByUsername summary: get the details of the organization details of the user description: get the details of the organization details of the user requestBody: content: application/json: schema: $ref: "#/components/schemas/OrganizationRequestBody" required: true responses: "200": description: OK content: "application/json": schema: type: array items: $ref: "#/components/schemas/GetOrganizationDetailsResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /organizations/tier/.search: post: tags: - Organization operationId: searchOrganizationTierDetails summary: search the details of the organization's subscription details requestBody: content: application/json: schema: $ref: "#/components/schemas/OrganizationRequestBody" required: true responses: "200": description: OK content: "application/json": schema: type: array items: $ref: "#/components/schemas/TierDetailsResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /organizations/tier: post: tags: - Organization operationId: getTierDetailsById summary: get the details of the organization's subscription details requestBody: content: application/json: schema: $ref: "#/components/schemas/OrganizationRequestBody" required: true responses: "200": description: OK content: "application/json": schema: type: array items: $ref: "#/components/schemas/TierDetailsResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' #change to user /users/delete: post: tags: - User summary: Create owner deletion request. description: This endpoint is used to create a owner deletion request. operationId: ownerRequest requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateRequestBody" required: true responses: "201": description: owner deletion request created "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /users/.search: post: tags: - User operationId: getOwnerDetails summary: Get the details of the owner description: Get the details of the owner requestBody: content: application/json: schema: $ref: "#/components/schemas/OrganizationRequestBody" required: true responses: "200": description: OK content: "application/json": schema: $ref: "#/components/schemas/OwnerDetailsResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /requests/{id}: delete: tags: - Request operationId: deleteRequest summary: delete the request made by the user description: delete the request made by the user parameters: - name: id in: path required: true schema: type: string responses: "204": description: Request deleted "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /requests/{id}/resolve: patch: tags: - Request operationId: approveRequest summary: resolves the request description: Resolves the request by either approving or rejecting. parameters: - name: id in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: "#/components/schemas/ApprovalRequest" required: true responses: "204": description: Request resolved "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" "401": $ref: '#/components/responses/Unauthorized' "403": $ref: '#/components/responses/Forbidden' "404": $ref: '#/components/responses/NotFound' "500": $ref: '#/components/responses/ServerError' /requests/.search: #post and add parms to body post: tags: - Request operationId: getRequestsMade summary: get all the requests made by all requesters description: get all the requests requestBody: content: application/json: schema: $ref: "#/components/schemas/RequesterRequestBody" required: true responses: "200": description: OK content: "application/json": schema: $ref: "#/components/schemas/GetRequestsMadeListResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /requests/tier/{id}: get: tags: - Request operationId: getTierDetailsRequestById summary: get the details of the tier update request description: get the details of the tier update request parameters: - name: id in: path required: true schema: type: string responses: "200": description: OK content: "application/json": schema: $ref: "#/components/schemas/TierUpdateRequestDetailsResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /requests/organization/{id}: get: tags: - Request operationId: getOrganizationDetailsRequestById summary: get the details of the organization deletion request description: get the details of the organization deletion request parameters: - name: id in: path required: true schema: type: string responses: "200": description: OK content: "application/json": schema: $ref: "#/components/schemas/ApproveOrganizationDeletionRequestResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /requests/owner/{id}: get: tags: - Request operationId: getOwnerDetailsRequestById summary: get the details of the owner deletion request description: get the details of the owner deletion request parameters: - name: id in: path required: true schema: type: string responses: "200": description: OK content: "application/json": schema: $ref: "#/components/schemas/ApproveUserDeletionRequestResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' /health: get: tags: - Health operationId: healthCheck responses: "200": description: OK content: "application/json": schema: type: object properties: service: type: string example: "Asgardeo Admin Portal Service" status: type: string example: "UP" timestamp: type: string format: date-time /salesforce: get: tags: - Salesforce operationId: getSalesforceData summary: get the salesforce data description: This will return a list of salesforce data which is related to the opportunity name parameters: - name: opportunityName in: query required: true schema: type: string responses: "200": description: OK content: "application/json": schema: type: array items: $ref: "#/components/schemas/SalesForceDataResponse" /salesforce/{id}: get: tags: - Salesforce operationId: getSalesforceDataById summary: get the salesforce data by id description: get the salesforce data by id parameters: - name: id in: path required: true schema: type: string responses: "200": description: OK content: "application/json": schema: $ref: "#/components/schemas/SalesForceDataDetailsResponse" "400": description: Invalid Input Request content: "application/json": schema: $ref: "#/components/schemas/AdminPortalException" '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' components: securitySchemes: bearerAuth: # arbitrary name for the security scheme type: http scheme: bearer schemas: RequestDTO: type: object properties: #remove request prefix id: type: string format: uuid example: 123e4567-e89b-12d3-a456-426614174000 requestUserId: type: string example: john@wso2.com #change name requestTag: type: string example: org1xde requestType: type: string example: organization_deletion requestStatus: type: string example: pending requestProperties: type: string example: {} createdTime: type: string format: date-time example: 2021-09-01T10:00:00Z updatedTime: type: string format: date-time example: 2021-09-01T10:00:00Z CreateRequestBody: type: object properties: #remove request prefix requesterUsername: type: string example: john@wso2.com #change name subjectIdentifier: type: string example: org1xde properties: type: string example: {} ApprovalRequest: type: object properties: requestStatus: type: string example: rejected remarks: type: string example: "this tennant is not active" SalesForceDataResponse: type: object properties: salesForceId: type: string example: 123ecss4567234 name: type: string example: "WSO2" salesRegion: type: string example: "APAC" status: type: string example: "Closed Won" ownerName: type: string example: "John Doe" accountName: type: string example: "WSO2" SalesForceDataDetailsResponse: type: object properties: salesForceId: type: string example: 123ecss4567234 name: type: string example: "WSO2" salesRegion: type: string example: "APAC" status: type: string example: "Closed Won" ownerName: type: string example: "John Doe" accountName: type: string example: "WSO2" arrValue: type: string example: "$100000" technicalOwner: type: string example: "John Doe" accountManager: type: string example: "Jane Doe" salesSubRegion: type: string example: "APAC" SubscriptionDetails: type: object properties: mauCount: type: string example: "1000" serviceProviderCount: type: string example: "100" idpCount: type: string example: "100" subOrgCount: type: string example: "100" supportLevel: type: string example: "Community" usecase: type: string example: "B2C" TierDetailsResponse: type: object properties: tierId: type: string example: "123e4567-e89b-12d3-a456-426614174000" tier: type: string example: "Free" ownerName: type: string example: john@wso2.com organizationName: type: string example: "WSO2" associationType: type: string example: "MEMBER" existingTierRequests: type: array items: type: string example: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-4266141740243"] subscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" TiersList: type: object properties: tierId: type: string example: "123e4567-e89b-12d3-a456-426614174000" tierName: type: string example: "Free" tierDescription: type: string example: "This is a free tier" subscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" GetOrganizationDetailsResponse: type: object properties: organizationId: type: string example: "123e4567-e89b-12d3-a456-426614174000" ownerName: type: string example: "John Doe" organizationName: type: string example: "WSO2" associationType: type: string example: "MEMBER" existingRequests: type: array items: type: string example: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174000"] GetResolvedRequestsResponse: type: object properties: rowCount: type: integer format: int32 example: 10 requests: type: array items: $ref: "#/components/schemas/ResolvedRequestResponse" ResolvedRequestResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" organizationName: type: string example: "WSO2" requestType: type: string example: "organization_deletion" requestedDate: type: string format: date-time requestedBy: type: string example: "John Doe" resolvedBy: type: string example: "Jane Doe" resolvedDate: type: string format: date-time status: type: string example: "approved" GetRequestsMadeListResponse: type: object properties: rowCount: type: integer format: int32 example: 10 requests: type: array items: $ref: "#/components/schemas/GetRequestsMadeResponse" GetRequestsMadeResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" requestTag: type: string example: "org1xde" requestedBy: type: string example: "allex@wso2.com" requestedDate: type: string format: date-time requestStatus: type: string example: "pending" requestType: type: string example: "organization_deletion" resolvedBy: type: string example: "jane@wso2.com" # remarks: # type: string # example: "this tennant is not active" ApproveTierUpdateResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" requestTag: type: string example: "org1xde" username: type: string example: john@wso2.com requestedBy: type: string example: alex@wso2.com requestedDate: type: string format: date-time requestStatus: type: string example: "pending" requestType: type: string example: "tier_update" resolvedBy: type: string example: "Jane Doe" remarks: type: string example: "this tennant is not active" organizationName: type: string example: "WSO2" companyName: type: string example: "WSO2" country: type: string example: "Sri Lanka" salesRegion: type: string example: "APAC" salesSubRegion: type: string example: "APAC" arrValue: type: string example: "$100000" technicalOwner: type: string example: "John Doe" accountManager: type: string example: "Jane Doe" currentTier: type: string example: "Free" tier: type: string example: "Free" opportunityName: type: string example: "WSO2" subscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" requestSubscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" TierUpdateRequestDetailsResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" requestTag: type: string example: "org1xde" username: type: string example: john@wso2.com requestedBy: type: string example: alex@wso2.com requestedDate: type: string format: date-time status: type: string example: "pending" type: type: string example: "tier_update" resolvedBy: type: string example: "Jane Doe" remarks: type: string example: "this tennant is not active" organizationName: type: string example: "WSO2" currentTier: type: string example: "Free" tier: type: string example: "Free" opportunityName: type: string example: "WSO2" subscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" requestSubscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" RequesterTierUpdateResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" requestTag: type: string example: "org1xde" username: type: string example: john@wso2.com requestedBy: type: string example: alex@wso2.com requestedDate: type: string format: date-time requestStatus: type: string example: "pending" requestType: type: string example: "tier_update" resolvedBy: type: string example: "Jane Doe" remarks: type: string example: "this tennant is not active" organizationName: type: string example: "WSO2" currentTier: type: string example: "Free" tier: type: string example: "Free" opportunityName: type: string example: "WSO2" subscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" requestSubscriptionDetails: $ref: "#/components/schemas/SubscriptionDetails" ApproveOrganizationDeletionRequestResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" requestTag: type: string example: "org1xde" username: type: string example: john@wso2.com requestedBy: type: string example: jane@wso2.com requestedDate: type: string format: date-time requestStatus: type: string example: "pending" requestType: type: string example: "organization_deletion" resolvedBy: type: string example: alex@wso2.com remarks: type: string example: "this tennant is not active" ownerName: type: string example: "John Doe" associationType: type: string example: "MEMBER" organizationForDeletion: $ref: "#/components/schemas/Organization" customerConsent: type: string PendingRequestListResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" organizationName: type: string example: "WSO2" requestType: type: string example: "organization_deletion" requestedDate: type: string format: date-time requestedBy: type: string example: alex@wso2.com ApproveUserDeletionRequestResponse: type: object properties: id: type: string example: "123e4567-e89b-12d3-a456-426614174000" requestTag: type: string example: "org1xde" username: type: string example: allex@wso2.com requestedBy: type: string example: john@wso2.com requestedDate: type: string format: date-time requestStatus: type: string example: "rejected" requestType: type: string example: "user_deletion" resolvedBy: type: string example: jane@wso2.com remarks: type: string example: "this tennant is not active" associatedOrganizations: type: array items: $ref: "#/components/schemas/Organization" proofOfConsent: type: string example: delete my organization Organization: type: object properties: organizationId: type: string example: "123e4567-e89b-12d3-a456-426614174000" ownerName: type: string example: john@wso2.com organizationName: type: string example: "WSO2" associationType: type: string example: "MEMBER" OwnerDetailsResponse: type: object properties: username: type: string example: rav@wso2.com getassociatedOrganizations: type: array items: $ref: "#/components/schemas/Organization" AdminPortalException: type: object properties: code: type: integer format: int32 example: AAP_0001 message: type: string example: "Some error message" description: type: string example: "Some error description" OrganizationRequestBody: type: object properties: identifier: type: string example: "john@wso2.com" description: "The identifier of the organization or the username of the owner" UserRequestBody: type: object properties: identifier: type: string example: "john@wso2.com" RequesterRequestBody: type: object properties: username: type: string example: requester_username@example.com searchQuery: type: string example: "organization_deletion" status: type: string example: "pending" page: type: integer format: int32 example: 0 limit: type: integer format: int32 example: 10 responses: Unauthorized: description: Unauthorized Forbidden: description: Resource Forbidden NotFound: description: Not Found ServerError: description: Internal Server Error content: 'application/json': schema: $ref: '#/components/schemas/AdminPortalException'