Download OpenAPI specification:
This API reference documents the endpoints available for desktop application integration with the Halo Connect Cloud API. It covers:
For more information about Halo Connect, visit our website or blog.
All API endpoints require an active pairing with the target site. Use the Pair with a site endpoint to establish access before making queries.
For detailed documentation and guides, see our documentation portal.
This endpoint enables integrators to obtain an authorization token for a specific desktop application associated with a given Halo GUID. The token is required to authenticate subsequent requests to the SQL Passthrough or FHIR for that desktop application.
| grant_type required | string Value: "urn:halo-connect:oauth:desktop-token" Must be set to urn:halo-connect:oauth:desktop-token |
| device_id required | string The unique identifier of the device |
| site_id required | string The Halo GUID of the site |
grant_type=urn%3Ahalo-connect%3Aoauth%3Adesktop-token&device_id=example-device-123&site_id=example-site-guid
{- "access_token": "string",
- "token_type": "string",
- "expires_in": 0
}Send SQL queries to practices as immediate, async or registered queries.
Immediate queries are small, time-sensitive queries that return a result in seconds. Response size is limited to 8MB.
Async queries are queued for execution and results can be retrieved later. The workflow is:
queryId on success.Registered Queries are also supported. See the Registered Queries section for more information.
Send an immediate query to a site and receive the result in the response.
Query status can also be retrieved using the Get query status endpoint.
| siteId required | string Halo GUID of the site. |
| maxTimeInQueue | number <milli-seconds> (ImmediateMaxTimeInQueue) [ 0 .. 60000 ] |
required | object (Command) |
| catalogue | string (Catalogue) Indicates which database to run against. If no catalogue is specified a default catalogue will be chosen instead. Supported for all PMS with multiple databases. Database catalogues, including the default catalogue, can be identified from the catalogue.name property returned by the Site API endpoints, and are consistent across all sites of a single PMS type. |
{- "maxTimeInQueue": 15000,
- "command": {
- "text": "GetPatientID",
- "executionMode": "reader",
- "type": "text",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}, - "catalogue": "Patients"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "integratorId": "1acd5efb-e960-4c96-8a84-ca37f187f58b",
- "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
- "mode": "immediate",
- "maxTimeInQueue": 15000,
- "commandSize": 98,
- "requestSize": 98,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "successful",
- "statusTiming": {
- "initialising": {
- "startTime": "2019-08-24T14:15:22Z"
}, - "executing": {
- "startTime": "2019-08-24T14:15:22Z"
}, - "downloading": {
- "startTime": "2019-08-24T14:15:22Z"
}, - "uploading": {
- "startTime": "2019-08-24T14:15:22Z"
}
}, - "metrics": {
- "sqlExecutionDuration": 1000
}, - "result": {
- "rows": 30,
- "size": 25,
- "data": "e2lk...",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}, - "resultSize": 98,
- "completedAt": "2019-08-24T14:15:22Z"
}Queue an async query for execution at the specified site.
| siteId required | string Halo GUID of the site. |
| maxTimeInQueue | number <milli-seconds> (AsyncMaxTimeInQueue) [ 0 .. 7200000 ] |
required | object (Command) |
| catalogue | string (Catalogue) Indicates which database to run against. If no catalogue is specified a default catalogue will be chosen instead. Supported for all PMS with multiple databases. Database catalogues, including the default catalogue, can be identified from the catalogue.name property returned by the Site API endpoints, and are consistent across all sites of a single PMS type. |
{- "maxTimeInQueue": 900000,
- "command": {
- "text": "GetPatientID",
- "executionMode": "reader",
- "type": "text",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}, - "catalogue": "Patients"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "integratorId": "1acd5efb-e960-4c96-8a84-ca37f187f58b",
- "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
- "mode": "async",
- "status": "initialising",
- "maxTimeInQueue": 900000,
- "commandSize": 98,
- "requestSize": 98,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "statusTiming": {
- "initialising": {
- "startTime": "2019-08-24T14:15:22.847Z"
}
}
}Check the status of an immediate or async query.
For completed async queries, the response includes a results object with pagination details for retrieving result pages. Immediate queries do not include pagination since results are returned with the initial request.
| siteId required | string Halo GUID of the site. |
| queryId required | string Id of the query. |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "integratorId": "1acd5efb-e960-4c96-8a84-ca37f187f58b",
- "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
- "mode": "async",
- "status": "successful",
- "maxTimeInQueue": 900000,
- "commandSize": 98,
- "requestSize": 98,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "statusTiming": {
- "initialising": {
- "startTime": "2019-08-24T14:15:22.847Z",
- "endTime": "2019-08-24T14:15:22.847Z"
}, - "queued": {
- "startTime": "2019-08-24T14:15:22.847Z",
- "endTime": "2019-08-24T14:15:22.847Z"
}, - "executing": {
- "startTime": "2019-08-24T14:15:22.847Z",
- "endTime": "2019-08-24T14:15:22.847Z"
}, - "uploading": {
- "startTime": "2019-08-24T14:15:22.847Z"
}
}, - "metrics": {
- "sqlExecutionDuration": 1000
}, - "result": {
- "rows": 30,
- "size": 25,
- "pages": [
- {
- "pageNumber": 1,
- "status": "queued",
- "size": 0,
- "rows": {
- "count": 10,
- "rangeStart": 1,
- "rangeEnd": 11
}
}
]
}, - "resultSize": 98,
- "completedAt": "2019-08-24T14:15:22Z"
}Get a result page from a successful async query.
| siteId required | string Halo GUID of the site. |
| queryId required | string Id of the query. |
| pageNumber required | number >= 1 Page number of the results for a query. |
{- "data": "e2lk...",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}Send a FHIR query to a site and receive the result in the response.
Include the resource name and search parameters in fhirParameters. Example: Patient?given=John
See the FHIR docs for supported resources and parameters.
| siteId required | string Halo GUID of the site. |
| fhirParameters required | string Resource names and search parameters per the R4 FHIR specification for using RESTful APIs and search. |
{- "application/json": {
- "resourceType": "Patient",
- "id": "1",
- "name": [
- {
- "use": "official",
- "text": "Mr John Smith",
- "family": "Smith",
- "given": [
- "John"
], - "prefix": [
- "Mr"
]
}
]
}
}Send a FHIR search query with parameters in the request body.
POST is recommended for sensitive queries containing personally identifiable information (PII), as it avoids URL length limits and keeps parameters out of logs.
See the FHIR docs for supported resources and parameters. Errors may return as HTTP errors or FHIR OperationOutcome resources.
| siteId required | string Halo GUID of the site. |
| resource required | string The name of the FHIR resource to search for. |
FHIR search parameters.
| property name* additional property | any |
given=John&birthdate=gt1900-01-01&_sort=birthdate
{- "application/json": {
- "resourceType": "Bundle",
- "type": "searchset",
- "total": 0
}
}Create a registered query to be queued for execution.
| siteId required | string Halo GUID of the site. |
| name required | string Customer set identifier for this registered query. |
| registeredQueryType required | string Value: "query" |
| frequency required | number Seconds between each query execution. |
| duration required | number Duration in seconds the query will run for. Up to 86400 seconds (24 hours). |
required | object Command to be executed by the registered query. |
{- "name": "string",
- "registeredQueryType": "query",
- "frequency": 300,
- "duration": 43200,
- "registerCommand": {
- "command": {
- "text": "GetPatientID",
- "executionMode": "reader",
- "type": "text",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}
}
}{- "id": "785f1ae1-1234-abcd-56ef-8679258f4aee"
}List all registered queries that are currently active and queued for execution.
| siteId required | string Halo GUID of the site. |
{- "registeredQueries": [
- {
- "id": "d8d667d9-1234-abcd-56ef-1234567890ab",
- "name": "Test",
- "registeredQueryType": "query",
- "status": "enabled",
- "frequency": 60,
- "duration": 120,
- "createdAt": "2025-05-27T05:23:40.983Z",
- "lastHash": "dOFA...",
- "metrics": {
- "lastExecutionDuration": 15,
- "executionSucceededCount": 1,
- "executionFailedCount": 0,
- "resultSizeSum": 8,
- "requestSize": 180,
- "lastSucceededAt": "2025-05-27T05:23:46.836Z"
}
}, - {
- "id": "6cf4e9be-1234-abcd-56ef-1234567890ab",
- "name": "Test",
- "registeredQueryType": "query",
- "status": "completed",
- "frequency": 60,
- "duration": 120,
- "createdAt": "2025-05-27T04:57:48.791Z",
- "completedAt": "2025-05-27T04:59:54.226Z",
- "lastErrorDetails": {
- "errorType": "mssql",
- "errorCode": 2812,
- "errorMessage": "Could not find stored procedure 'selct'."
}, - "metrics": {
- "lastExecutionDuration": 0,
- "executionSucceededCount": 0,
- "executionFailedCount": 3,
- "resultSizeSum": 0,
- "requestSize": 179,
- "lastFailedAt": "2025-05-27T04:59:54.226Z"
}
}
]
}Get the details of a registered query.
| siteId required | string Halo GUID of the site. |
| queryId required | string Id of the query. |
{- "id": "d8d667d9-1234-abcd-56ef-1234567890ab",
- "name": "Test",
- "registeredQueryType": "query",
- "status": "enabled",
- "frequency": 60,
- "duration": 120,
- "createdAt": "2025-05-27T05:23:40.983Z",
- "lastHash": "dOFA...",
- "metrics": {
- "lastExecutionDuration": 15,
- "executionSucceededCount": 1,
- "executionFailedCount": 0,
- "resultSizeSum": 8,
- "requestSize": 180,
- "lastSucceededAt": "2025-05-27T05:23:46.836Z"
}
}Cancel a registered query that is currently queued for execution.
| siteId required | string Halo GUID of the site. |
| queryId required | string Id of the query. |
{- "error": {
- "status": 400,
- "statusText": "Bad Request",
- "message": "Malformed SQL"
}
}Get the result of a registered query that has completed execution.
| siteId required | string Halo GUID of the site. |
| queryId required | string Id of the query. |
{- "data": "e2lk...",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
], - "rows": 12,
- "size": 25
}