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 type: markdown, chart, table, pdf
Display title for the artifact
Template-specific content object
Expiration for both artifact and share link. Default: 7d
Allow viewers to download (PDF only). Default: false
Custom metadata key-value pairs
Response
The shareable URL (ready to use immediately)
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
| Approach | API Calls | Use Case |
|---|
| Create + Share | 2 | Need artifact ID for future updates |
| Create and Share | 1 | One-shot content sharing |