openapi: 3.0.1 info: title: IO.Common Accounts Units API version: '1.0' security: - OAuth2: [] tags: - name: Units paths: /v1/Units: get: tags: - Units summary: Get all units operationId: GetUnits parameters: - name: Filter in: query schema: type: string - name: Page in: query schema: type: integer format: int32 - name: PageSize in: query schema: type: integer format: int32 - name: SortColumn in: query schema: type: string - name: SortOrder in: query schema: type: string - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/UnitResponsePagedResult' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common post: tags: - Units summary: Create new unit operationId: Create unit parameters: - name: Account in: query description: Account schema: title: Account type: int requestBody: description: '' content: application/json-patch+json; x-api-version=1.0: schema: $ref: '#/components/schemas/CreateUnitRequest' application/json; x-api-version=1.0: schema: $ref: '#/components/schemas/CreateUnitRequest' text/json; x-api-version=1.0: schema: $ref: '#/components/schemas/CreateUnitRequest' application/*+json; x-api-version=1.0: schema: $ref: '#/components/schemas/CreateUnitRequest' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/StringResourceCreatedResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Units/{unitId}: get: tags: - Units summary: Get unit operationId: GetUnit parameters: - name: unitId in: path description: UnitId required: true schema: type: string - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/UnitResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common put: tags: - Units summary: Update existing unit operationId: UpdateUnit parameters: - name: unitId in: path description: '' required: true schema: type: string - name: Account in: query description: Account schema: title: Account type: int requestBody: description: '' content: application/json-patch+json; x-api-version=1.0: schema: $ref: '#/components/schemas/UpdateUnitRequest' application/json; x-api-version=1.0: schema: $ref: '#/components/schemas/UpdateUnitRequest' text/json; x-api-version=1.0: schema: $ref: '#/components/schemas/UpdateUnitRequest' application/*+json; x-api-version=1.0: schema: $ref: '#/components/schemas/UpdateUnitRequest' responses: '200': description: Success '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common delete: tags: - Units summary: Delete unit operationId: DeleteUnit parameters: - name: unitId in: path description: '' required: true schema: type: string - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Units/SortedByUsage: get: tags: - Units summary: Get all units for search ordered by usage operationId: GetUnitsByUsage parameters: - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: type: array items: $ref: '#/components/schemas/UnitResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common /v1/Units/validate: get: tags: - Units summary: Validates whether a single unit ID exists parameters: - name: unitId in: query schema: type: string - name: Account in: query description: Account schema: title: Account type: int responses: '200': description: Success content: application/json: schema: type: boolean '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common post: tags: - Units summary: Validates multiple unit IDs. Returns only invalid IDs. parameters: - name: Account in: query description: Account schema: title: Account type: int requestBody: content: application/json-patch+json; x-api-version=1.0: schema: $ref: '#/components/schemas/ValidateUnitIdsRequest' application/json; x-api-version=1.0: schema: $ref: '#/components/schemas/ValidateUnitIdsRequest' text/json; x-api-version=1.0: schema: $ref: '#/components/schemas/ValidateUnitIdsRequest' application/*+json; x-api-version=1.0: schema: $ref: '#/components/schemas/ValidateUnitIdsRequest' responses: '200': description: Success content: application/json: schema: type: array items: type: string '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ApiErrorResponse' '401': description: Unauthorized '403': description: Forbidden security: - OAuth2: - io.common components: schemas: StringResourceCreatedResponse: type: object properties: id: type: string nullable: true additionalProperties: false ValidateUnitIdsRequest: type: object properties: unitIds: type: array items: type: string nullable: true additionalProperties: false Error: type: object properties: code: type: string nullable: true message: type: string nullable: true additionalProperties: false ApiErrorResponse: type: object properties: errors: type: array items: $ref: '#/components/schemas/Error' nullable: true additionalProperties: false UnitResponsePagedResult: type: object properties: pageSize: type: integer format: int32 readOnly: true page: type: integer format: int32 readOnly: true totalCount: type: integer format: int32 readOnly: true filteredCount: type: integer format: int32 readOnly: true data: type: array items: $ref: '#/components/schemas/UnitResponse' nullable: true readOnly: true additionalProperties: false CreateUnitRequest: type: object properties: unitId: type: string nullable: true text: type: string nullable: true additionalProperties: false UpdateUnitRequest: type: object properties: text: type: string nullable: true additionalProperties: false UnitResponse: type: object properties: unitId: type: string nullable: true text: type: string nullable: true additionalProperties: false securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://identity.scanbro.com/connect/authorize tokenUrl: https://identity.scanbro.com/connect/token scopes: io.common: default scope