openapi: 3.2.0 info: title: Reference Images API version: 1.0.0 servers: - url: https://pre-api.joincandidhealth.com description: Production - url: https://pre-api-staging.joincandidhealth.com description: Staging - url: https://sandbox-pre-api.joincandidhealth.com description: CandidSandbox - url: https://staging-pre-api.joincandidhealth.com description: CandidStaging - url: http://localhost:4000 description: Local - url: https://api.joincandidhealth.com description: Production - url: https://api-staging.joincandidhealth.com description: Staging - url: https://sandbox-api.joincandidhealth.com description: CandidSandbox - url: https://staging-api.joincandidhealth.com description: CandidStaging - url: http://localhost:5050 description: Local tags: - name: Images paths: /images/v1: post: operationId: create summary: Create description: Adds an image. VersionConflictError is returned if a front or back of this coverage already exists. tags: - Images parameters: - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_Image' '409': description: Error response with status 409 content: application/json: schema: type: object properties: errorName: type: string enum: - VersionConflictError content: $ref: '#/components/schemas/type_pre-encounter_common_VersionConflictErrorBody' required: - errorName - content requestBody: content: application/json: schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_MutableImage' get: operationId: getMulti summary: Get Multi description: Searches for images that match the query parameters. tags: - Images parameters: - name: patient_id in: query required: false schema: type: string - name: coverage_id in: query required: false schema: type: string - name: file_type in: query required: false schema: type: string - name: patient_notes in: query required: false schema: type: string - name: sort_field in: query description: The field to order by. Defaults to updatedAt. required: false schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_ImageSortField' - name: sort_direction in: query description: The direction to order by. Defaults to desc. required: false schema: $ref: '#/components/schemas/type_pre-encounter_common_SortDirection' - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: type: array items: $ref: '#/components/schemas/type_pre-encounter_images_v1_Image' /images/v1/{id}: get: operationId: get summary: Get description: Gets an image by imageId. tags: - Images parameters: - name: id in: path required: true schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_ImageId' - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_Image' '404': description: Error response with status 404 content: application/json: schema: type: object properties: errorName: type: string enum: - NotFoundError content: $ref: '#/components/schemas/type_pre-encounter_common_ErrorBase4xx' required: - errorName - content /images/v1/{id}/{version}: put: operationId: update summary: Update description: Updates an Image. The path must contain the most recent version to prevent races. tags: - Images parameters: - name: id in: path required: true schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_ImageId' - name: version in: path required: true schema: type: string - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_Image' '404': description: Error response with status 404 content: application/json: schema: type: object properties: errorName: type: string enum: - NotFoundError content: $ref: '#/components/schemas/type_pre-encounter_common_ErrorBase4xx' required: - errorName - content '409': description: Error response with status 409 content: application/json: schema: type: object properties: errorName: type: string enum: - VersionConflictError content: $ref: '#/components/schemas/type_pre-encounter_common_VersionConflictErrorBody' required: - errorName - content requestBody: content: application/json: schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_MutableImage' delete: operationId: deactivate summary: Deactivate description: Sets an Image as deactivated. The path must contain the most recent version to prevent races. tags: - Images parameters: - name: id in: path required: true schema: $ref: '#/components/schemas/type_pre-encounter_images_v1_ImageId' - name: version in: path required: true schema: type: string - name: Authorization in: header description: OAuth authentication required: true schema: type: string responses: '200': description: Successful response '404': description: Error response with status 404 content: application/json: schema: type: object properties: errorName: type: string enum: - NotFoundError content: $ref: '#/components/schemas/type_pre-encounter_common_ErrorBase4xx' required: - errorName - content '409': description: Error response with status 409 content: application/json: schema: type: object properties: errorName: type: string enum: - VersionConflictError content: $ref: '#/components/schemas/type_pre-encounter_common_VersionConflictErrorBody' required: - errorName - content components: schemas: type_pre-encounter_images_v1_ImageStatus: type: string enum: - PENDING - UPLOADED - FAILED title: ImageStatus type_pre-encounter_common_CoverageId: type: string format: uuid description: The unique identifier for a Coverage in the database title: CoverageId type_pre-encounter_images_v1_Image: type: object properties: organization_id: $ref: '#/components/schemas/type_pre-encounter_common_OrganizationId' description: The organization that owns this object. deactivated: type: boolean description: True if the object is deactivated. Deactivated objects are not returned in search results but are returned in all other endpoints including scan. version: type: integer description: The version of the object. Any update to any property of an object object will create a new version. updated_at: type: string format: date-time updating_user_id: $ref: '#/components/schemas/type_pre-encounter_common_UserId' description: The user ID of the user who last updated the object. file_name: type: string display_name: type: string file_type: type: string status: $ref: '#/components/schemas/type_pre-encounter_images_v1_ImageStatus' coverage: $ref: '#/components/schemas/type_pre-encounter_images_v1_CoverageAssociation' patient: $ref: '#/components/schemas/type_pre-encounter_images_v1_PatientAssociation' id: $ref: '#/components/schemas/type_pre-encounter_images_v1_ImageId' signed_url: type: string description: A signed URL to the image. This url can be used to upload an image to GCP storage or to read the image contents. required: - organization_id - deactivated - version - updated_at - updating_user_id - file_name - display_name - file_type - status - id - signed_url description: An Image object with immutable server-owned properties. title: Image type_pre-encounter_images_v1_CoverageAssociation: type: object properties: id: $ref: '#/components/schemas/type_pre-encounter_common_CoverageId' side: $ref: '#/components/schemas/type_pre-encounter_images_v1_CoverageImageSide' required: - id - side description: An association to a Coverage. title: CoverageAssociation type_pre-encounter_common_ErrorBase4xx: type: object properties: message: type: string data: description: Any type required: - message title: ErrorBase4xx type_pre-encounter_common_SortDirection: type: string enum: - asc - desc title: SortDirection type_pre-encounter_images_v1_ImageId: type: string description: The unique identifier for an Image title: ImageId type_pre-encounter_common_VersionConflictErrorBody: type: object properties: message: type: string data: description: Any type latest_version: type: integer required: - message title: VersionConflictErrorBody type_pre-encounter_images_v1_CoverageImageSide: type: string enum: - FRONT - BACK title: CoverageImageSide type_pre-encounter_common_OrganizationId: type: string description: The unique identifier for an Organization in the database title: OrganizationId type_pre-encounter_common_UserId: type: string description: The unique identifier for a User in the database title: UserId type_pre-encounter_images_v1_MutableImage: type: object properties: file_name: type: string display_name: type: string file_type: type: string status: $ref: '#/components/schemas/type_pre-encounter_images_v1_ImageStatus' coverage: $ref: '#/components/schemas/type_pre-encounter_images_v1_CoverageAssociation' patient: $ref: '#/components/schemas/type_pre-encounter_images_v1_PatientAssociation' required: - file_name - display_name - file_type - status description: An object representing an Image. title: MutableImage type_pre-encounter_common_PatientId: type: string description: The unique identifier for a Patient title: PatientId type_pre-encounter_images_v1_PatientAssociation: type: object properties: id: $ref: '#/components/schemas/type_pre-encounter_common_PatientId' notes: type: string required: - id description: An association to a Patient. title: PatientAssociation type_pre-encounter_images_v1_ImageSortField: type: string enum: - updatedAt - fileName - displayName - fileType - status title: ImageSortField securitySchemes: OAuthScheme: type: http scheme: bearer description: OAuth 2.0 authentication