---
title: "v1 vs v2"
section: explanation
order: 2
description: "The CollaborateMD WebAPI versions each endpoint independently."
---

The CollaborateMD WebAPI versions each endpoint independently. Some endpoints (even new endpoints) will only have a `/v1`, while some endpoints will have both `/v1` and `/v2`.

When endpoints with multiple versions exist, both are fully [supported indefinitely](/docs/guides/versioning-and-support.html). This page explains the differences and when to use each.

## Quick Comparison

| Aspect              | v1                                     | v2                                     |
|---------------------|----------------------------------------|----------------------------------------|
| **Request models**  | Shared with v2                         | Same classes as v1                     |
| **Response models** | v1 response types                      | Adds 8 richer response types           |
| **XML namespace**   | `http://www.collaboratemd.com/api/v1/` | `http://www.collaboratemd.com/api/v2/` |
| **Partner status**  | Supported indefinitely                 | Recommended for new work               |

## The Schema Relationship

**Requests: the same models under a different namespace.** A v2 endpoint accepts the same document
structure as its v1 counterpart — the `Claim`, `PatientUpdate`, and `Appointment` objects are
the v1 objects. Only the namespace differs, so porting a request means changing the namespace and the URL.

```xml
<!-- v1 request body -->
<PatientUpdate xmlns="http://www.collaboratemd.com/api/v1/"> ... </PatientUpdate>

<!-- v2 request body: same elements, same order, different namespace -->
<PatientUpdate xmlns="http://www.collaboratemd.com/api/v2/"> ... </PatientUpdate>
```

**Responses: v2 returns more.** `v2` was added with richer response types to support the Interface Automations capabilities.
v2 adds 7 response classes that have no v1 equivalent:

| v2 response type                                 | What it adds beyond `Status` / `StatusMessage` / `Identifier`                                                                                                                                        |
|--------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ResponseWithReview`                             | `EligibilityReports`, `AddressVerifications`, `Estimates`                                                                                                                                            |
| `ClaimResponse`                                  | Extends `ResponseWithReview` with `ClaimReviewed`, `ClaimErrorsFound`, `ClaimSubmitted`, `DidAnalysis`, `DidClaimScrubbing`, `DidRTCSValidation`, `ReviewSeqno`, `ReviewMessage`, and detail objects |
| `ClaimResponseDetail`, `ClaimResponseDetailBase` | Per-stage analysis, scrubbing, and real-time-submission detail                                                                                                                                       |
| `BillingAlertsDetail`, `BillingAlertMessage`     | Billing alerts raised while processing the claim                                                                                                                                                     |
| `AddressVerification`                            | Address validation outcome                                                                                                                                                                           |

So a v1 claim creation can tell you whether a claim was created; a v2 claim creation can also tell you what
claim review found, whether the claim was actually submitted. **A parser
written for v1 will not surface these additional details** — the extra elements are simply ignored.

## When v1 and v2 Differ: Endpoint Surface

Of the published operations, the following APIs have a v2 endpoint:

| Operation                           | Path (after the version prefix)                                       |
|-------------------------------------|-----------------------------------------------------------------------|
| Patient create/update, XML and HL7  | `POST /customer/{custno}/patient/xml`, `.../patient/hl7`              |
| Patient lookup                      | `GET /customer/{custno}/patient/find/{patient}/xml`                   |
| Patient updates poll                | `GET /customer/{custno}/patient/updates/find/xml`                     |
| Claim creation, XML / HL7 / 837     | `POST /customer/{custno}/claim/xml`, `.../claim/hl7`, `.../claim/837` |
| Institutional claim creation        | `POST /customer/{custno}/iclaim/xml`                                  |
| Appointment creation, XML and HL7   | `POST /customer/{custno}/appointment/xml`, `.../appointment/hl7`      |
| Data snapshots                      | `GET /customer/{custno}/snapshot`, `GET /account/{account}/snapshot`  |

**v2 only:** `POST /v2/customer/{custno}/claim/{claimId}/submit` — submits a claim that already exists in
CollaborateMD. This is `v2` only because is uses the new `v2` response objects.

**Strategy:** Use `v2` if there is a `v2` endpoint so that you have access to all new features.

## Choosing Between v1 and v2

### Start with v2 if…

- You are building a new integration from scratch
- You want to benefit from ongoing improvements

### Stay with v1 if…

- You have an existing, stable v1 integration (no requirement to move)

### Use both
Endpoints are versioned independently and share authentication. Choose the version that works best for you for each endpoint.

## Parsing a v2 Response

To handle a `v2` response compared to `v1`, two changes are needed. The namespace must be updated **and** — for the claim endpoints — your
parser must handle the additional response elements described above, or you will silently discard the
scrubbing, analysis, and eligibility results that are the main benefits of v2.

Updating the namespace:

```java
// Your XML parser will auto-discover the namespace.
// You may need to explicitly register v2's namespace if your parser requires it.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
Document doc = factory.newDocumentBuilder().parse(inputStream);

// Query by namespace + element name if your XPath uses namespaces:
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();
xpath.setNamespaceContext(new NamespaceContext() {
    public String getNamespaceURI(String prefix) {
        if ("cmd".equals(prefix)) {
            return "http://www.collaboratemd.com/api/v2/";  // or /v1/ for v1
        }
        return XMLConstants.NULL_NS_URI;
    }
    // ... (implement other required methods)
});
```

Most modern XML parsers handle namespace changes transparently if you use simple element queries.

If you are moving a claim integration to v2, also read the `ClaimResponse` fields on the endpoint page:
`ClaimSubmitted` and `ClaimErrorsFound` carry outcome information that v1's `Status` alone does not.

## Migrating from v1 to v2

If you are considering a migration:

1. **Identify v1 endpoints you use.** Check your integration code for `/v1/` paths.
2. **Check which have v2 equivalents.** See the [Open API specification](/#GET/openapi.json) or individual endpoint documentation.
3. **Plan the move in phases:**
   - Phase 1: Add v2 calls alongside v1 for endpoints that exist in both.
   - Phase 2: Test both in parallel in the sandbox.
   - Phase 3: Gradually shift production traffic to v2.
   - Phase 4: (Optional) Retire v1 calls that have v2 equivalents.
4. **No urgency.** v1 will be supported indefinitely. You can operate v1 indefinitely or migrate when convenient.

Contact Interface Support if you need guidance on a specific migration.

## Generated Build Artifacts: Two Schemas

The v2 XSD contains all of the v1 objects (in the v2 namespace), plus the v2-only response classes.

The v1 XSD contains the v1 objects (in the v1 namespace).

The two namespaces let v1 and v2 coexist: a document declares which contract it follows, so deploying v2
does not disturb v1 clients, allowing you to mix-and-match versions.

## See Also

- [Versioning and Support Policy](versioning-and-support.md)
- [OpenAPI Specification](/#GET/openapi.json)
