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/alert-manager/webhook: post: description: Receive Azure Monitor manager alert webhook notifications. operationId: v1-admin-alert-manager-webhook responses: "202": description: Accepted. "400": description: Invalid Azure Monitor alert payload. /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 - NOK required: - status additionalProperties: false "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. summary: type: string maxLength: 4000 description: Summary of the organisation website: type: string maxLength: 200 description: Website 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 format: uuid description: The organisation id. units: type: array items: type: string description: Ids of the organisation units belonging to the organisation. required: - id - units additionalProperties: false "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 required: true schema: type: string format: uuid requestBody: description: New name and acronym for the organisation. required: true content: application/json: schema: type: object properties: name: type: string maxLength: 100 acronym: type: string maxLength: 10 summary: type: string maxLength: 4000 website: type: string maxLength: 200 required: - name - acronym - summary - website additionalProperties: false responses: "200": description: The organisation unit has been updated. content: application/json: schema: type: object properties: organisationId: type: string format: uuid description: The organisation id. required: - organisationId additionalProperties: false "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/strategic-roles: get: description: List all users with strategic roles grouped by organisation. operationId: v1-admin-strategic-roles-list responses: "200": description: The list of strategic roles. content: application/json: schema: type: array items: type: object properties: organisation: type: object properties: id: type: string format: uuid name: type: string required: - id - name additionalProperties: false champions: type: array items: type: object properties: name: type: string email: type: string format: email required: - name - email additionalProperties: false seniorSponsors: type: array items: type: object properties: name: type: string email: type: string format: email required: - name - email additionalProperties: false required: - organisation - champions - seniorSponsors additionalProperties: false "401": description: The user is not authorized. "500": description: An error occurred. /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: id: type: string format: uuid required: - id additionalProperties: false "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: id: type: string format: uuid required: - id additionalProperties: false "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: integer 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 releasedAt: type: string format: date-time nullable: true createdAt: type: string format: date-time required: - id - name - touType - summary - releasedAt - createdAt additionalProperties: false required: - count additionalProperties: false "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 required: true schema: type: string format: uuid - name: organisationUnitId in: path required: true schema: type: string format: uuid requestBody: description: The id of the users to unlock. required: true content: application/json: schema: type: object properties: userIds: type: array items: type: string required: - userIds additionalProperties: false responses: "200": description: The organisation unit has been activated. content: application/json: schema: type: object properties: unitId: type: string format: uuid required: - unitId additionalProperties: false "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: id: type: string format: uuid required: - id additionalProperties: false "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 required: true schema: type: string format: uuid - name: organisationUnitId in: path required: true schema: type: string format: uuid responses: "200": description: The organisation unit has been inactivated. content: application/json: schema: type: object properties: unitId: type: string format: uuid required: - unitId additionalProperties: false "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 required: true schema: type: string format: uuid - name: organisationUnitId in: path required: true schema: type: string format: uuid requestBody: description: New name and acronym for the unit. required: true content: application/json: schema: type: object properties: name: type: string maxLength: 100 acronym: type: string maxLength: 10 required: - name - acronym additionalProperties: false responses: "200": description: The organisation unit has been updated. content: application/json: schema: type: object properties: unitId: type: string format: uuid required: - unitId additionalProperties: false "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/{userId}/assigned-innovations: get: description: Retrieves the user assigned innovations. operationId: v1-admin-user-assigned-innovations tags: - "[v1] Innovations" parameters: - name: userId in: path required: true schema: type: string format: uuid responses: "200": description: List of innovations assigned to the user content: application/json: schema: type: object properties: count: type: integer data: type: array items: type: object properties: innovation: type: object properties: id: type: string format: uuid name: type: string required: - id - name additionalProperties: false supportedBy: type: array items: type: object properties: id: type: string format: uuid name: type: string role: type: string enum: - ADMIN - INNOVATOR - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR required: - id - name additionalProperties: false additionalProperties: false required: - count - data additionalProperties: false "400": description: Bad Request "401": description: Unauthorized "403": description: Forbidden "404": description: Not found "500": description: Internal server error /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. strategicRoles: type: array items: type: string enum: - CHAMPION - SENIOR_SPONSOR description: Strategic roles to be assigned to 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 format: uuid required: - id additionalProperties: false "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: id: type: string format: uuid required: - id additionalProperties: false "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 x-required: true - type: string format: email x-required: true 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 jobTitle: type: string nullable: true roles: type: array items: type: object properties: id: type: string format: uuid role: type: string enum: - ADMIN - INNOVATOR - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR isActive: type: boolean organisation: type: object properties: id: type: string format: uuid name: type: string acronym: type: string nullable: true required: - id - name - acronym additionalProperties: false organisationUnit: type: object properties: id: type: string format: uuid name: type: string acronym: type: string required: - id - name - acronym additionalProperties: false displayTeam: type: string required: - id - isActive additionalProperties: false strategicRoles: type: array items: type: object properties: id: type: string format: uuid role: type: string enum: - CHAMPION - SENIOR_SPONSOR required: - id - role additionalProperties: false required: - id - email - name - isActive - strategicRoles additionalProperties: false "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 format: uuid name: type: string isOwner: type: boolean required: - id - name - isOwner additionalProperties: false "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 format: uuid required: - id additionalProperties: false "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 format: uuid description: The role id. required: - id additionalProperties: false "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}/strategic-roles/{strategicRoleId}: delete: description: Delete a strategic role from a user. operationId: v1-admin-user-strategic-role-update parameters: - name: userId in: path required: true schema: type: string description: The user id. - name: strategicRoleId in: path required: true schema: type: string description: The strategic role id. responses: "204": description: The strategic role has been deleted. "401": description: The user is not authorized. "404": description: The strategic role was not found. "500": description: An error occurred. /v1/users/{userId}/strategic-roles: post: description: Create strategic roles for a user. operationId: v1-admin-user-strategic-roles-create parameters: - name: userId in: path required: true schema: type: string description: The user id. requestBody: description: The strategic roles to be assigned. required: true content: application/json: schema: type: object properties: strategicRoles: type: array items: type: string enum: - CHAMPION - SENIOR_SPONSOR minItems: 1 description: The strategic roles to be assigned to the user. required: - strategicRoles additionalProperties: false responses: "201": description: The strategic roles have been created. content: application/json: schema: type: array items: type: object properties: id: type: string format: uuid required: - id additionalProperties: false "400": description: Bad request. "401": description: The user is not authorized. "500": description: An error occurred. /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: array items: type: object properties: rule: type: string enum: - AssessmentUserIsNotTheOnlyOne - LastQualifyingAccessorUserOnOrganisationUnit - NoInnovationsSupportedOnlyByThisUser - UserHasAnyAdminRole - UserHasAnyInnovatorRole - UserHasAnyAssessmentRole - UserHasAnyAccessorRole - UserHasAnyQualifyingAccessorRole - UserHasAnyAccessorRoleInOtherOrganisation - UserAlreadyHasRoleInUnit - OrganisationUnitIsActive - UserIsAccessorInAllUnitsOfOrg - UserCanHaveAssessmentOrAccessorRole valid: type: boolean details: {} required: - rule - valid additionalProperties: false additionalProperties: false "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: content: type: string link: type: object properties: label: type: string url: type: string additionalProperties: false required: - content additionalProperties: false startsAt: type: string format: date-time expiresAt: type: string format: date-time type: type: string enum: - LOG_IN - HOMEPAGE filters: type: array items: type: object properties: section: type: string question: type: string answers: type: array items: type: string minItems: 1 required: - section - question - answers additionalProperties: false sendEmail: type: boolean default: false required: - title - startsAt - type additionalProperties: false responses: "200": description: Announcement created. content: application/json: schema: type: object properties: id: type: string format: uuid required: - id additionalProperties: false "400": description: Bad Request "401": description: Unauthorized "403": description: Forbidden "404": description: Not Found "500": description: Internal Server Error get: description: Returns announcements list operationId: v1-announcements-list tags: - "[v1] Announcements" responses: "200": description: Success content: application/json: schema: type: object properties: count: type: integer data: type: array items: type: object properties: id: type: string format: uuid title: type: string startsAt: type: string format: date-time expiresAt: type: string format: date-time nullable: true status: type: string enum: - SCHEDULED - ACTIVE - DONE - DELETED type: type: string enum: - LOG_IN - HOMEPAGE required: - id - title - startsAt - expiresAt additionalProperties: false required: - count additionalProperties: false /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 info retrieved. content: application/json: schema: type: object properties: id: type: string format: uuid title: type: string userRoles: type: array items: type: string enum: - ADMIN - INNOVATOR - ACCESSOR - ASSESSMENT - QUALIFYING_ACCESSOR params: type: object properties: {} additionalProperties: false nullable: true startsAt: type: string format: date-time expiresAt: type: string format: date-time nullable: true status: type: string enum: - SCHEDULED - ACTIVE - DONE - DELETED filters: type: object properties: section: type: string question: type: string answers: type: array items: type: string required: - section - question additionalProperties: false nullable: true sendEmail: type: boolean type: type: string enum: - LOG_IN - HOMEPAGE required: - id - title - userRoles - params - startsAt - expiresAt - filters - sendEmail additionalProperties: false "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: content: type: string link: 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 type: type: string enum: - LOG_IN - HOMEPAGE filters: type: array items: type: object properties: section: type: string question: type: string answers: type: array items: type: string minItems: 1 required: - section - question - answers additionalProperties: false sendEmail: type: boolean 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/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/{userId}/mfa: get: description: Get user MFA configuration operationId: v1-mfa-info tags: - "[v1] Users" parameters: - name: userId in: path required: true schema: type: string format: uuid responses: "200": description: Success content: application/json: schema: type: object properties: type: type: string enum: - none - email - phone phoneNumber: type: string required: - type additionalProperties: false "400": description: Bad Request "401": description: Unauthorized "403": description: Forbidden "404": description: Not Found "500": description: Internal Server Error put: description: Upsert user MFA configuration operationId: v1-mfa-upsert tags: - "[v1] Users" parameters: - name: userId in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object properties: type: type: string enum: - none - email - phone phoneNumber: anyOf: - type: string maxLength: 20 x-required: true required: - type additionalProperties: false responses: "204": description: MFA information upserted "400": description: Bad Request "401": description: Unauthorized "403": description: Forbidden "404": description: Not Found "500": description: Internal Server Error /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.