This guide compares the current DVIDS API with the V2 Content API exposed at https://api.dvidshub.net/v2. V2 uses JSON:API, not the legacy response format.
V2 is not yet a drop-in replacement for the entire API. Keep using the existing API for features that do not yet have a v2 endpoint. Adding /v2 to an existing request does not automatically migrate it.
Current support by API version: ✓ = supported, ✗ = not supported.
| Asset type | V1 | V2 |
|---|---|---|
| Images | ✓ | ✗ |
| Videos | ✓ | ✗ |
| Audio | ✓ | ✗ |
| News | ✓ | ✗ |
| Graphics | ✓ | ✗ |
| Publication issues | ✓ | ✗ |
| Webcasts | ✓ | ✗ |
| Documents | ✗ | ✓ |
| API | Base URL | Examples |
|---|---|---|
| Existing API | https://api.dvidshub.net |
/search, /asset?id=image:123456 |
| V2 production | https://api.dvidshub.net/v2 |
/document, /document/123 |
Currently implemented v2 operations:
GET /v2/document: list published documents.GET /v2/document/{id}: retrieve one published document by its document ID.There is currently no Content API replacement for legacy /search, /asset, /asset/related, playlist, podcast, live, upload, or video analytics operations. Images, videos, news, audio, graphics, and publication issues are not exposed as v2 Content API resource endpoints yet. Document categories and service units can be included through document relationships; their schemas do not imply standalone collection or detail routes.
The Content API is read-only.
Most existing content requests use an api_key request parameter. The legacy authentication plugin also accepts client_id as an alias and supports application/public and secret keys through that parameter. Missing or rejected API keys normally produce 403.
The OAuth authorization and token exchange endpoints are documented in Authentication. Some existing user endpoints accept an access_token query parameter as well as an Authorization header.
V2 accepts any one of these credential types. Using an Authorization header avoids having your secret key exposed in server or proxy logs.
| Credential | How to send it | Important differences |
|---|---|---|
| Application/public API key | Authorization: Bearer <application-key> or ?api_key=<application-key> |
Typically a 17-character key-... value. Registered Origin/Referer restrictions still apply. |
| Secret API key | Authorization: Bearer <secret-key> |
A 40-character key. Never put it in the query string or browser code. |
API keys must be active and resolve to an API account with an existing creator member. V2 does not accept client_id as an API-key alias or access_token as a query-string authentication mechanism. The client_id parameter is still used by the existing OAuth authorization/token exchange flow; that flow is not moved under /v2.
Send only one credential mechanism per request.
V2 missing or rejected credentials produce 401 Unauthorized, rather than the legacy key-authentication 403.
Server-side Bearer authentication:
GET /v2/document/123 HTTP/1.1
Host: api.dvidshub.net
Authorization: Bearer <secret-key-or-eligible-token>
Accept: application/vnd.api+json
Public application-key authentication:
GET /v2/document?api_key=<application-key> HTTP/1.1
Host: api.dvidshub.net
Origin: https://your-registered-app.example
Accept: application/vnd.api+json
Send Accept: application/vnd.api+json. Successful Content API responses use that media type rather than the legacy application/json.
The main response changes are:
data replaces results. Collection data is an array; detail data is a single resource object. An empty collection is {"data":[]}.(type, id). IDs are strings. V2 documents use type: "document" and an ID such as "123", not "document:123".attributes. Read data.attributes.title for a detail result, not results.title.relationships contains typed resource identifiers; related attributes can be requested using include.included is a top-level array. Match related resources by both type and id, not array position.links and meta carry navigation and metadata when supplied. Do not expect the legacy page_info, messages, or suggestions members.errors array, not a list of plain strings. A JSON:API error response does not contain successful primary data.Do not confuse JSON:API type with the old search type filter. The current document collection is already restricted to documents and does not accept legacy media-type selection as a replacement for resource routing.
For a legacy request such as /asset?id=image:123456, a shortened response has this shape:
{
"results": {
"id": "image:123456",
"title": "Example image",
"description": "Image description",
"keywords": "training,exercise",
"unit_name": "Example Unit",
"date": "2026-01-15T12:00:00+00:00"
}
}
For /v2/document/123?include=category,service_unit&fields[document]=title,description,tags,status,category,service_unit, an illustrative response is:
{
"data": {
"type": "document",
"id": "123",
"attributes": {
"title": "Example document",
"description": "Document description",
"tags": ["training", "exercise"],
"status": "published"
},
"relationships": {
"category": {
"data": {"type": "document-category", "id": "12"}
},
"service_unit": {
"data": {"type": "service-unit", "id": "100"}
}
}
},
"included": [
{
"type": "document-category",
"id": "12",
"attributes": {"name": "Example category"}
},
{
"type": "service-unit",
"id": "100",
"attributes": {
"name": "Example Unit",
"abbreviation": "EXAMPLE",
"branch": "army"
}
}
]
}
The following are conceptual client mappings, not a promise that every legacy asset has a corresponding document:
| Legacy value | V2 document value | Migration note |
|---|---|---|
results.title / results.description |
data.attributes.title / data.attributes.description |
Collection resources use the same structure inside data[]. |
Combined ID such as image:123456 |
data.type plus data.id |
Keep both values as the identity; IDs are strings. |
Comma-separated keywords |
attributes.tags |
Tags are an array of strings, not a comma-delimited string. |
date |
attributes.created_at |
Document creation date; do not assume identical acquisition-date semantics across asset types. |
date_published / deprecated publishdate |
attributes.published_at |
A date-time value, nullable when unavailable. |
timestamp |
attributes.modified_at |
Modification date-time. |
unit_name / branch |
Included service-unit attributes |
Use include=service_unit; branch is lowercased and may be null. |
category name |
relationships.category and included document-category |
Linkage uses a category ID, with its name in the included resource. |
Ready-to-use thumbnail |
attributes.thumbnail_url_template |
Replace {thumbnailSpec} to produce a thumbnail URL. |
Documents also expose instructions, pages, and opt-in ocr_text. pages and ocr_text can be null until OCR processing completes. Missing optional attributes are not equivalent to empty strings or zero.
Use include=category,service_unit to obtain related resource attributes in the same response. Without inclusion, relationship linkage is not the related object's full details. A to-one relationship can have data: null; handle that without attempting a lookup in included.
When using sparse fieldsets and includes together, keep the relationship names in fields[document], for example:
/v2/document/123?include=service_unit&fields[document]=title,service_unit
Legacy fields=title,description becomes:
fields[document]=title,description
The fieldset replaces, rather than adds to, the normal field selection. ocr_text is deliberately omitted by default because it can be large. Request it explicitly along with every other field you need:
/v2/document/123?fields[document]=title,description,ocr_text
Replace the literal {thumbnailSpec} in thumbnail_url_template with a spec such as 150x160_q95. The returned template already supplies .jpg or .png; do not append another extension. Legacy thumb_width, thumb_height, and thumb_quality request parameters are not supported parameters in v2. See Dynamic Thumbnails for thumbnail specifications.
JSON:API defines the parameter families, but each API defines its supported filters and sort fields. Do not copy the entire legacy search query onto /v2/document.
| Existing API convention | V2 document query |
|---|---|
fields=title,description |
fields[document]=title,description |
page=2&max_results=20 |
page[number]=2&page[size]=20 |
sort=date&sortdir=asc |
sort=created_at for document creation order |
sort=date&sortdir=desc |
sort=-created_at |
unit_id=100 on search |
filter[service_unit]=100 |
| Category name filter | filter[category]=12, using a document-category ID |
| Tag selection | filter[tags]=policy,briefing |
from_publishdate / to_publishdate |
filter[published_at][from] / filter[published_at][to] |
from_date / to_date |
filter[created_at][from] / filter[created_at][to] |
| Modification-time selection | filter[modified_at][from] / filter[modified_at][to] |
Additional supported filtering includes document IDs through filter[id]. Category and service-unit filters accept comma-separated IDs; tags accept comma-separated values and match any listed tag. Only created_at is explicitly sortable.
Date-range bounds are inclusive.
Example collection request:
/v2/document?filter[service_unit]=100&filter[tags]=policy,briefing&filter[published_at][from]=2026-01-01&sort=-created_at&page[number]=1&page[size]=20
Use a URL/query builder to encode bracketed parameter names and values correctly. Collection data is an array, even if only one document matches.
Legacy search returns page_info.total_results and page_info.results_per_page, caps page size at 50, and limits accessible results to 1,000. V2 uses page-number pagination through the JSON:API paginator instead of this legacy envelope. Set a page size explicitly, inspect returned pagination links/meta, and follow the returned next-page link when available. Do not carry over legacy defaults, caps, or metadata key names as a v2 guarantee. Continue sending your authentication with subsequent page requests.
There is currently no v2 document equivalent for full-text q, relevance scoring, spellcheck suggestions, highlighting, include_related_media, format=rss, or prettyprint.
A typical legacy API-key error is:
{
"errors": ["Bad Request - No API key was provided"]
}
V2 authentication failure returns HTTP 401 with:
{
"errors": [
{
"status": "401",
"title": "Unauthenticated",
"detail": "You must be authenticated to access this resource."
}
]
}
Successful responses use the JSON:API media type. The current authentication exception handler sends its structured 401 body as application/json, so clients must not discard that error just because its media type differs from a successful response.
For other JSON:API errors, read each error object's available status, title, detail, and, when supplied, source information. Do not assume every error has every property, or keep using errors[0] as a display string. Use the HTTP status as well as the body.
Legacy /asset can return 400 for a missing asset and 403 for an unpublished one. V2 deliberately treats both missing and unpublished documents as 404 and only lists published documents. A document disappearing from the public API should trigger removal or revalidation of cached public content under the Terms of Service, not indefinite serving of an old cached copy.
/v2 in production, the configured content-api hostname without /v2 in development.client_id / access_token query authentication from content requests.Accept: application/vnd.api+json; account for the current authentication error media type.results parsing with data, attributes, typed IDs, relationships, and optional included lookups.https://api.dvidshub.net/v2 before following them.