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/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}: 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/search/reindex: post: description: Create Index and Ingest all the documents operationId: v1-admin-search-reindex tags: - "[v1] Elastic Search" responses: "204": description: Index reindexed "400": description: Bad Request "401": description: Unauthorized "403": description: Forbidden "404": description: Not Found "500": description: Internal Server Error /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: integer - name: take in: query required: false schema: type: integer 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 maxLength: 100 description: Name of the user. email: type: string format: email maxLength: 100 description: Email of the user. role: type: string enum: - ADMIN - ASSESSMENT - ACCESSOR - QUALIFYING_ACCESSOR description: Role of the user. required: - name - email - role additionalProperties: false oneOf: - type: object properties: organisationId: type: string format: uuid description: Id of the organisation. unitIds: type: array items: type: string format: uuid minItems: 1 description: Ids of the organisation units. required: - organisationId - unitIds additionalProperties: false responses: "201": 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}: delete: description: delete a user. operationId: v1-admin-user-delete parameters: - name: userId in: path required: true schema: type: string format: uuid responses: "204": description: The user has been deleted. "400": description: Bad request. "403": description: The user is not authorized to delete a user. "500": description: An error occurred while deleting the user. 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. requestBody: required: true content: application/json: schema: type: object properties: accountEnabled: type: boolean description: Activate or inactivate 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 email: type: string format: email description: Email of the user. 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/{userIdOrEmail}: get: operationId: v1-admin-user-info description: Get user info. tags: - "[v1] Admin Users" parameters: - name: userIdOrEmail in: path required: true schema: anyOf: - type: string format: uuid - type: string format: email responses: "200": description: Success content: application/json: schema: type: object properties: id: type: string format: uuid email: type: string name: type: string phone: type: string isActive: type: boolean roles: type: array items: type: object properties: id: type: string role: type: string enum: - ADMIN - INNOVATOR - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR displayTeam: type: string isActive: type: boolean "400": description: The request is invalid. "401": description: The user is not authenticated. "403": description: The user is not authorized to access this resource. "500": description: An error occurred while processing the request. /v1/users/{userId}/innovations: get: description: Retrieves the user owned innovations. operationId: v1-admin-user-innovations tags: - "[v1] Innovations owned by user" parameters: - name: userId in: path required: true schema: type: string format: uuid responses: "200": description: Success content: application/json: schema: type: array items: type: object properties: id: type: string name: type: string collaboratorsCount: type: number expirationTransferDate: type: string "400": description: Bad request /v1/users/{userId}/roles/{roleId}: patch: description: Update user role. operationId: v1-admin-user-role-update parameters: - name: userId in: path required: true schema: type: string format: uuid - name: roleId in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object properties: enabled: type: boolean additionalProperties: false responses: "204": description: Updated the user role content: application/json: schema: type: array items: type: object properties: id: type: string description: The role id. "400": description: The request is invalid. "401": description: The user is not authenticated. "403": description: The user is not authorized to access this resource. "500": description: An error occurred while processing the request. /v1/users/{userId}/roles: post: description: Create user roles. operationId: v1-admin-user-roles-create parameters: - name: userId in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object properties: role: type: string enum: - ADMIN - ASSESSMENT - ACCESSOR - QUALIFYING_ACCESSOR description: Role of the user. required: - role additionalProperties: false oneOf: - type: object properties: organisationId: type: string format: uuid description: Id of the organisation. unitIds: type: array items: type: string format: uuid minItems: 1 description: Ids of the organisation units. required: - organisationId - unitIds additionalProperties: false responses: "201": description: The created roles. content: application/json: schema: type: array items: type: object properties: id: type: string description: The role id. "400": description: The request is invalid. "401": description: The user is not authenticated. "403": description: The user is not authorized to access this resource. "500": description: An error occurred while processing the request. /v1/users/{userId}/validate: get: 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. 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. /v1/announcements: post: description: Create an announcement. operationId: v1-announcement-create requestBody: required: true content: application/json: schema: type: object properties: title: type: string maxLength: 100 description: Title of the announcement userRoles: type: array items: type: string enum: - INNOVATOR - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR description: User roles that will see the announcement. minItems: 1 params: type: object properties: inset: type: object properties: title: type: string content: type: string link: type: object properties: label: type: string url: type: string additionalProperties: false additionalProperties: false content: type: string actionLink: type: object properties: label: type: string url: type: string additionalProperties: false additionalProperties: false startsAt: type: string format: date-time expiresAt: type: string format: date-time required: - title - startsAt additionalProperties: false responses: "200": description: Announcement created. content: application/json: schema: type: object properties: id: type: string "400": description: Bad request "401": description: Not authorized "500": description: An error occurred get: description: Returns announcements list operationId: v1-announcements-list tags: - "[v1] Announcements" responses: "200": description: Success content: application/json: schema: type: array items: type: object properties: id: type: string format: uuid template: type: string enum: - "0" userRoles: type: array items: type: string enum: - ADMIN - INNOVATOR - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR params: type: object createdAt: type: string format: date-time expiresAt: type: string format: date-time /v1/announcements/{announcementId}: delete: description: Delete an announcement. operationId: v1-announcement-delete parameters: - name: announcementId in: path required: true schema: type: string format: uuid responses: "204": description: The announcement has been deleted. "400": description: Bad request. "401": description: The user is not authorized to delete an announcement. "500": description: An error occurred while deleting the announcement. get: description: Get an announcement info. operationId: v1-announcement-info parameters: - name: announcementId in: path required: true schema: type: string format: uuid responses: "200": description: Announcement created. content: application/json: schema: type: object properties: id: type: string format: uuid template: type: string enum: - "0" userRoles: type: array items: type: string enum: - ADMIN - INNOVATOR - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR params: type: object createdAt: type: string format: date-time expiresAt: type: string format: date-time "400": description: Bad request "401": description: Not authorized "500": description: An error occurred put: description: Update an announcement. operationId: v1-announcement-update parameters: - name: announcementId in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object properties: title: type: string maxLength: 100 userRoles: type: array items: {} params: type: object properties: inset: type: object properties: title: type: string content: type: string link: type: object properties: label: type: string url: type: string additionalProperties: false additionalProperties: false content: type: string actionLink: type: object properties: label: type: string url: type: string additionalProperties: false additionalProperties: false startsAt: type: string format: date-time expiresAt: type: string format: date-time additionalProperties: false responses: "200": description: Announcement updated. content: application/json: schema: type: object properties: id: type: string "400": description: Bad request "401": description: Not authorized "500": description: An error occurred /v1/demo/innovation/{innovationId}: post: description: Create an innovation IR demo data (depends on environment) operationId: v1-innovation-create-demo parameters: - name: innovationId in: path required: true schema: type: string format: uuid description: The innovation id. responses: "204": description: Success "400": description: Invalid innovation payload "422": description: Unprocessable entity /v1/ir-schema: post: description: Create IR schema operationId: v1-ir-schema-create responses: "204": description: IR schema created "400": description: Bad request "401": description: Not authorized "500": description: An error occurred /v1/organisation-unit/{unit}/statistics: get: description: Get an organisation unit statistics tags: - "[v1] Organisation Unit Statistics" operationId: v1-organisation-unit-statistics parameters: - name: unit in: path required: true schema: type: string format: uuid - name: statistics in: query required: true schema: type: array items: type: string enum: - INNOVATIONS_PER_UNIT responses: "200": description: Ok. "400": description: Bad request.