> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tess.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish Artifact Version

> Makes one version (default: the latest) the shared version that access grants open. Who can open it is set with [Share or Unshare Artifact](/en/share-artifact).

Authenticate with a Tess API token in the `Authorization: Bearer` header. See the [Artifacts API guide](https://docs.tess.im/en/artifacts-api.md) for the full flow, permissions and ownership rules.

### **Code Examples**

```http cURL theme={null}
curl --request POST \
  --url 'https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'x-workspace-id: YOUR_WORKSPACE_ID' \
  --header 'Content-Type: application/json' \
  --data '{
    "version": 1
  }'
```

```json Node.js theme={null}
const axios = require('axios');

const config = {
  method: 'post',
  url: 'https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'x-workspace-id': 'YOUR_WORKSPACE_ID',
    'Content-Type': 'application/json'
  },
  data: {
    "version": 1
  }
};

try {
  const response = await axios(config);
  console.log(response.data);
} catch (error) {
  console.error(error);
}
```

```python Python theme={null}
import requests

url = "https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "x-workspace-id": "YOUR_WORKSPACE_ID",
    "Content-Type": "application/json"
}
payload = {
  "version": 1
}

response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
```

```php PHP theme={null}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode(["version" => 1]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer YOUR_API_KEY",
    "x-workspace-id: YOUR_WORKSPACE_ID",
    "Content-Type: application/json"
  ]
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "Error: " . $err;
} else {
  echo $response;
}
```

```java Java theme={null}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish"))
    .header("Authorization", "Bearer YOUR_API_KEY")
    .header("x-workspace-id", "YOUR_WORKSPACE_ID")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"version\": 1\n}"))
    .build();

HttpResponse<String> response = client.send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

```go Go theme={null}
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "strings"
)

func main() {
    client := &http.Client{}
    req, err := http.NewRequest("POST", "https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish", strings.NewReader(`{
  "version": 1
}`))
    if err != nil {
        fmt.Println(err)
        return
    }

    req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
    req.Header.Add("x-workspace-id", "YOUR_WORKSPACE_ID")
    req.Header.Add("Content-Type", "application/json")

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println(err)
        return
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Println(err)
        return
    }

    fmt.Println(string(body))
}
```

```jsonnet .NET theme={null}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
            client.DefaultRequestHeaders.Add("x-workspace-id", "YOUR_WORKSPACE_ID");
            var content = new StringContent(@"{
  ""version"": 1
}", Encoding.UTF8, "application/json");

            var response = await client.PostAsync("https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish", content);
            string responseBody = await response.Content.ReadAsStringAsync();
            Console.WriteLine(responseBody);
        }
    }
}
```

```ruby Ruby theme={null}
require 'uri'
require 'net/http'
require 'json'

uri = URI('https://api.tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f/publish')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
request['x-workspace-id'] = 'YOUR_WORKSPACE_ID'
request['Content-Type'] = 'application/json'
request.body = { 'version' => 1 }.to_json

response = http.request(request)
puts response.read_body
```

### **Path Parameters**

**universal\_id** `string` *required*

The artifact ID (`universal_id`), for example `artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f`.

### **Headers**

**x-workspace-id** `integer` *required*

Workspace ID. **Required as of 2026-09-01.** Until then, if omitted, the user's selected workspace is used (deprecated). After the cutoff, a missing header returns **422**.

### **Request Body**

**version** `integer`

Version to share (minimum 1). Defaults to the latest version.

### **Response**

**200**

```json theme={null}
{
  "universal_id": "artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f",
  "title": "Weekly pipeline (final)",
  "status": "active",
  "head_version": 2,
  "shared_version": 1,
  "latest_version_is_shared": false,
  "summary": "Latest version is v2. People with access see v1; v2 is not shared yet.",
  "viewer_url": "https://tess.im/artifacts/artifact_5d1f0c2e-8a3b-4c6d-9e7f-1a2b3c4d5e6f"
}
```

### **Response fields**

**status** `string`

`active` while a version is shared.

**head\_version** `integer`

Latest version number.

**shared\_version** `integer | null`

Version people with access see.

**latest\_version\_is\_shared** `boolean`

Whether the shared version is the latest one.

**summary** `string`

Readable summary of what is shared.

**viewer\_url** `string`

Link that opens the artifact in Tess.

### **Errors**

| Status | Meaning |
| - | - |
| `401` | Missing or invalid API token. |
| `403` | `ARTIFACT_EDIT_FORBIDDEN` (you are not the owner), or `ARTIFACT_PUBLICATION_REVOKED`: a manager unpublished the artifact and the owner cannot publish it again. |
| `404` | `ARTIFACT_NOT_FOUND` or `ARTIFACT_VERSION_NOT_FOUND`. |
| `422` | Validation error. |
| `429` | Too many requests. Retry after a short wait. |


## OpenAPI

````yaml api-reference/tess-public-api.openapi.json POST /artifacts/{universal_id}/publish
openapi: 3.0.0
info:
  title: Tess API
  version: '0.1'
servers:
  - url: https://api.tess.im
security: []
paths:
  /artifacts/{universal_id}/publish:
    post:
      tags:
        - Artifacts
      summary: Publish an artifact version
      description: >-
        Makes one version (default: the head) the shared version that grants
        open. Who can open it is set with the share endpoint.
      operationId: 37e088a4b5245778fe3ce39697aa83fd
      parameters:
        - name: universal_id
          in: path
          required: true
          schema:
            type: string
        - name: x-workspace-id
          in: header
          description: >-
            Workspace id. If not provided, the user's selected workspace is
            used.
          required: false
          schema:
            type: integer
      requestBody:
        required: false
        content:
          application/json:
            schema:
              properties:
                version:
                  type: integer
                  minimum: 1
                  nullable: true
              type: object
      responses:
        '200':
          description: Published
          content:
            application/json:
              schema:
                properties:
                  universal_id:
                    type: string
                  title:
                    type: string
                  status:
                    type: string
                  head_version:
                    type: integer
                  shared_version:
                    type: integer
                  viewer_url:
                    type: string
                type: object
        '403':
          description: >-
            ARTIFACT_EDIT_FORBIDDEN (the caller can read the artifact but is not
            its owner), or ARTIFACT_PUBLICATION_REVOKED: the publication was
            revoked by a manager or by deleting the artifact and cannot be
            published again
        '404':
          description: ARTIFACT_NOT_FOUND or ARTIFACT_VERSION_NOT_FOUND
        '422':
          description: Validation error
        '429':
          description: Too many requests
      security:
        - token: []
components:
  securitySchemes:
    token:
      type: http
      bearerFormat: Bearer
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.