documentation

Patient Vault v3 API

Attach

/v3/patient/{patientId}/attach endpoint reference.

URL: https://demo.1health.io/api/v3/patient/{patientId}/attach

APIs for uploading, listing, fetching, and deactivating a patient's file attachments (PDFs, images, audio, FHIR bundles) with structured metadata. Storage only — no content extraction.

Endpoints

EndpointMethodDescription
/v3/patient/{patientId}/attachGETList a patient's attachments
/v3/patient/{patientId}/attachPOSTUpload a file (multipart) and attach it to a patient
/v3/patient/{patientId}/attachPOSTUpload a file (multipart) and attach it to a patient
/v3/patient/{patientId}/attach/{documentId}GETGet a single patient attachment
/v3/patient/{patientId}/attach/{documentId}DELETEDeactivate a patient attachment

GET/v3/patient/{patientId}/attach

List a patient's attachments

Overview

Returns all attachments for a patient, newest first, each with a fresh signed download URL. Requires authentication.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
patientIdLongYesThe ID of the patient.

Query Parameters

ParameterTypeRequiredDefaultDescription
documentTypeStringNoOptional filter by document type (e.g. lab_result, imaging, clinical_note, audio, fhir_bundle, referral, consent_form, other). Omit to list all.

Responses

200 OK

List of patient attachments.

DTO: PatientAttachmentListResponseDTO

{
  "attachments": [
    {}
  ]
}
FieldTypeNullableDescription
attachmentsListNoThe patient's attachment records.

Example

curl -X GET "https://demo.1health.io/api/v3/patient/1001/attach" \
  -H "Authorization: Bearer $TOKEN"

POST/v3/patient/{patientId}/attach

Upload a file (multipart) and attach it to a patient

Overview

Same as the JSON upload, but the file is sent as a multipart/form-data part instead of base64. Requires authentication.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
patientIdLongYesThe ID of the patient.

Request Body

Content-Type: application/json · DTO: PatientAttachmentRequestDTO

{
  "documentType": "example-value",
  "data": "example-value",
  "name": "example-value",
  "metadata": "example-value"
}
FieldTypeRequiredConstraintsDescription
documentTypestringYesallowableValues: [lab_result, imaging, clinical_note, audio, fhir_bundle, referral, consent_form, other]The category of document being uploaded.
datastringYesThe file bytes, base64-encoded.
namestringNoDisplay name. Defaults to the uploaded filename / a generated name when omitted.
metadataobjectNoArbitrary structured key/value metadata stored alongside the file. Returned on the single-item read.

Responses

201 Created

Attachment stored successfully.

DTO: PatientAttachmentResponseDTO

{
  "id": 1001,
  "patientId": 1001,
  "documentType": "example-value",
  "name": "example-value",
  "active": true,
  "contentType": "example-value",
  "sizeBytes": 1001,
  "metadata": {},
  "downloadUrl": "example-value",
  "downloadUrlExpiresAt": "2024-01-15T09:30:00Z",
  "createdAt": "2024-01-15T09:30:00Z"
}
FieldTypeNullableDescription
idLongNoServer-assigned attachment (document) ID.
patientIdLongYesID of the patient the attachment belongs to.
documentTypeStringNoThe category of document.
nameStringNoDisplay name.
activeBooleanNoWhether the attachment is active. Deactivated attachments are retained but have no download URL.
contentTypeStringNoMIME type of the file.
sizeBytesLongNoSize of the file in bytes.
metadataMap<String, Object>YesArbitrary structured key/value metadata stored with the file. Populated only on the single-item read.
downloadUrlStringNoTime-limited signed URL for downloading the file.
downloadUrlExpiresAtLocalDateTimeNoWhen the signed download URL expires (UTC).
createdAtLocalDateTimeNoWhen the attachment was created (UTC).

Example

curl -X POST "https://demo.1health.io/api/v3/patient/1001/attach" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{"documentType": "example-value", "data": "example-value", "name": "example-value", "metadata": "example-value"}'

POST/v3/patient/{patientId}/attach

Upload a file (multipart) and attach it to a patient

Overview

Same as the JSON upload, but the file is sent as a multipart/form-data part instead of base64. Requires authentication.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
patientIdLongYesThe ID of the patient.

Request Body

Content-Type: multipart/form-data · DTO: PatientAttachmentMultipartRequestDTO

