Create a new artifact with the specified template and content.
Request
Template type. One of: markdown, chart, table, pdf
Display title for the artifact
Short description shown below the title
Template-specific content object. See Templates for schema details.
Expiration duration. Examples: 1h, 7d, 30d. If not set, artifact doesn’t expire.
Custom key-value pairs to store with the artifact
Response
Unique artifact ID (format: art_xxx)
Artifact status: active, expired, deleted
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"
}'