Skip to main content
POST
https://genui.sh
/
api
/
artifacts
/
share
Create and Share
curl --request POST \
  --url https://genui.sh/api/artifacts/share \
  --header 'Content-Type: application/json' \
  --data '
{
  "template": "<string>",
  "title": "<string>",
  "content": {},
  "expiresIn": "<string>",
  "allowDownload": true,
  "metadata": {}
}
'
{
  "id": "art_abc123",
  "template": "markdown",
  "title": "Quick Note",
  "status": "active",
  "url": "https://genui.sh/a/art_abc123?token=eyJhbGc...",
  "expiresAt": "2024-01-22T12:00:00Z",
  "createdAt": "2024-01-15T12:00:00Z"
}
Create an artifact and immediately generate a share URL in a single request. This is the most efficient way to create shareable content.

Request

template
string
required
Template type: markdown, chart, table, pdf
title
string
Display title for the artifact
content
object
required
Template-specific content object
expiresIn
string
Expiration for both artifact and share link. Default: 7d
allowDownload
boolean
Allow viewers to download (PDF only). Default: false
metadata
object
Custom metadata key-value pairs

Response

id
string
The artifact ID
url
string
The shareable URL (ready to use immediately)
expiresAt
string
ISO 8601 expiration timestamp
{
  "id": "art_abc123",
  "template": "markdown",
  "title": "Quick Note",
  "status": "active",
  "url": "https://genui.sh/a/art_abc123?token=eyJhbGc...",
  "expiresAt": "2024-01-22T12:00:00Z",
  "createdAt": "2024-01-15T12:00:00Z"
}

Code Examples

curl -X POST https://genui.sh/api/artifacts/share \
  -H "Authorization: Bearer $GENUI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "markdown",
    "title": "Quick Note",
    "content": {"text": "# Important Update\n\nHere is the information you requested."},
    "expiresIn": "24h"
  }'

Use Cases

This endpoint is ideal for:
  • AI agents that need to share results immediately
  • Automation workflows that generate and distribute content
  • One-off sharing without needing to manage artifact IDs
  • Ephemeral content that should auto-expire

Comparison with Separate Calls

ApproachAPI CallsUse Case
Create + Share2Need artifact ID for future updates
Create and Share1One-shot content sharing