openapi: 3.0.1 info: title: Access API version: 1.0.0 components: securitySchemes: bearerAuthJWT: type: http scheme: bearer bearerFormat: JWT schemas: Response: type: object additionalProperties: false properties: data: nullable: true type: object status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string Access: type: object additionalProperties: false properties: token: type: string userId: type: string statusToken: type: string locationId: type: string createdAt: type: string enteredAt: type: string nullable: true exitAt: type: string nullable: true includesGuardian: type: boolean dependants: type: object additionalProperties: type: object additionalProperties: false properties: id: type: string enteredAt: type: string nullable: true exitAt: type: string nullable: true V1Access: type: object additionalProperties: false properties: token: type: string statusToken: type: string userId: type: string locationId: type: string enteredAt: type: string nullable: true exitAt: type: string nullable: true includesGuardian: type: boolean dependants: type: array items: type: object additionalProperties: false properties: id: type: string enteredAt: type: string nullable: true exitAt: type: string nullable: true Passport: type: object additionalProperties: false properties: id: type: string statusToken: type: string status: type: string enum: [pending,proceed,caution,stop] validFrom: type: string validUntil: type: string User: type: object additionalProperties: false properties: id: type: string email: type: string nullable: true firstName: type: string lastName: type: string base64Photo: type: string organizationIds: type: array nullable: true items: type: string delegateIds: type: array items: type: string EntryOrExitRequest: type: object additionalProperties: false properties: accessToken: type: string userId: type: string required: - accessToken - userId SelfEntryOrExitRequest: type: object additionalProperties: false properties: organizationId: type: string locationId: type: string accessToken: type: string required: - organizationId - locationId - accessToken EntryOrExitUsingTagRequest: type: object additionalProperties: false properties: tagId: type: string locationId: type: string legacyMode: type: boolean default: false required: - tagId - locationId StatusTokenExchangeRequest: type: object additionalProperties: false properties: statusToken: type: string locationId: type: string userId: type: string includeGuardian: type: boolean dependantIds: type: array items: type: string required: - statusToken - locationId - userId - includeGuardian V1UserEnterRequest: type: object additionalProperties: false properties: locationId: type: string organizationId: type: string userIds: type: array items: type: string required: - locationId - organizationId V1UserExitRequest: type: object additionalProperties: false properties: organizationId: type: string userIds: type: array items: type: string required: - organizationId - userIds V1ScanRequest: type: object additionalProperties: false properties: accessToken: type: string organizationId: type: string required: - accessToken - organizationId V1EnterRequest: type: object additionalProperties: false properties: userIds: type: array items: type: string organizationId: type: string locationId: type: string required: - userIds - organizationId - locationId V1ExitRequest: type: object additionalProperties: false properties: userIds: type: array items: type: string organizationId: type: string required: - userIds - organizationId Statistics: type: object additionalProperties: false properties: peopleOnPremises: type: number accessDenied: type: number asOfDateTime: type: string description: ISO date (eg. "2020-08-27T13:45:00.141Z") exposures: type: number description: Number of exposures pendingPassports: type: number description: Number of pending passports proceedPassports: type: number description: Number of proceed passports cautionPassports: type: number description: Number of caution passports stopPassports: type: number description: Number of stop passports checkInsPerHour: type: array items: type: object additionalProperties: false properties: date: type: string description: ISO date (eg. "2020-08-27T13:45:00.141Z") count: type: number description: Number of check-ins at the given time ResponseOfAccess: type: object additionalProperties: false properties: data: $ref: '#/components/schemas/Access' status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string V1ResponseOfAccess: type: object additionalProperties: false properties: data: type: array items: $ref: '#/components/schemas/V1Access' status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string V1ResponseOfEnter: type: object additionalProperties: false properties: data: type: object additionalProperties: false properties: access: $ref: '#/components/schemas/V1Access' passport: $ref: '#/components/schemas/Passport' user: $ref: '#/components/schemas/User' status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string V1ResponseOfExit: type: object additionalProperties: false properties: data: type: object additionalProperties: false properties: access: $ref: '#/components/schemas/V1Access' user: $ref: '#/components/schemas/User' status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string V1ResponseOfTag: type: object additionalProperties: false properties: data: type: object additionalProperties: false properties: access: $ref: '#/components/schemas/V1Access' passport: $ref: '#/components/schemas/Passport' user: $ref: '#/components/schemas/User' status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string ResponseOfStatistics: type: object additionalProperties: false properties: data: $ref: '#/components/schemas/Statistics' status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string ResponseOfEnterOrExit: type: object additionalProperties: false properties: data: type: object additionalProperties: false properties: passport: $ref: '#/components/schemas/Passport' base64Photo: type: string includesGuardian: type: boolean firstName: type: string lastName: type: string dependants: type: array items: type: object additionalProperties: false properties: id: type: string firstName: type: string lastName: type: string access: $ref: '#/components/schemas/Access' status: type: object additionalProperties: false properties: code: type: string enum: [ succeed, failed, validation_error, internal_server_error, unauthorized, access_denied, resource_not_found, ] message: nullable: true type: string responses: Response: description: Default Response wrapper content: application/json: schema: $ref: '#/components/schemas/Response' paths: /user/createToken: post: description: Exchange status-token for an access-token requestBody: content: application/json: schema: $ref: '#/components/schemas/StatusTokenExchangeRequest' responses: '200': description: Successfully exchanged content: application/json: schema: $ref: '#/components/schemas/ResponseOfAccess' /access/api/v1/access/enter: post: description: Enter the specified location security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/V1UserEnterRequest' responses: '200': description: Successfully entered content: application/json: schema: $ref: '#/components/schemas/V1ResponseOfAccess' /access/api/v1/access/exit: post: description: Exit the given users from wherever they are security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/V1UserExitRequest' responses: '200': description: Successfully exited content: application/json: schema: $ref: '#/components/schemas/V1ResponseOfAccess' /access/api/v1/admin/access/enter: post: description: Manually check a group of users into a location. The users will automatically exit their current locations. security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/V1EnterRequest' responses: '200': description: Successfully exited content: application/json: schema: $ref: '#/components/schemas/V1ResponseOfEnter' /access/api/v1/admin/access/exit: post: description: Manually check a group of users out of their current locations. security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/V1ExitRequest' responses: '200': description: Successfully exited content: application/json: schema: $ref: '#/components/schemas/V1ResponseOfExit' /access/api/v1/admin/access/enter-or-exit/tag: post: description: Enter or exit using a tag security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/EntryOrExitUsingTagRequest' responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/V1ResponseOfTag' /access/api/v1/admin/access/stats: get: description: Daily and live stats for a location security: - bearerAuthJWT: [] parameters: - in: query name: locationId schema: type: string required: false - in: query name: organizationId schema: type: string required: true responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfStatistics' /admin/{organizationId}/locations/accessible: get: description: Get locations for quick checkins parameters: - in: path name: organizationId schema: type: string required: true - in: query name: userId schema: type: string required: true responses: '200': description: Successfully returned content: application/json: schema: type: array items: $ref: '#/components/schemas/Response' /admin/enter: post: description: Handle user's entrance with access-token security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/EntryOrExitRequest' responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfEnterOrExit' /admin/exit: post: description: Handle user's exit with access-token security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/EntryOrExitRequest' responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfEnterOrExit' /admin/enterorexit/tag: post: description: Handle a user's entry or exit using a tag security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/EntryOrExitUsingTagRequest' responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfEnterOrExit' /admin/stats: post: description: Daily and live stats for a location security: - bearerAuthJWT: [] requestBody: content: application/json: schema: type: object additionalProperties: false properties: locationId: type: string required: - locationId responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfStatistics' /admin/stats/v2: post: description: Daily and live location stats security: - bearerAuthJWT: [] requestBody: content: application/json: schema: type: object additionalProperties: false properties: organizationId: type: string locationId: type: string responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfStatistics' /triggerReports: get: description: Triggers reports to be sent for the current hour. Likely to become inaccessible except via cron. This is a GET request with side effects, be cautious! responses: '200': description: Success /requestTrace: post: description: Triggers a contact trace on a user. Likely to become inaccessible except via pubsub requestBody: content: application/json: schema: type: object additionalProperties: false properties: subscription: type: string description: subscription of the message. message: type: object additionalProperties: false properties: data: type: string description: The base64 encoding of the payload messageId: type: string description: id of the message. Provided by GCP message_id: type: string description: id of the message, again. Provided by GCP publishTime: type: string description: ISO datetime for when the message was published. Provided by GCP publish_time: type: string description: ISO datetime for when the message was published, again. Provided by GCP required: - data responses: '200': description: Success /admin/createToken: post: description: Exchange status-token for an access-token security: - bearerAuthJWT: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/StatusTokenExchangeRequest' responses: '200': description: Successfully exchanged content: application/json: schema: $ref: '#/components/schemas/ResponseOfAccess' /user/enter: post: description: Handle self user's entrance requestBody: content: application/json: schema: $ref: '#/components/schemas/SelfEntryOrExitRequest' responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfEnterOrExit' /user/exit: post: description: Handle self user's exit requestBody: content: application/json: schema: $ref: '#/components/schemas/SelfEntryOrExitRequest' responses: '200': description: Successfully handled content: application/json: schema: $ref: '#/components/schemas/ResponseOfEnterOrExit'