Skip to content

docs: add Enterprise Data API reference and usage reports guide#25383

Draft
cassio-paesleme wants to merge 8 commits into
docker:mainfrom
cassio-paesleme:cassio/enterprise-data-api-docs
Draft

docs: add Enterprise Data API reference and usage reports guide#25383
cassio-paesleme wants to merge 8 commits into
docker:mainfrom
cassio-paesleme:cassio/enterprise-data-api-docs

Conversation

@cassio-paesleme

Copy link
Copy Markdown

Summary

  • Adds OpenAPI 3.0 spec and API reference page for the Docker Enterprise Data API at /reference/api/enterprise-data/
  • Adds feature guide for enterprise usage reports at /manuals/enterprise/reports/

Context

Docker Enterprise subscribers will be able to programmatically export organization usage reports (pull data) via api.docker.com/enterprise-data/v1/. This is a new API surface, separate from the Hub API, supporting both PAT and OAT authentication.

Related PRs:

New pages

Path Description
/reference/api/enterprise-data/api.yaml OpenAPI 3.0 spec (4 endpoints: list types, list reports, download, schema)
/reference/api/enterprise-data/index.md API reference landing page
/manuals/enterprise/reports/_index.md Feature guide with auth setup, curl walkthrough, pagination, troubleshooting

Test plan

  • API reference renders correctly at /reference/api/enterprise-data/
  • Feature guide renders in the Enterprise sidebar
  • curl examples are copy-pasteable and accurate

🤖 Generated with Claude Code

Add documentation for the Docker Enterprise Data API, which provides
programmatic access to organization usage reports (CSV) via
api.docker.com/enterprise-data/v1/.

- reference/api/enterprise-data/ — OpenAPI 3.0 spec and rendered API
  reference page for all four endpoints (list types, list reports,
  download, schema)
- manuals/enterprise/reports/ — feature guide with authentication
  setup (PAT and OAT flows), curl walkthrough, pagination, and
  troubleshooting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit ca54d60
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a330d4859419400086ba096
😎 Deploy Preview https://deploy-preview-25383--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the area/api Relates to Docker API docs label Jun 17, 2026

@docker-agent docker-agent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🔴 CRITICAL

Two newly added documents (the OpenAPI spec and the feature guide) describe different URL structures for the same API endpoints. One of them is wrong, and users will get 404 errors following whichever document is incorrect.

- bearerAuth: []

paths:
/orgs/{org_name}:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] OpenAPI spec paths missing /reports segment — inconsistent with guide

The OpenAPI spec defines the listReportTypes endpoint at /orgs/{org_name} (full URL: https://api.docker.com/enterprise-data/v1/orgs/{org_name}), but the feature guide and the API reference table both consistently use /orgs/{org}/reports as the list-report-types path. The same mismatch applies across all four endpoints:

OpenAPI spec path Guide/table path
GET /orgs/{org_name} GET /orgs/{org}/reports
GET /orgs/{org_name}/{type}/{cadence} GET /orgs/{org}/reports/{type}/{cadence}
GET /orgs/{org_name}/{type}/{cadence}/{date}/download GET /orgs/{org}/reports/{type}/{cadence}/{date}/download
GET /orgs/{org_name}/{type}/{cadence}/{date}/schema GET /orgs/{org}/reports/{type}/{cadence}/{date}/schema

One of these is wrong. If the actual API requires /reports in the path (as the guide shows), users using the spec for client generation or manual calls will get 404 errors. If the spec is correct, every curl example in the guide will fail.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c8fe0a6. Added the missing /reports segment to all four OpenAPI spec paths. They now match the guide.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you! Confirmed that all four paths now include /reports and align with the guide. The spec is now consistent and will generate correct client code.

Discover which report types and cadences are available for your organization.

```console
$ curl -s "https://api.docker.com/enterprise-data/v1/orgs/$ORG/reports" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] curl examples include /reports path segment not present in OpenAPI spec

All curl examples in this guide include /reports in the path (e.g., /orgs/$ORG/reports, /orgs/$ORG/reports/usage_pulls/daily), but the OpenAPI spec defines paths without this segment (e.g., /orgs/{org_name}, /orgs/{org_name}/{type}/{cadence}).

Both documents are new and were published together, yet they describe different URL structures. Please reconcile: either add the missing /reports segment to all four paths in api.yaml, or remove it from the guide's curl examples and reference table to match the spec.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c8fe0a6. The OpenAPI spec paths now include /reports and match the curl examples.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you! I verified the commit and all four paths in the OpenAPI spec now correctly include "/reports" to match the curl examples and documentation. The discrepancy is resolved.


```bash
DATE=$(
curl -s "https://api.docker.com/enterprise-data/v1/orgs/$ORG/reports/usage_pulls/daily?page_size=1" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MEDIUM] Download-latest script silently produces broken output when no reports exist

When the API returns an empty reports list, jq -r '.reports[0].Date' outputs the literal string null (not an empty string). The script then silently:

  • Creates a file named usage_pulls_null.csv
  • Makes a download request to .../daily/null/download, which returns a 404

Consider adding a guard to catch this case:

DATE=$(
  curl -s "https://api.docker.com/enterprise-data/v1/orgs/$ORG/reports/usage_pulls/daily?page_size=1" \
    -H "Authorization: Bearer $TOKEN" \
  | jq -r '.reports[0].Date // empty'
)

if [ -z "$DATE" ]; then
  echo "No reports available."
  exit 1
fi

curl -L -o "usage_pulls_${DATE}.csv" \
  "https://api.docker.com/enterprise-data/v1/orgs/$ORG/reports/usage_pulls/daily/${DATE}/download" \
  -H "Authorization: Bearer $TOKEN"

Using // empty makes jq output nothing (empty string) instead of null, so the shell check [ -z "$DATE" ] works correctly for both the no-reports and API-error cases.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e983461. Added // empty to the jq expression and a shell guard that exits early with a message when no reports are available.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thanks for the quick fix. The guard now correctly handles the empty reports case and prevents the script from creating broken files.

cassio-paesleme and others added 7 commits June 17, 2026 14:20
The spec paths were missing the /reports segment, making them
inconsistent with the curl examples in the guide and the actual
REST handler routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use jq's // empty alternative operator so an empty report list
produces an empty string instead of the literal "null". Add a
shell guard to exit early with a message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restructure the Enterprise Data API reference to match the sidebar
pattern used by Docker Hub API and DVP Data API:
- _index.md as hidden section index (build: render: never)
- latest.md with layout: api pointing to latest.yaml
- changelog.md with initial release entry
- deprecated.md with empty deprecation table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per IAM team guidance, PATs cannot be scoped outside of registry.
OATs are the only supported auth mechanism for the Reports API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api Relates to Docker API docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants