Skip to main content
POST
https://genui.sh
/
api
/
artifacts
Create Artifact
curl --request POST \
  --url https://genui.sh/api/artifacts \
  --header 'Content-Type: application/json' \
  --data '
{
  "template": "<string>",
  "title": "<string>",
  "description": "<string>",
  "content": {},
  "expiresIn": "<string>",
  "metadata": {}
}
'
{
  "id": "art_abc123",
  "template": "markdown",
  "title": "My Document",
  "status": "active",
  "createdAt": "2024-01-15T12:00:00Z",
  "expiresAt": "2024-01-22T12:00:00Z"
}
Create a new artifact with the specified template and content.

Request

template
string
required
Template type. One of: markdown, chart, table, pdf
title
string
Display title for the artifact
description
string
Short description shown below the title
content
object
required
Template-specific content object. See Templates for schema details.
expiresIn
string
Expiration duration. Examples: 1h, 7d, 30d. If not set, artifact doesn’t expire.
metadata
object
Custom key-value pairs to store with the artifact

Response

id
string
Unique artifact ID (format: art_xxx)
template
string
The template type used
title
string
Display title
status
string
Artifact status: active, expired, deleted
createdAt
string
ISO 8601 timestamp
expiresAt
string
ISO 8601 expiration timestamp (if set)
{
  "id": "art_abc123",
  "template": "markdown",
  "title": "My Document",
  "status": "active",
  "createdAt": "2024-01-15T12:00:00Z",
  "expiresAt": "2024-01-22T12:00:00Z"
}

Code Examples

curl -X POST https://genui.sh/api/artifacts \
  -H "Authorization: Bearer $GENUI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "markdown",
    "title": "My Document",
    "content": {"text": "# Hello World\n\nThis is my artifact."},
    "expiresIn": "7d"
  }'