---
title: "Create an artifact"
method: POST
path: "/api/v1/artifacts"
tags: ["Artifacts"]
---

# Create an artifact

`POST /api/v1/artifacts`

## Request

- Base URL: `https://your-deployment.example.com`
- URL: `https://your-deployment.example.com/api/v1/artifacts`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Creates a private artifact at version 1. `session_id` files it under a session you can edit, and `project_id` under a project you can read. Unknown body fields are rejected.

## Request body

- CreateArtifactRequest
  - `type` 'mermaid' | 'recharts' | 'chess' | 'python' | 'react' | 'html' | 'svg' | 'code' | 'quest' | 'file' | 'questmaster' | 'lattice' | 'blog-draft', required
  - `title` string, required
  - `content` string, required
  - `description` string
  - `session_id` string: A session you can edit, to file the artifact under.
  - `project_id` string: A project you can read, to file the artifact under.
  - `tags` string[]

## Response `201`

The new artifact.

- CreateArtifactResponse201
  - `id` string, required
  - `type` 'mermaid' | 'recharts' | 'chess' | 'python' | 'react' | 'html' | 'svg' | 'code' | 'quest' | 'file' | 'questmaster' | 'lattice' | 'blog-draft', required
  - `title` string, required
  - `description` string, nullable, required
  - `version` integer, required: The current version. Starts at 1; each content change adds one.
  - `version_tag` string, nullable, required
  - `status` 'draft' | 'review' | 'published' | 'archived', required
  - `tags` string[], required
  - `session_id` string, nullable, required
  - `project_id` string, nullable, required
  - `visibility` 'private' | 'project' | 'organization' | 'public', required
  - `created_at` string, required: ISO 8601 timestamp.
  - `updated_at` string, required: ISO 8601 timestamp.
  - `content` string, nullable, required: The current version's content. `null` in a list (fetch the artifact by id for it), and in an update response to a caller who may edit the artifact but not read it, unless that update sent content.

## Other responses

- `401`: Missing or invalid credentials.
- `403`: The API key lacks `notebooks:write`.
- `404`: The `session_id` or `project_id` does not exist or is not yours to file under.
- `405`: The path does not serve this HTTP method.
- `422`: Request body failed validation.
- `429`: Per-user rate limit exceeded.

---

[API](https://skmtc.dev/bike4mind/apis/bike4mind-api.md) · [All operations](https://skmtc.dev/bike4mind/apis/bike4mind-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bike4mind/apis/bike4mind-api/revisions/db47495b892f?raw)
