Artifacts

Artifact CRUD and AI generation.

List artifacts

Returns a paginated list of the user's artifacts.

GET
/v1/artifacts

Authorization

AuthorizationRequiredBearer <token>

NextDocs API key (nxd_xxx format)

In: header

Query Parameters

limitinteger

Number of items to return (1-20).

Default: 20Minimum: 1Maximum: 20
afterstring

Cursor for pagination. Pass the ID of the last item from the previous page.

org_idstring

Organization ID returned by organizations.list. Omit for personal scope.

Minimum length: 1

Response Body

A paginated list of resources.

TypeScript Definitions

Use the response body type in TypeScript.

objectRequiredstring
Value in: "list"
dataRequiredarray<object>
has_moreRequiredboolean

Whether there are more items after this page.

Authentication required or API key is invalid.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -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.

POST
/v1/artifacts

Authorization

AuthorizationRequiredBearer <token>

NextDocs API key (nxd_xxx format)

In: header

Request Body

application/jsonOptional
brand_idstring

Brand 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.

instructionRequiredstring

AI generation instruction.

Minimum length: 1Maximum length: 10000
num_pagesinteger

Number of pages to generate. Synchronous artifact creation supports up to 50 pages. Use the async endpoint for larger artifacts.

Minimum: 1Maximum: 50
theme_idstring

Theme ID to apply. When omitted, the API auto-generates appearance variants.

namestring

Optional artifact name.

Minimum length: 1Maximum length: 500
modelstring

Model 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_idstring

Organization ID returned by organizations.list. Omit for personal scope.

Minimum length: 1
num_copiesinteger

Synchronous artifact creation only supports a single design variation. Use the async endpoint for multiple copies.

Default: 1Minimum: 1Maximum: 1
template_idstring

Template to base the generation on. The template's structure and theme guide the AI.

typeRequiredstring

Artifact type to generate. Supported values: presentation, document, social, image.

Value in: "presentation" | "document" | "social" | "image"

Response Body

Resource created successfully.

idRequiredstring
brand_idRequiredstring | null | null
created_atRequiredstring
nameRequiredstring
objectRequiredstring
Value in: "artifact"
page_countRequirednumber | null | null
statusRequiredstring
Value in: "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 | null

Effective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.

typeRequiredstring
updated_atRequiredstring
urlRequiredstring | null | null

Direct 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.

errorRequiredobject

Authentication required or API key is invalid.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

The requested resource was not found.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Rate limit or usage quota exceeded.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -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.

GET
/v1/artifacts/{id}

Authorization

AuthorizationRequiredBearer <token>

NextDocs API key (nxd_xxx format)

In: header

Path Parameters

idRequiredstring

Artifact ID

Response Body

The requested resource.

idRequiredstring
brand_idRequiredstring | null | null
created_atRequiredstring
nameRequiredstring
objectRequiredstring
Value in: "artifact"
page_countRequirednumber | null | null
statusRequiredstring
Value in: "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 | null

Effective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.

typeRequiredstring
updated_atRequiredstring
urlRequiredstring | null | null

Direct 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.

errorRequiredobject

The requested resource was not found.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -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.

PATCH
/v1/artifacts/{id}

Authorization

AuthorizationRequiredBearer <token>

NextDocs API key (nxd_xxx format)

In: header

Request Body

application/jsonOptional
namestring

Artifact name.

Minimum length: 1Maximum length: 500

Path Parameters

idRequiredstring

Artifact ID

Response Body

Resource updated successfully.

idRequiredstring
brand_idRequiredstring | null | null
created_atRequiredstring
nameRequiredstring
objectRequiredstring
Value in: "artifact"
page_countRequirednumber | null | null
statusRequiredstring
Value in: "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 | null

Effective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.

typeRequiredstring
updated_atRequiredstring
urlRequiredstring | null | null

Direct 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.

errorRequiredobject

Authentication required or API key is invalid.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

The requested resource was not found.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Rate limit or usage quota exceeded.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -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.

DELETE
/v1/artifacts/{id}

Authorization

AuthorizationRequiredBearer <token>

NextDocs API key (nxd_xxx format)

In: header

Path Parameters

idRequiredstring

Artifact ID

Response Body

Resource deleted.

Authentication required or API key is invalid.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

The requested resource was not found.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Request conflicts with the current state of the resource.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -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)
Empty
{
  "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).

POST
/v1/artifacts/async

Authorization

AuthorizationRequiredBearer <token>

NextDocs API key (nxd_xxx format)

In: header

Request Body

application/jsonOptional
brand_idstring

Brand 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.

instructionRequiredstring

AI generation instruction.

Minimum length: 1Maximum length: 10000
num_pagesinteger

Number of pages to generate. Async generation supports up to 92 pages.

Minimum: 1Maximum: 92
theme_idstring

Theme ID to apply. When omitted, the API auto-generates appearance variants.

namestring

Optional artifact name.

Minimum length: 1Maximum length: 500
modelstring

Model 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_idstring

Organization ID returned by organizations.list. Omit for personal scope.

Minimum length: 1
num_copiesinteger

Number of design variations to generate (1-4). Each variation uses the same prompt but produces different layouts.

Default: 1Minimum: 1Maximum: 4
template_idstring

Template to base the generation on. The template's structure and theme guide the AI.

typeRequiredstring

Artifact type to generate. Supported values: presentation, document, social, image.

Value in: "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.

idRequiredstring
brand_idRequiredstring | null | null
created_atRequiredstring
nameRequiredstring
objectRequiredstring
Value in: "artifact"
page_countRequirednumber | null | null
statusRequiredstring
Value in: "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 | null

Effective theme ID for the artifact. This is the explicitly requested theme when provided, otherwise the linked brand theme when one was applied.

typeRequiredstring
updated_atRequiredstring
urlRequiredstring | null | null

Direct 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.

errorRequiredobject

Authentication required or API key is invalid.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

The requested resource was not found.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Rate limit or usage quota exceeded.

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -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."
  }
}