Publish and update artifacts programmatically from Claude Code, scripts, or any HTTP client. All endpoints require an API key — create one at /settings.
Pass your API key in the Authorization header on every request:
Authorization: Bearer artfly_<your-key>
API keys are shown once on creation. If you lose a key, revoke it and create a new one.
https://www.artfly.net
All endpoints below are relative to this base URL.
/api/v1/artifacts
Create a new artifact
/api/v1/artifacts/:publicId
Publish a new version of an existing artifact
/api/v1/artifacts
List your artifacts
/api/v1/artifactsRequest body (JSON)
| Field | Type | Description |
|---|---|---|
html | string * | Full HTML content. Max 10 MB. |
title | string | Title. Extracted from <title> if omitted. |
expires_in | "never" | "7d" | "30d" | Expiration window. Default: "never". |
allow_indexing | boolean | Allow search engines to index. Default: false. |
comments_enabled | boolean | Enable comments. Default: false. |
Example
curl -X POST https://www.artfly.net/api/v1/artifacts \
-H "Authorization: Bearer artfly_<your-key>" \
-H "Content-Type: application/json" \
-d '{
"html": "<!DOCTYPE html><html><body><h1>Hello</h1></body></html>",
"title": "My artifact"
}'Response (201)
{
"artifact_id": "uuid",
"public_id": "aB3kX9mNpQ",
"url": "https://www.artfly.net/a/aB3kX9mNpQ",
"title": "My artifact",
"privacy": "public"
}/api/v1/artifacts/:publicIdPublishes a new version. The artifact URL stays the same — visitors always see the latest version.
Request body (JSON)
| Field | Type | Description |
|---|---|---|
html | string * | New HTML content. Max 10 MB. |
title | string | Override title. Extracted from HTML if omitted. |
Example
curl -X PUT https://www.artfly.net/api/v1/artifacts/aB3kX9mNpQ \
-H "Authorization: Bearer artfly_<your-key>" \
-H "Content-Type: application/json" \
-d '{
"html": "<!DOCTYPE html><html><body><h1>Updated!</h1></body></html>"
}'Response (200)
{
"public_id": "aB3kX9mNpQ",
"url": "https://www.artfly.net/a/aB3kX9mNpQ",
"version_number": 2,
"title": "Updated!"
}/api/v1/artifactsQuery parameters
| Param | Default | Description |
|---|---|---|
page | 1 | Page number (1-indexed). |
per_page | 20 | Results per page. Max 50. |
Example
curl "https://www.artfly.net/api/v1/artifacts?per_page=5" \ -H "Authorization: Bearer artfly_<your-key>"
Response (200)
{
"artifacts": [
{
"id": "uuid",
"public_id": "aB3kX9mNpQ",
"title": "My artifact",
"privacy": "public",
"status": "active",
"url": "https://www.artfly.net/a/aB3kX9mNpQ",
"updated_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-15T10:00:00Z"
}
],
"page": 1,
"per_page": 5,
"total": 42
}All errors return JSON with an error object:
{ "error": { "code": "UNAUTHENTICATED", "message": "Authentication required" } }| Code | Status | Meaning |
|---|---|---|
UNAUTHENTICATED | 401 | Missing or invalid API key |
VALIDATION_ERROR | 400 | Invalid request body or parameters |
PAYLOAD_TOO_LARGE | 413 | HTML exceeds the 10 MB limit |
ARTIFACT_NOT_FOUND | 404 | No artifact with that public_id owned by you |
RATE_LIMITED | 429 | Too many requests — slow down |
Use the /artfly Claude Code skill to publish artifacts directly from your editor — no shell scripting needed. The skill handles JSON encoding, calls the API, and prints the URL.
Install the skill
.claude/commands/artfly.md inside any project where you want to use it..env.local: ARTFLY_API_KEY=artfly_<your-key>/artfly inside Claude Code — it will prompt for a file or let you paste HTML.Usage
# Publish a new artifact /artfly path/to/artifact.html # Publish a new version of an existing artifact /artfly update aB3kX9mNpQ path/to/artifact.html