info: title: Admin API @ NHS Innovation Service version: 1.0.0 servers: - url: https://nhse-${ENV}-innovation-service-admin-functions.azurewebsites.net/api openapi: 3.0.3 paths: "/v1/users/{userId}/delete": patch: description: Delete an admin user. operationId: v1-admin-delete parameters: - name: userId in: path required: true schema: type: string format: uuid description: Id of the admin user. responses: "200": description: The admin account has been deleted. content: application/json: schema: type: object properties: id: type: string description: The user id. "400": description: Bad request. "401": description: The user is not authorized to delete an admin account. "500": description: An error occurred while deleting the admin account. /v1/health: get: summary: Get admin health description: Get admin application health status tags: - "[v1] health" parameters: [] responses: "200": description: Success content: application/json: schema: type: object properties: status: type: string enum: - OK - WARN "401": description: Unauthorized "403": description: Forbidden /v1/organisations: post: description: Create an organisation. operationId: v1-admin-organisation-create requestBody: description: The organisation to be created. required: true content: application/json: schema: type: object properties: name: type: string maxLength: 100 description: Name of the organisation. acronym: type: string maxLength: 10 description: Acronym of the organisation. units: type: array items: type: object properties: name: type: string description: Name of the organisation unit. acronym: type: string description: Acronym of the organisation unit. required: - name - acronym additionalProperties: false description: Organisation units to create. required: - name - acronym additionalProperties: false responses: "200": description: The organisation has been created. content: application/json: schema: type: object properties: id: type: string description: The organisation id. units: type: string description: Ids of the organisation units belonging to the organisation. "400": description: Bad request. "401": description: The user is not authorized to create an organisation. "500": description: An error occurred while creating the organisation. "/v1/organisations/{organisationId}": post: description: Get organisation info. operationId: v1-admin-organisation-info parameters: - name: organisationId in: path required: true schema: type: string format: uuid responses: "200": description: Success. "400": description: Bad request. "401": description: The user is not authorized to get this information. "500": description: An error occurred while getting this information. patch: description: Update an organisation. operationId: v1-admin-organisation-update parameters: - name: organisationId in: path description: The organisation id. required: true schema: type: string requestBody: description: New name and acronym for the organisation. required: true content: application/json: schema: type: object properties: userIds: type: string description: Name and acronym for the organisation. responses: "200": description: The organisation unit has been updated. content: application/json: schema: type: object properties: organisationId: type: string description: The organisation id. "400": description: Bad request. "401": description: The user is not authorized to update an organisation unit. "404": description: The organisation unit does not exist. "500": description: An error occurred while updating the organisation unit. "/v1/tou/{touId}": get: description: Get terms of use. operationId: v1-admin-terms-of-use parameters: - name: touId in: path required: true schema: type: string format: uuid description: The terms of use id. responses: "200": description: The terms of use content: application/json: schema: type: object properties: id: type: string format: uuid name: type: string touType: type: string enum: - INNOVATOR - SUPPORT_ORGANISATION summary: type: string releaseAt: type: string format: date-time nullable: true createdAt: type: string format: date-time "400": description: Bad request. "401": description: The user is not authorized to get terms of use. "404": description: The terms of use was not found. "500": description: An error occurred while listing the terms of use. put: description: Update terms of use. operationId: v1-admin-terms-of-use-update parameters: - name: touId in: path required: true schema: type: string format: uuid description: The terms of use id. requestBody: description: The terms of use to be updated. required: true content: application/json: schema: type: object properties: name: type: string description: Name of the terms of use. touType: type: string enum: - INNOVATOR - SUPPORT_ORGANISATION description: Type of the terms of use. summary: type: string description: Brief summary of the terms of use. releasedAt: type: string description: Relase date of the terms of use. required: - name - touType additionalProperties: false responses: "200": description: The terms of use have been updated. content: application/json: schema: type: object properties: unitId: type: string description: Id of the updated terms of use. "400": description: Bad request. "401": description: The user is not authorized to update terms of use. "500": description: An error occurred while updating the terms of use. /v1/tou: post: description: Create terms of use. operationId: v1-admin-terms-of-use-create requestBody: description: The terms of use to create. required: true content: application/json: schema: type: object properties: name: type: string description: Name of the terms of use. touType: type: string enum: - INNOVATOR - SUPPORT_ORGANISATION description: Type of the terms of use. summary: type: string description: Brief summary of the terms of use. releasedAt: type: string description: Relase date of the terms of use. required: - name - touType additionalProperties: false responses: "200": description: The terms of use have been created. content: application/json: schema: type: object properties: unitId: type: string description: Id of the created terms of use. "400": description: Bad request. "401": description: The user is not authorized to create terms of use. "500": description: An error occurred while creating the terms of use. get: description: List of terms of use. operationId: v1-admin-terms-of-use-list parameters: - name: skip in: query required: false schema: type: number format: float - name: take in: query required: false schema: type: number format: float maximum: 100 default: 20 - name: order in: query required: false schema: type: object properties: {} additionalProperties: type: string enum: - ASC - DESC default: default: DESC responses: "200": description: The list of terms of use versions. content: application/json: schema: type: object properties: count: type: number description: The total number of terms of use. data: type: array items: type: object properties: id: type: string format: uuid name: type: string touType: type: string enum: - INNOVATOR - SUPPORT_ORGANISATION summary: type: string releaseAt: type: string format: date-time nullable: true createdAt: type: string format: date-time "400": description: Bad request. "401": description: The user is not authorized to get terms of use. "500": description: An error occurred while listing the terms of use. "/v1/organisations/{organisationId}/units/{organisationUnitId}/activate": patch: description: Activate an organisation unit. operationId: v1-admin-unit-activate parameters: - name: organisationId in: path description: The organisation id. required: true schema: type: string - name: organisationUnitId in: path description: The organisation unit id. required: true schema: type: string requestBody: description: The id of the users to unlock. required: true content: application/json: schema: type: object properties: userIds: type: string description: Ids of the users to unlock. responses: "200": description: The organisation unit has been activated. content: application/json: schema: type: object properties: unitId: type: string description: The organisation unit id. "400": description: Bad request. "401": description: The user is not authorized to activate an organisation unit. "404": description: The organisation unit does not exist. "500": description: An error occurred while activating the organisation unit. "/v1/organisations/{organisationId}/units": post: description: Create an organisation unit. operationId: v1-admin-unit-create parameters: - name: organisationId in: path required: true schema: type: string format: uuid description: Id of the organisation to which the unit will belong to. requestBody: description: The organisation unit to be created. required: true content: application/json: schema: type: object properties: name: type: string maxLength: 100 description: Name of the organisation unit. acronym: type: string maxLength: 10 description: Acronym of the organisation unit. required: - name - acronym additionalProperties: false responses: "200": description: The organisation unit has been created. content: application/json: schema: type: object properties: unitId: type: string description: The organisation id. "400": description: Bad request. "401": description: The user is not authorized to create an organisation unit. "500": description: An error occurred while creating the organisation unit. "/v1/organisations/{organisationId}/units/{organisationUnitId}/inactivate": patch: description: Inactivate an organisation unit. operationId: v1-admin-unit-inactivate parameters: - name: organisationId in: path description: The organisation id. required: true schema: type: string - name: organisationUnitId in: path description: The organisation unit id. required: true schema: type: string responses: "200": description: The organisation unit has been inactivated. content: application/json: schema: type: object properties: unitId: type: string description: The organisation unit id. "400": description: Bad request. "401": description: The user is not authorized to inactivate an organisation unit. "404": description: The organisation unit does not exist. "500": description: An error occurred while inactivating the organisation unit. "/v1/organisations/{organisationId}/units/{organisationUnitId}": patch: description: Update an organisation unit. operationId: v1-admin-unit-update parameters: - name: organisationId in: path description: The organisation id. required: true schema: type: string - name: organisationUnitId in: path description: The organisation unit id. required: true schema: type: string requestBody: description: New name and acronym for the unit. required: true content: application/json: schema: type: object properties: userIds: type: string description: Name and acronym for the unit. responses: "200": description: The organisation unit has been updated. content: application/json: schema: type: object properties: unitId: type: string description: The organisation unit id. "400": description: Bad request. "401": description: The user is not authorized to update an organisation unit. "404": description: The organisation unit does not exist. "500": description: An error occurred while updating the organisation unit. /v1/users: post: description: Create a user. operationId: v1-admin-user-create parameters: [] requestBody: description: The user to be created. required: true content: application/json: schema: type: object properties: name: type: string description: Name of the user. email: type: string format: email description: Email of the user. type: type: string enum: - ADMIN - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR description: Type of the user. organisationAcronym: type: string maxLength: 10 nullable: true description: Acronym of the organisation. organisationUnitAcronym: type: string maxLength: 10 nullable: true description: Acronym of the organisation unit. role: type: string enum: - ACCESSOR - QUALIFYING_ACCESSOR nullable: true description: Role of the user within the organisation. required: - name - email - type additionalProperties: false responses: "200": description: The user has been created. content: application/json: schema: type: object properties: id: type: string description: The user id. "400": description: Bad request. "401": description: The user is not authorized to create a user. "500": description: An error occurred while creating the user. "/v1/users/{userId}": patch: description: Update a user. operationId: v1-admin-user-update parameters: - name: userId in: path required: true schema: type: string format: uuid description: Id of the user to lock. - name: id in: query required: false schema: type: string description: Id of the SLS. - name: code in: query required: false schema: type: string description: Code of the SLS. requestBody: required: true content: application/json: schema: type: object properties: accountEnabled: type: boolean nullable: true description: Enable or disable the user. role: type: object properties: name: type: string enum: - ACCESSOR - QUALIFYING_ACCESSOR description: Name of the role. organisationId: type: string format: uuid description: Id of the organisation. required: - name - organisationId additionalProperties: false nullable: true additionalProperties: false responses: "200": description: The user has been updated. content: application/json: schema: type: object properties: userId: type: string description: Id of the user. "400": description: Bad request. "401": description: The user is not authorized to lock a user. "404": description: The user does not exist. "500": description: An error occurred while locking a user. "/v1/users/{userId}/validate": post: description: Get validation information. operationId: v1-admin-validate parameters: - name: userId in: path required: true schema: type: string format: uuid description: Id of the user. - name: operation in: query required: true schema: type: string enum: - LOCK_USER - UPDATE_USER_ROLE - CHANGE_UNIT description: Type of the operation to validate. responses: "200": description: OK content: application/json: schema: type: object properties: validations: type: object description: Validation data. "400": description: Bad request. "401": description: The user is not authorized to access validation data. "500": description: An error occurred while fetching the validation data.