swagger: '2.0' info: version: 1.0.0 title: Divoc description: Digital infra for vaccination certificates securityDefinitions: hasRole: type: oauth2 flow: accessCode authorizationUrl: 'https://divoc.xiv.in/keycloak/auth/realms/divoc/protocol/openid-connect/auth' tokenUrl: 'https://divoc.xiv.in/keycloak/auth/realms/divoc/protocol/openid-connect/token' scopes: admin: scope of super admin facility-admin: scope of facility admin facility-staff: scope of facility staff security: - hasRole: ['facility-staff'] consumes: - application/json produces: - application/json paths: /authorize: post: tags: - login summary: Establish token consumes: - application/json produces: - application/json security: [] parameters: - in: body name: body required: true schema: $ref: '#/definitions/LoginRequest' responses: '200': description: OK schema: $ref: '#/definitions/LoginResponse' '401': description: Unauthorized /v1/divoc/configuration: get: tags: - configuration summary: Get Meta information about the application flow operationId: getConfiguration parameters: - name: lastKnownVersion in: query required: false type: string responses: '200': description: OK schema: $ref: '#/definitions/ApplicationConfiguration' /v1/users/me: get: tags: - vaccination summary: Get User information operationId: getLoggedInUserInfo responses: '200': description: OK schema: $ref: '#/definitions/UserInfo' '/v1/preEnrollments/{preEnrollmentCode}': get: tags: - vaccination summary: Get pre enrollment information description: Get pre enrollment data from api for vaccination operationId: getPreEnrollment parameters: - name: preEnrollmentCode in: path required: true type: string responses: '200': description: OK schema: $ref: '#/definitions/PreEnrollment' '/v1/preEnrollments': get: tags: - vaccination summary: Get all pre enrollments applicable to assigned facility operationId: getPreEnrollmentsForFacility responses: '200': description: OK schema: type: array items: $ref: '#/definitions/PreEnrollment' /v1/certify: post: tags: - certification summary: Certify the one or more vaccination description: >- Certification happens asynchronously, this requires vaccinator athorization and vaccinator should be trained for the vaccination that is being certified. operationId: certify parameters: - in: body name: body required: true schema: type: array items: $ref: '#/definitions/CertificationRequest' responses: '200': description: OK /v1/certificate/revoked: post: tags: - certificateRevoked summary: Check if given certificate is revoked operationId: certificateRevoked security: [] parameters: - in: body name: body required: true schema: type: object responses: '200': description: OK '404': description: certificate not found in revocation list '400': description: Invalid input /v1/certificates/{preEnrollmentCode}: delete: summary: Revoke certificates for given preEnrollmentCode and dose(s) tags: - certification operationId: revokeCertificate produces: - application/json parameters: - name: preEnrollmentCode in: path required: true type: string description: refId for which certificate needs to be revoked - name: doses in: query required: false type: array items: type: integer format: int32 description: dose(s) for which certificate needs to be revoked. Must include doses between (inclusive of) lowest dose to be revoked and latest dose. - name: allDoses in: query required: false type: boolean description: flag specifying if certificates for all doses for this refId should be revoked responses: '200': description: OK '404': description: Certificate not found for given beneficiary, dose '400': description: Invalid input /v1/bulkCertify: post: tags: - certification summary: Upload certification csv for bulk ingestion description: certify all the data in uploaded csv operationId: bulkCertify security: - hasRole: ['facility-admin'] consumes: - multipart/form-data parameters: - in: formData name: file type: file description: Certification data in the form of csv responses: '200': description: OK '400': description: Invalid input schema: $ref: '#/definitions/Error' '401': description: Unauthorized /v1/certify/uploads: get: tags: - certification summary: Get all file uploads for certification for given facility admin operationId: getCertifyUploads security: - hasRole: ['facility-admin'] responses: '200': description: OK schema: type: array items: type: object /v1/certify/uploads/{uploadId}/errors: get: tags: - certification summary: Get all the error rows associated with given uploadId operationId: getCertifyUploadErrors security: - hasRole: ['facility-admin'] parameters: - name: uploadId in: path required: true type: integer description: Id of uploaded csv file responses: '200': description: OK schema: type: object '404': description: certify upload for given uploadID not found '403': description: Forbidden for user /v1/programs/current: get: tags: - configuration summary: Get active vaccination programs operationId: getCurrentPrograms responses: '200': description: OK schema: type: array items: $ref: '#/definitions/Program' /v1/vaccinators: get: tags: - configuration summary: Get active vaccinators mapped for the facility operationId: getVaccinators responses: '200': description: OK schema: type: array items: $ref: "../registry/Vaccinator.json#/definitions/Vaccinator" /v1/identity/verify: post: tags: - identity summary: Validate identity if the person consumes: - application/json parameters: - name: body in: body schema: $ref: '#/definitions/IdentityVerificationRequest' responses: '200': description: OK '206': description: Need OTP /v1/certificates: get: summary: Get certificate json security: - hasRole: ["recipient"] operationId: getCertificate responses: '200': description: OK schema: type: object /v1/sideEffects: get: tags: - sideEffects summary: Get Side Effects Metadata security: [] operationId: getSideEffectsMetadata responses: '200': description: OK schema: type: object /v1/report-side-effects: post: tags: - reportSideEffects summary: Create reported side effects security: - hasRole: ["recipient"] operationId: createReportedSideEffects parameters: - in: body name: body schema: type: object properties: certificateId: type: string sideEffectsResponse: type: array items: $ref: '../registry/RecipientSideEffects.json#/definitions/SideEffectsResponse' responses: '200': description: OK '400': description: Invalid input '401': description: Unauthorized /v1/events: post: summary: Send events for monitoring / tracking purpose. operationId: events security: [] parameters: - in: body name: body schema: type: array items: type: object $ref: '#/definitions/Event' responses: '200': description: OK /v1/ping: get: summary: Server heartbeat operation description: >- This operation shows how to override the global security defined above, as we want to open it up for all users. security: [] responses: '200': description: OK /v1/certificate: put: tags: - certification summary: Update existing certificate request description: >- Update existing certificate if all checks are passed operationId: updateCertificate parameters: - in: body name: body required: true schema: type: array items: $ref: '#/definitions/CertificationRequestV2' responses: '200': description: OK '400': description: Invalid input schema: $ref: '#/definitions/Error' '412': description: Update not allowed schema: $ref: '#/definitions/Error' /v3/certificate: put: tags: - certification summary: Update existing certificate request description: >- Update existing certificate if all checks are passed operationId: updateCertificateV3 parameters: - in: body name: body required: true schema: type: array items: $ref: '#/definitions/CertificationRequestV2' responses: '200': description: OK '400': description: Invalid input schema: $ref: '#/definitions/Error' '412': description: Update not allowed schema: $ref: '#/definitions/Error' /v2/certify: post: tags: - certification summary: Certify the one or more vaccination description: >- Certification happens asynchronously, this requires vaccinator athorization and vaccinator should be trained for the vaccination that is being certified. operationId: certifyV2 parameters: - in: body name: body required: true schema: type: array items: $ref: '#/definitions/CertificationRequestV2' responses: '200': description: OK '400': description: Invalid input schema: $ref: './vaccination-api.yaml#/definitions/Error' /v3/certify: post: tags: - certification summary: Certify the one or more vaccination description: >- Certification happens asynchronously, this requires vaccinator authorization and vaccinator should be trained for the vaccination that is being certified. operationId: certifyV3 parameters: - in: body name: body required: true schema: type: array items: $ref: '#/definitions/CertificationRequestV2' responses: '200': description: OK '400': description: Invalid input schema: $ref: './vaccination-api.yaml#/definitions/Error' definitions: CertificationRequestV2: type: object properties: preEnrollmentCode: type: string recipient: type: object properties: name: type: string uhid: type: string dob: type: string format: date age: type: string gender: type: string nationality: type: string identity: type: string contact: type: array items: type: string address: type: object properties: addressLine1: type: string addressLine2: type: string district: type: string state: type: string pincode: type: integer vaccination: type: object properties: name: type: string batch: type: string manufacturer: type: string date: type: string format: date-time effectiveStart: type: string format: date effectiveUntil: type: string format: date dose: type: number description: Dose number for example 1 for first dose of 2 doses example: 1 totalDoses: type: number description: Total number of doses required for this vaccination. example: 2 vaccinator: type: object properties: id: type: string name: type: string facility: type: object properties: id: type: string name: type: string operatorId: type: string operatorName: type: string address: type: object properties: addressLine1: type: string addressLine2: type: string district: type: string state: type: string pincode: type: integer meta: type: object properties: previousCertificateId: type: string vaccinations: type: array items: type: object properties: name: type: string dose: type: integer manufacturer: type: string date: type: string batch: type: string vaccinationApp: type: object properties: name: type: string type: type: string enum: - P - M - D version: type: string device: type: string description: Type of device, D - Desktop, M - Mobile, T - Tablet enum: - D - M - T deviceOS: type: string description: Type of Operating system on the device, W for Windows, A for Android, L for Linux, M for Mac, I for ios enum: - W - A - L - M - I oSVersion: type: string appMode: type: string enum: - Online - Offline connectionType: type: string description: W - Wifi, M - mobile data, L - LAN/WAN enum: - W - M - L facilityType: type: string description: CG - central govt, SG - State govt, PR - Private Facility enum: - CG - SG - PR paymentType: type: string description: G for Govt, S for Self, V for Voucher, D for DBT, A for AyushmanBharat, I for Other Insurance enum: - G - S - V - D - A - I registrationCategory: type: string description: F for frontline officers, C for comorbidity category, R for regular others enum: - F - C - R sessionDurationInMinutes: type: integer description: Vaccination session duration in minutes waitForVaccinationInMinutes: type: integer description: Time between verification and vaccination (in minutes) verificationDurationInSeconds: type: integer description: ID verification duration (duration in seconds for ID verification) verificationAttempts: type: integer description: ID verification number of attempts (ex number of attempts done for Aadhaar) registrationDataMode: type: string description: Recipient data capture mode DE for Data Entry, SQ for Signed QR, RQ for Regular QR, PR for Pre Registration enum: - DE - SQ - RQ - PR uploadTimestamp: type: string format: 'date-time' LoginRequest: type: object properties: mobile: type: string format: '' token2fa: type: string LoginResponse: type: object properties: token: type: string refreshToken: type: string PreEnrollment: type: object properties: code: type: string enrollmentScopeId: type: string phone: type: string nationalId: type: string dob: type: string format: date gender: type: string enum: ["Male", "Female", "Other"] name: type: string email: type: string meta: type: object CertificationRequest: type: object properties: preEnrollmentCode: type: string recipient: type: object properties: name: type: string dob: type: string format: date age: type: string gender: type: string nationality: type: string identity: type: string contact: type: array items: type: string address: type: object properties: addressLine1: type: string addressLine2: type: string district: type: string state: type: string pincode: type: integer vaccination: type: object properties: name: type: string batch: type: string manufacturer: type: string date: type: string format: date-time effectiveStart: type: string format: date effectiveUntil: type: string format: date dose: type: number description: Dose number for example 1 for first dose of 2 doses example: 1 totalDoses: type: number description: Total number of doses required for this vaccination. example: 2 vaccinator: type: object properties: name: type: string facility: type: object properties: name: type: string address: type: object properties: addressLine1: type: string addressLine2: type: string district: type: string state: type: string pincode: type: integer meta: type: object Program: type: object properties: id: type: string name: type: string description: type: string logoURL: type: string medicines: type: array items: type: object title: "medicine" properties: name: type: string provider: type: string vaccinationMode: type: string enum: ["muscular injection", "oral", "nasal"] schedule: type: object properties: repeatTimes: type: integer repeatInterval: type: integer effectiveUntil: type: integer description: Number of months the vaccination is effective status: type: string enum: ["Active", "Inactive", "Blocked"] price: type: number IdentityVerificationRequest: type: object properties: id: type: string token: type: string ApplicationConfiguration: type: object properties: navigation: type: object validation: type: object styles: type: object UserInfo: type: object properties: firstName: type: string lastName: type: string mobile: type: string roles: type: array items: type: string Event: type: object properties: date: type: string format: 'date-time' type: type: string extra: type: object Error: type: object properties: code: type: string message: type: string required: - code - message host: divoc.xiv.in schemes: - https basePath: /divoc/api