<div class="endpoint"><span class="method">GET</span><code>/api/v1/workspaces/&#123;workspaceId&#125;/health-invoices/&#123;invoiceId&#125;/artifacts/&#123;artifact&#125;</code></div>

**Operation ID:** `healthInvoices.downloadArtifact` · **Access:** PAT with `send` scope and authorized workspace where applicable · **Effect:** `external`.

:::caution[Production action]
This operation can send data to an external service. Use a new idempotency key for each new intent. A timeout does not prove that the action failed.
:::

Read the [health invoices workflow](/guides/health-documents/) before this operation.

## Parameters

| Name | In | Required | Type / allowed values |
| --- | --- | --- | --- |
| `workspaceId` | path | Yes | string |
| `invoiceId` | path | Yes | string |
| `artifact` | path | Yes | `pdf`, `xml`, `attached` |

## Responses

| HTTP | Content | Schema |
| --- | --- | --- |
| 200 | `application/octet-stream` | string |
| 400 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 401 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 403 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 404 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 409 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 500 | `application/json` | [ApiError](/reference/schemas/api-error/) |
| 502 | `application/json` | [ApiError](/reference/schemas/api-error/) |

Use `error.code`, `error.issues`, and `requestId` for JSON errors. [Error and recovery guide](/guides/errors-and-retries/).

## cURL

Set the connection variables from the [quickstart](/guides/quickstart/). Set each path variable to an authorized identifier or an allowed parameter value from the table above.

```bash
curl --fail-with-body --request GET \
  "$RIPSCLOUD_BASE_URL/api/v1/workspaces/$WORKSPACE_ID/health-invoices/$INVOICE_ID/artifacts/$ARTIFACT" \
  --header "Authorization: Bearer $RIPSCLOUD_TOKEN" \
  --header 'Accept: application/octet-stream' \
  --output artifact.bin
```
