Overview
Authentication, environments, and the public NextDocs v1 resource model.
NextDocs Public API v1
NextDocs exposes a versioned public API for creating artifacts, managing brands
and themes, launching exports, and polling async resources. The API version
v1 is independent of your product experience: it serves both Classic and V2.
Base URL: https://api.nextdocs.io
All public endpoints live under /v1. The docs-native API reference
at API Reference is generated from the live OpenAPI
document.
Authentication
All endpoints require an API key. Include it in the Authorization header:
Authorization: Bearer nxd_your_api_key
Create an API key in your API settings.
Creating artifacts
New REST creations use the experience assigned to your account. Existing Classic accounts retain their current creation behavior. The API does not change your account preference.
V2 accounts
Both POST /v1/artifacts and POST /v1/artifacts/async return an
artifact_operation receipt for a normal V2 Task. Include a new request_id
UUID for each requested generation:
curl https://api.nextdocs.io/v1/artifacts/async \
-H 'Authorization: Bearer nxd_your_api_key' \
-H 'Content-Type: application/json' \
-d '{
"request_id": "ad03ecf8-4f44-4a5c-bb9b-c5d35e79519d",
"instruction": "Create a three-page introduction to our design studio",
"type": "presentation",
"num_pages": 3
}'Retain the returned operation_id and poll
GET /v1/artifacts/operations/{operation_id}. Continue polling while the
operation is active or saving. Once completed, use the saved links in
artifacts. Each result includes its artifact ID, version and any save_error;
check that field before treating a result as saved. A request with multiple
design variations returns separate artifacts from the same Task.
failed, cancelled and interrupted are terminal states. Status reads do not
retry generation or consume generation credits. If a create request times out,
reuse its UUID for the same input to retrieve the accepted operation. Use a new
UUID only when you intend to request another generation.
The optional model uses the same model catalog and plan access as V2 Tasks;
it defaults to fast. An unavailable mode or model is rejected rather than
replaced with a different model. Classic's model fallbacks do not apply to V2.
V2 instructions use the Task limit of 30,000 characters after trimming. For larger source material, upload a file in the app. Classic instructions retain their existing 300,000-character limit.
Classic accounts
POST /v1/artifacts waits for generation and returns the artifact.
POST /v1/artifacts/async returns an artifact with status="generating";
poll GET /v1/artifacts/{id} until ready or failed.
Saved artifacts
GET, PATCH and DELETE /v1/artifacts/{id} follow the saved artifact's
runtime, even after your account preference changes. V2 rename saves a version
without AI generation. V2 deletion retains the managed artifact's deletion
record and leaves private Tasks independent; Classic deletion remains permanent.
GET /v1/artifacts lists the selected workspace using your account default.
For V2, pass the returned next_cursor as after to read the next page.
Classic pagination continues to use artifact IDs as after.
Exports
POST /v1/exports waits for an export; POST /v1/exports/async returns a
processing export to poll with GET /v1/exports/{id}. Exporting a saved V2
artifact uses its existing content and sharing, plan and watermark rules.
It does not regenerate content or expose the creator's private Task files.
V2 supports PDF, PPTX, PNG, HTML, Markdown and MP4 slideshow exports, plus
connected Google exports where supported. PNG results are ZIP files, including
single-page exports; HTML may be a ZIP bundle containing assets. MP4 is a
slideshow of saved pages with no native animation or audio. KTML and the
pages selector are Classic-only.
V2 exports pin the saved version at acceptance. If that version changes before the worker renders it, the export fails rather than exporting a different version. Read the error before explicitly requesting a new export.
Other resources
GET /v1/brandsandGET /v1/themeslist reusable styling resources.GET /v1/embed/{artifactId}retains the existing Classic embed flow. V2 embeds are not available yet.
Base URL
- All API requests target
https://api.nextdocs.io. - Use the API key that matches the workspace you are calling.