---
title: "Publish task files as an artifact revision [write]"
method: POST
path: "/artifacts"
tags: ["artifacts"]
---

# Publish task files as an artifact revision \[write\]

`POST /artifacts`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/artifacts`
- Auth: HTTP bearer

Publishes paths from the task's file space (`/tasks/{id}/files`) as a new revision of the artifact with that name in the task, creating the artifact on first use. A path that names a folder publishes everything under it. The revision records each file's content at this moment; later edits to the task's files do not change it. `entry` defaults to the only file, or to an `index.html`. 400 when a path names nothing; at most 500 files.

## Request body

- object
  - `task_id` string, required
  - `name` string, required
  - `paths` string[], required
  - `entry` string

## Response `201`

Created

- object
  - `artifact` Artifact, required
    - `id` string, required
    - `task_id` string, required: The task it belongs to (sess_…)
    - `name` string, required: Unique within the task; publishing under the same name adds a version
    - `kind` 'design_system' | 'null', nullable, required: design_system when the current revision holds project/design-system.json; null otherwise
    - `version` integer, required: The current revision
    - `entry` string, required: The file opened first
    - `files` object[], required
      - `path` string, required
      - `sha256` string, required
      - `size_bytes` integer, required
    - `share_url` string, nullable, required: The public link, or null while not shared
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 2 info
  - added the optional property `error/request_id` to the response with the `default` status
  - added the required property `artifact/kind` to the response with the `201` status

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/artifacts/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