Responses

201 Created

Attachment stored successfully.

DTO: PatientAttachmentResponseDTO

{
  "id": 1001,
  "patientId": 1001,
  "documentType": "example-value",
  "name": "example-value",
  "active": true,
  "contentType": "example-value",
  "sizeBytes": 1001,
  "metadata": {},
  "downloadUrl": "example-value",
  "downloadUrlExpiresAt": "2024-01-15T09:30:00Z",
  "createdAt": "2024-01-15T09:30:00Z"
}
FieldTypeNullableDescription
idLongNoServer-assigned attachment (document) ID.
patientIdLongYesID of the patient the attachment belongs to.
documentTypeStringNoThe category of document.
nameStringNoDisplay name.
activeBooleanNoWhether the attachment is active. Deactivated attachments are retained but have no download URL.
contentTypeStringNoMIME type of the file.
sizeBytesLongNoSize of the file in bytes.
metadataMap<String, Object>YesArbitrary structured key/value metadata stored with the file. Populated only on the single-item read.
downloadUrlStringNoTime-limited signed URL for downloading the file.
downloadUrlExpiresAtLocalDateTimeNoWhen the signed download URL expires (UTC).
createdAtLocalDateTimeNoWhen the attachment was created (UTC).

Example

curl -X POST "https://demo.1health.io/api/v3/patient/1001/attach" \
  -H "Authorization: Bearer $TOKEN"

GET/v3/patient/{patientId}/attach/{documentId}

Get a single patient attachment

Overview

Returns one active attachment by id, including its metadata and a fresh signed download URL. Requires authentication.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
patientIdLongYesThe ID of the patient.
documentIdLongYesThe ID of the attachment.

Responses

200 OK

Attachment found.

DTO: PatientAttachmentResponseDTO

{
  "id": 1001,
  "patientId": 1001,
  "documentType": "example-value",
  "name": "example-value",
  "active": true,
  "contentType": "example-value",
  "sizeBytes": 1001,
  "metadata": {},
  "downloadUrl": "example-value",
  "downloadUrlExpiresAt": "2024-01-15T09:30:00Z",
  "createdAt": "2024-01-15T09:30:00Z"
}
FieldTypeNullableDescription
idLongNoServer-assigned attachment (document) ID.
patientIdLongYesID of the patient the attachment belongs to.
documentTypeStringNoThe category of document.
nameStringNoDisplay name.
activeBooleanNoWhether the attachment is active. Deactivated attachments are retained but have no download URL.
contentTypeStringNoMIME type of the file.
sizeBytesLongNoSize of the file in bytes.
metadataMap<String, Object>YesArbitrary structured key/value metadata stored with the file. Populated only on the single-item read.
downloadUrlStringNoTime-limited signed URL for downloading the file.
downloadUrlExpiresAtLocalDateTimeNoWhen the signed download URL expires (UTC).
createdAtLocalDateTimeNoWhen the attachment was created (UTC).

Example

curl -X GET "https://demo.1health.io/api/v3/patient/1001/attach/1001" \
  -H "Authorization: Bearer $TOKEN"

DELETE/v3/patient/{patientId}/attach/{documentId}

Deactivate a patient attachment

Overview

Soft-deletes an attachment: it is marked deleted and excluded from the list. The file is retained for compliance purposes. Requires authentication.

Authorization

Bearer JWT required. See the authentication guide.

Path Parameters

ParameterTypeRequiredDescription
patientIdLongYesThe ID of the patient.
documentIdLongYesThe ID of the attachment.

Responses

200 OK

Attachment deactivated successfully.

DTO: PatientAttachmentDeleteResponseDTO

{
  "id": 1001,
  "active": true,
  "deletedAt": "2024-01-15T09:30:00Z"
}
FieldTypeNullableDescription
idLongNoID of the deactivated attachment.
activebooleanNoWhether the attachment is active.
deletedAtLocalDateTimeNoTimestamp when the attachment was deactivated (UTC).

Example

curl -X DELETE "https://demo.1health.io/api/v3/patient/1001/attach/1001" \
  -H "Authorization: Bearer $TOKEN"

Parent: https://agents.1health.io/public/demo/api/v3/patient/_patientId_/agents.md · Site guide: https://agents.1health.io/public/demo/api/agents.md