Artifacts
Artifact CRUD and AI generation.
List artifacts
Returns a paginated list of the user's artifacts.
Authorization
AuthorizationRequiredBearer <token>NextDocs API key (nxd_xxx format)
In: header
Query Parameters
limitintegerNumber of items to return (1-20).
20Minimum: 1Maximum: 20afterstringCursor for pagination. Pass the ID of the last item from the previous page.
org_idstringOrganization ID returned by organizations.list. Omit for personal scope.
1Response Body
A paginated list of resources.
TypeScript Definitions
Use the response body type in TypeScript.
objectRequiredstring"list"dataRequiredarray<object>has_moreRequiredbooleanWhether there are more items after this page.
Authentication required or API key is invalid.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectcurl -X GET "https://api.nextdocs.io/v1/artifacts?limit=20&after=clxyz123...&org_id=org_2abc123" \
-H "Authorization: Bearer <token>"fetch("https://api.nextdocs.io/v1/artifacts?limit=20&after=clxyz123...&org_id=org_2abc123", {
headers: {
"Authorization": "Bearer <token>"
}
})package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.nextdocs.io/v1/artifacts?limit=20&after=clxyz123...&org_id=org_2abc123"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://api.nextdocs.io/v1/artifacts?limit=20&after=clxyz123...&org_id=org_2abc123"
response = requests.request("GET", url, headers = {
"Authorization": "Bearer <token>"
})
print(response.text){
"object": "list",
"data": [
{
"id": "doc_abc123",
"brand_id": null,
"created_at": "2026-01-15T10:30:00.000Z",
"name": "Q2 Pitch Deck",
"object": "artifact",
"page_count": 12,
"status": "ready",
"variations": [
{
"id": "doc_abc123",
"status": "generating",
"url": "https://app.nextdocs.io/document/doc_abc123"
}
],
"theme_id": null,
"type": "presentation",
"updated_at": "2026-04-01T08:00:00.000Z",
"url": "https://app.nextdocs.io/document/doc_abc123"
}
],
"has_more": false
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}Create an artifact
Synchronously creates a canvas artifact via AI generation. Waits for completion and returns the ready artifact with a url field linking to the NextDocs editor. Supported types: presentation, document, social, image. Pass attachments to guide visual style with up to 10 image attachments. Best for small artifacts (1-3 pages). For larger artifacts or latency-sensitive callers, use artifacts.create_async.
Authorization
AuthorizationRequiredBearer <token>NextDocs API key (nxd_xxx format)
In: header
Request Body
application/jsonOptionalbrand_idstringBrand kit ID to apply.
attachmentsarray<object>Image attachments that guide composition, density, hierarchy, palette, and spacing during generation. Each item must include exactly one of url or asset_id. Max 10 attachments.
instructionRequiredstringAI generation instruction.
1Maximum length: 10000num_pagesintegerNumber of pages to generate. Synchronous artifact creation supports up to 50 pages. Use the async endpoint for larger artifacts.
1Maximum: 50theme_idstringTheme ID to apply. When omitted, the API auto-generates appearance variants.
namestringOptional artifact name.
1Maximum length: 500modelstringModel to use. Preset modes: 'fast' (speed), 'quality' (balanced), or 'premium' (top-tier β requires Pro+ or higher; lower tiers silently fall back to quality). Or pass a specific AI gateway model ID (e.g. 'anthropic/claude-opus-4.7') for a custom pick. Defaults to 'fast'.
org_idstringOrganization ID returned by organizations.list. Omit for personal scope.
1num_copiesintegerSynchronous artifact creation only supports a single design variation. Use the async endpoint for multiple copies.
1Minimum: 1Maximum: 1template_idstringTemplate to base the generation on. The template's structure and theme guide the AI.
typeRequiredstringArtifact type to generate. Supported values: presentation, document, social, image.
"presentation" | "document" | "social" | "image"Response Body
Resource created successfully.
idRequiredstringbrand_idRequiredstring | null | nullcreated_atRequiredstringnameRequiredstringobjectRequiredstring"artifact"page_countRequirednumber | null | nullstatusRequiredstring"generating" | "ready" | "failed"variationsarray<object>All design variations generated when num_copies > 1, including this primary artifact as the first entry. Each is a separate artifact β poll artifacts.get(id) on each to track readiness. Omitted when a single copy was requested.
@minItems 0
@minItems 0
@minItems 0
@minItems 0
theme_idRequiredstring | null | nullEffective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.
typeRequiredstringupdated_atRequiredstringurlRequiredstring | null | nullDirect link to view and edit the artifact in NextDocs. Open this URL in a browser to access the editor.
Request validation failed.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectAuthentication required or API key is invalid.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectThe requested resource was not found.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectRate limit or usage quota exceeded.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectcurl -X POST "https://api.nextdocs.io/v1/artifacts" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
}'const body = JSON.stringify({
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
})
fetch("https://api.nextdocs.io/v1/artifacts", {
headers: {
"Authorization": "Bearer <token>"
},
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.nextdocs.io/v1/artifacts"
body := strings.NewReader(`{
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://api.nextdocs.io/v1/artifacts"
body = {
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
}
response = requests.request("POST", url, json = body, headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
})
print(response.text){
"id": "doc_abc123",
"brand_id": null,
"created_at": "2026-01-15T10:30:00.000Z",
"name": "Q2 Pitch Deck",
"object": "artifact",
"page_count": 12,
"status": "ready",
"variations": [
{
"id": "doc_abc123",
"status": "generating",
"url": "https://app.nextdocs.io/document/doc_abc123"
}
],
"theme_id": null,
"type": "presentation",
"updated_at": "2026-04-01T08:00:00.000Z",
"url": "https://app.nextdocs.io/document/doc_abc123"
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}Get an artifact
Returns a single artifact by ID, including page count and metadata.
Authorization
AuthorizationRequiredBearer <token>NextDocs API key (nxd_xxx format)
In: header
Path Parameters
idRequiredstringArtifact ID
Response Body
The requested resource.
idRequiredstringbrand_idRequiredstring | null | nullcreated_atRequiredstringnameRequiredstringobjectRequiredstring"artifact"page_countRequirednumber | null | nullstatusRequiredstring"generating" | "ready" | "failed"variationsarray<object>All design variations generated when num_copies > 1, including this primary artifact as the first entry. Each is a separate artifact β poll artifacts.get(id) on each to track readiness. Omitted when a single copy was requested.
@minItems 0
@minItems 0
@minItems 0
@minItems 0
theme_idRequiredstring | null | nullEffective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.
typeRequiredstringupdated_atRequiredstringurlRequiredstring | null | nullDirect link to view and edit the artifact in NextDocs. Open this URL in a browser to access the editor.
Authentication required or API key is invalid.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectThe requested resource was not found.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectcurl -X GET "https://api.nextdocs.io/v1/artifacts/doc_abc123" \
-H "Authorization: Bearer <token>"fetch("https://api.nextdocs.io/v1/artifacts/doc_abc123", {
headers: {
"Authorization": "Bearer <token>"
}
})package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.nextdocs.io/v1/artifacts/doc_abc123"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://api.nextdocs.io/v1/artifacts/doc_abc123"
response = requests.request("GET", url, headers = {
"Authorization": "Bearer <token>"
})
print(response.text){
"id": "doc_abc123",
"brand_id": null,
"created_at": "2026-01-15T10:30:00.000Z",
"name": "Q2 Pitch Deck",
"object": "artifact",
"page_count": 12,
"status": "ready",
"variations": [
{
"id": "doc_abc123",
"status": "generating",
"url": "https://app.nextdocs.io/document/doc_abc123"
}
],
"theme_id": null,
"type": "presentation",
"updated_at": "2026-04-01T08:00:00.000Z",
"url": "https://app.nextdocs.io/document/doc_abc123"
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}Update an artifact
Partially updates an artifact. Currently supports renaming.
Authorization
AuthorizationRequiredBearer <token>NextDocs API key (nxd_xxx format)
In: header
Request Body
application/jsonOptionalnamestringArtifact name.
1Maximum length: 500Path Parameters
idRequiredstringArtifact ID
Response Body
Resource updated successfully.
idRequiredstringbrand_idRequiredstring | null | nullcreated_atRequiredstringnameRequiredstringobjectRequiredstring"artifact"page_countRequirednumber | null | nullstatusRequiredstring"generating" | "ready" | "failed"variationsarray<object>All design variations generated when num_copies > 1, including this primary artifact as the first entry. Each is a separate artifact β poll artifacts.get(id) on each to track readiness. Omitted when a single copy was requested.
@minItems 0
@minItems 0
@minItems 0
@minItems 0
theme_idRequiredstring | null | nullEffective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.
typeRequiredstringupdated_atRequiredstringurlRequiredstring | null | nullDirect link to view and edit the artifact in NextDocs. Open this URL in a browser to access the editor.
Request validation failed.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectAuthentication required or API key is invalid.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectThe requested resource was not found.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectRate limit or usage quota exceeded.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectcurl -X PATCH "https://api.nextdocs.io/v1/artifacts/doc_abc123" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Q2 Pitch Deck v2"
}'const body = JSON.stringify({
"name": "Q2 Pitch Deck v2"
})
fetch("https://api.nextdocs.io/v1/artifacts/doc_abc123", {
headers: {
"Authorization": "Bearer <token>"
},
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.nextdocs.io/v1/artifacts/doc_abc123"
body := strings.NewReader(`{
"name": "Q2 Pitch Deck v2"
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://api.nextdocs.io/v1/artifacts/doc_abc123"
body = {
"name": "Q2 Pitch Deck v2"
}
response = requests.request("PATCH", url, json = body, headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
})
print(response.text){
"id": "doc_abc123",
"brand_id": null,
"created_at": "2026-01-15T10:30:00.000Z",
"name": "Q2 Pitch Deck",
"object": "artifact",
"page_count": 12,
"status": "ready",
"variations": [
{
"id": "doc_abc123",
"status": "generating",
"url": "https://app.nextdocs.io/document/doc_abc123"
}
],
"theme_id": null,
"type": "presentation",
"updated_at": "2026-04-01T08:00:00.000Z",
"url": "https://app.nextdocs.io/document/doc_abc123"
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}Delete an artifact
Permanently deletes an artifact.
Authorization
AuthorizationRequiredBearer <token>NextDocs API key (nxd_xxx format)
In: header
Path Parameters
idRequiredstringArtifact ID
Response Body
Resource deleted.
Authentication required or API key is invalid.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectThe requested resource was not found.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectRequest conflicts with the current state of the resource.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectcurl -X DELETE "https://api.nextdocs.io/v1/artifacts/doc_abc123" \
-H "Authorization: Bearer <token>"fetch("https://api.nextdocs.io/v1/artifacts/doc_abc123", {
headers: {
"Authorization": "Bearer <token>"
}
})package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.nextdocs.io/v1/artifacts/doc_abc123"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://api.nextdocs.io/v1/artifacts/doc_abc123"
response = requests.request("DELETE", url, headers = {
"Authorization": "Bearer <token>"
})
print(response.text){
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}Create an artifact asynchronously
Asynchronously queues canvas artifact generation. Returns immediately with status="generating". Poll artifacts.get(id) until status is "ready" or "failed". Supported types: presentation, document, social, image. Supports attachments and multiple design variations via num_copies. When num_copies > 1 the response includes a variations array of separate artifacts (poll each); present them to the user as options A/B/C/D. Use this for 4+ page artifacts or when the calling environment has tool-call timeouts (e.g. mobile chat).
Authorization
AuthorizationRequiredBearer <token>NextDocs API key (nxd_xxx format)
In: header
Request Body
application/jsonOptionalbrand_idstringBrand kit ID to apply.
attachmentsarray<object>Image attachments that guide composition, density, hierarchy, palette, and spacing during generation. Each item must include exactly one of url or asset_id. Max 10 attachments.
instructionRequiredstringAI generation instruction.
1Maximum length: 10000num_pagesintegerNumber of pages to generate. Async generation supports up to 92 pages.
1Maximum: 92theme_idstringTheme ID to apply. When omitted, the API auto-generates appearance variants.
namestringOptional artifact name.
1Maximum length: 500modelstringModel to use. Preset modes: 'fast' (speed), 'quality' (balanced), or 'premium' (top-tier β requires Pro+ or higher; lower tiers silently fall back to quality). Or pass a specific AI gateway model ID (e.g. 'anthropic/claude-opus-4.7') for a custom pick. Defaults to 'fast'.
org_idstringOrganization ID returned by organizations.list. Omit for personal scope.
1num_copiesintegerNumber of design variations to generate (1-4). Each variation uses the same prompt but produces different layouts.
1Minimum: 1Maximum: 4template_idstringTemplate to base the generation on. The template's structure and theme guide the AI.
typeRequiredstringArtifact type to generate. Supported values: presentation, document, social, image.
"presentation" | "document" | "social" | "image"Response Body
Resource queued for asynchronous processing. The response contains the resource with a non-terminal status (e.g. "generating", "processing") β poll the resource via its .get endpoint until status reaches a terminal value.
idRequiredstringbrand_idRequiredstring | null | nullcreated_atRequiredstringnameRequiredstringobjectRequiredstring"artifact"page_countRequirednumber | null | nullstatusRequiredstring"generating" | "ready" | "failed"variationsarray<object>All design variations generated when num_copies > 1, including this primary artifact as the first entry. Each is a separate artifact β poll artifacts.get(id) on each to track readiness. Omitted when a single copy was requested.
@minItems 0
@minItems 0
@minItems 0
@minItems 0
theme_idRequiredstring | null | nullEffective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.
typeRequiredstringupdated_atRequiredstringurlRequiredstring | null | nullDirect link to view and edit the artifact in NextDocs. Open this URL in a browser to access the editor.
Request validation failed.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectAuthentication required or API key is invalid.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectThe requested resource was not found.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectRate limit or usage quota exceeded.
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectcurl -X POST "https://api.nextdocs.io/v1/artifacts/async" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
}'const body = JSON.stringify({
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
})
fetch("https://api.nextdocs.io/v1/artifacts/async", {
headers: {
"Authorization": "Bearer <token>"
},
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.nextdocs.io/v1/artifacts/async"
body := strings.NewReader(`{
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://api.nextdocs.io/v1/artifacts/async"
body = {
"brand_id": "brand_abc123",
"attachments": [
{
"name": "Chronicle board deck cover",
"prompt": "Use this as layout and visual-density guidance, not as copied content.",
"url": "https://example.com/attachment-page-1.png"
},
{
"asset_id": "asset_abc123",
"name": "Investor section style",
"prompt": "Match the editorial spacing and muted hierarchy."
}
],
"instruction": "Create a pitch deck for a SaaS startup raising Series A.",
"num_pages": 12,
"theme_id": "paperWhite",
"name": "MCP Integration Test Deck",
"model": "fast",
"org_id": "org_2abc123",
"num_copies": 1,
"template_id": "tmpl_abc123",
"type": "presentation"
}
response = requests.request("POST", url, json = body, headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
})
print(response.text){
"id": "doc_abc123",
"brand_id": null,
"created_at": "2026-01-15T10:30:00.000Z",
"name": "Q2 Pitch Deck",
"object": "artifact",
"page_count": 12,
"status": "ready",
"variations": [
{
"id": "doc_abc123",
"status": "generating",
"url": "https://app.nextdocs.io/document/doc_abc123"
}
],
"theme_id": null,
"type": "presentation",
"updated_at": "2026-04-01T08:00:00.000Z",
"url": "https://app.nextdocs.io/document/doc_abc123"
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
}
}