openapi: 3.2.0 info: title: Beneficiary Claims Data API description: 'The Beneficiary Claims Data API (BCDA) allows downloading of claims data in accordance with the FHIR Bulk Data Export specification. If you have a Client ID and Secret you can use this page to explore the API. To do this: 1. Click the green "Authorize" button below and enter your Client ID and secret in the Basic Authentication boxes. 2. Request a bearer token from /auth/token 3. Click the green "Authorize" button below and put "Bearer {YOUR_TOKEN}" in the bearer_token box. Until you click logout your token will be presented with every request made. To make requests click on the "Try it out" button for the desired endpoint.' contact: email: bcapi@cms.hhs.gov license: name: Public Domain url: https://github.com/CMSgov/bcda-app/blob/main/LICENSE.md version: 1.0.0 servers: [] tags: - name: data paths: /data/{jobId}/{filename}: get: tags: - data summary: Get data file description: Returns the NDJSON file of data generated by an export job, which can be found via the jobs/{jobId} response. Will be in the format .ndjson or -error.ndjson. Gzip is highly encouraged for faster downloads. operationId: serveData parameters: - name: jobId in: path description: ID of data export job required: true schema: type: integer format: int64 x-go-name: JobID x-go-name: JobID - name: filename in: path description: Name of file to be downloaded required: true schema: type: string x-go-name: Filename x-go-name: Filename - name: Accept-Encoding in: header description: Encoding type to use schema: type: string enum: - gzip x-go-name: AcceptEncoding x-go-name: AcceptEncoding responses: '200': description: File of newline-delimited JSON FHIR objects headers: Content-Encoding: description: Header defining encoding type used schema: type: string enum: - gzip content: application/fhir+json: schema: $ref: '#/components/schemas/NDJSON' '400': description: Malformed request. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html. content: application/fhir+json: schema: $ref: '#/components/schemas/OperationOutcomeResponse' '401': description: Unauthorized. The provided credentials are invalid for the requested resource. content: {} '404': description: The requested path was not found. The body will contain a FHIR OperationOutcome resource in JSON format. https://www.hl7.org/fhir/operationoutcome.html content: application/fhir+json: schema: $ref: '#/components/schemas/OperationOutcomeResponse' security: - bearer_token: [] components: schemas: OperationOutcomeResponse: type: object properties: Issue: type: object required: - Severity - Code - Diagnostics properties: Severity: description: 'Severity of the outcome: fatal | error | warning | information' type: string Code: description: Error or warning code type: string Diagnostics: description: Additional diagnostic information about the issue type: string x-go-package: github.com/CMSgov/bcda-app/bcda/models NDJSON: type: string x-go-package: github.com/CMSgov/bcda-app/bcda/models securitySchemes: basic_auth: type: http scheme: basic bearer_token: type: apiKey description: The Group and Patient endpoints require a Bearer Token. 1) Put your credentials in Basic Authentication, 2) Request a bearer token from /auth/token, 3) Put "Bearer {TOKEN}" in this field (no quotes) using the bearer token retrieved in step 2 name: Authorization in: header x-original-swagger-version: '2.0'