Publish a result
Publish one of your results to the Community. Its file is copied into the Community's kept folder — kept until you unpublish it, where the job it came from keeps its seven days — and an image is drawn again as a feed thumbnail; a video's or a 3D model's poster, which you draw (a frame, a view), is redrawn beside it; a WAV's waveform is read off the file. The title, the description and a shown prompt pass an automatic check: words it refuses answer 422 text_refused and nothing is published. The work is then on your profile and at its own link at once, and in the public feeds once our team approves it (mine.approval). Publishing grants the display and remix licences the Terms state, for this one work: send licence: true, and the Terms version you accepted that states them. The job must be yours, succeeded, within its seven days, not held by a report or taken down, and paid for. Takes a key holding community:write — Account offers it unticked — or the desktop's own session key. Spends nothing. While our team has paused publishing it answers 503 publishing_paused before the body is read, with our sentence for the pause when we wrote one, and nothing is published.
curl -X POST https://api.auray.ai/v1/community/publications \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}'import { createClient } from "@auray/client";
const auray = createClient(); // reads AURAY_API_KEY
const answer = await auray.platform.community.publications.publish({ jobId: "photo_docs-mtpb1vnh", licence: true, title: "A lighthouse in the fog", showPrompt: true });
console.dir(answer, { depth: null });from auray_client import Client
auray = Client() # reads AURAY_API_KEY
answer = auray.platform.community.publications.publish(job_id="photo_docs-mtpb1vnh", licence=True, title="A lighthouse in the fog", show_prompt=True)
print(answer)const res = await fetch("https://api.auray.ai/v1/community/publications", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/community/publications",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"job_id": "photo_docs-mtpb1vnh",
"licence": True,
"title": "A lighthouse in the fog",
"show_prompt": True
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/community/publications", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/community/publications");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"job_id" => "photo_docs-mtpb1vnh",
"licence" => true,
"title" => "A lighthouse in the fog",
"show_prompt" => true,
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/community/publications")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"job_id" => "photo_docs-mtpb1vnh",
"licence" => true,
"title" => "A lighthouse in the fog",
"show_prompt" => true
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/community/publications"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/community/publications");
var body = """
{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"model": {
"address": "<string>",
"id": "<string>",
"label": "<string>"
},
"attribution": "<string>",
"ai_generated": true,
"media": [
{
"role": "<string>",
"position": 123,
"url": "<string>",
"content_type": "<string>",
"width": 123,
"height": 123,
"duration_ms": 123,
"supplied": true
}
],
"author": {},
"counts": {
"likes": 123,
"views": 123,
"comments": 123,
"remixes": 123
},
"made_at": "<string>",
"published_at": "<string>",
"featured": true,
"pinned": true,
"original": true,
"remixed": true,
"liked": true,
"url": "<string>",
"description": "<string>",
"show_prompt": true,
"prompt": "<string>",
"params": {},
"remix_kind": "<string>",
"remix_of": {
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"author": {},
"url": "<string>"
},
"mine": {
"state": "<string>",
"state_reason": "<string>",
"approval": "<string>",
"approval_reason": "<string>",
"discoverable": true,
"profile_pinned": true,
"held": true,
"licence_version": "<string>",
"created_at": "<string>"
},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}Authorizations
Bearer auray_sk_… — community:write — Account offers it unticked; the desktop's session key holds it.
GET /v1/jobs/{id} reads it.true.textured first by default.remix_of. One of "recreate", "animate", "upscale", "edit".Show child attributes
"image/png", "image/jpeg", "image/webp".Published: the work as its page draws it, mine included.
"publication"."image", "video", "audio", "model3d", "project".Show child attributes
GET /v1/models lists it: the path a job is submitted to, such as auray-ai/krea-2-turbo/text-to-image. May be null.GET /v1/models lists it: the catalogue slug, such as krea2. May be null.true.Show child attributes
primary is the work as it was made; the rest are what the feeds draw: an image's thumbnail, a video's or a model's poster and thumbnail, a song's waveform (JSON: {version, peaks}). One of "primary", "poster", "preview", "thumbnail", "waveform".ai_generated does not describe it.Show child attributes
community:write was sent. May be null."recreate", "animate", "upscale", "edit", null. May be null.Show child attributes
"image", "video", "audio", "model3d", "project".Show child attributes
published is shown on the profile and at its link; hidden while a severe report is reviewed; withdrawn unpublished while a report held it; removed taken down by our team; staging while its files are copied. One of "staging", "published", "hidden", "withdrawn", "removed"."pending", "approved", "rejected".Headers:
| Header | Description |
|---|---|
RateLimit-Limit | Burst capacity. |
RateLimit-Remaining | |
RateLimit-Reset | Seconds until refill. |
X-RateLimit-Limit | |
X-RateLimit-Remaining | |
X-RateLimit-Reset | Unix seconds. The X- spelling is what client libraries read. |
X-Request-Id |
Was this page helpful?
curl -X POST https://api.auray.ai/v1/community/publications \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}'import { createClient } from "@auray/client";
const auray = createClient(); // reads AURAY_API_KEY
const answer = await auray.platform.community.publications.publish({ jobId: "photo_docs-mtpb1vnh", licence: true, title: "A lighthouse in the fog", showPrompt: true });
console.dir(answer, { depth: null });from auray_client import Client
auray = Client() # reads AURAY_API_KEY
answer = auray.platform.community.publications.publish(job_id="photo_docs-mtpb1vnh", licence=True, title="A lighthouse in the fog", show_prompt=True)
print(answer)const res = await fetch("https://api.auray.ai/v1/community/publications", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/community/publications",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"job_id": "photo_docs-mtpb1vnh",
"licence": True,
"title": "A lighthouse in the fog",
"show_prompt": True
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/community/publications", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/community/publications");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"job_id" => "photo_docs-mtpb1vnh",
"licence" => true,
"title" => "A lighthouse in the fog",
"show_prompt" => true,
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/community/publications")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"job_id" => "photo_docs-mtpb1vnh",
"licence" => true,
"title" => "A lighthouse in the fog",
"show_prompt" => true
}.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String body = """
{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/community/publications"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/community/publications");
var body = """
{
"job_id": "photo_docs-mtpb1vnh",
"licence": true,
"title": "A lighthouse in the fog",
"show_prompt": true
}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"model": {
"address": "<string>",
"id": "<string>",
"label": "<string>"
},
"attribution": "<string>",
"ai_generated": true,
"media": [
{
"role": "<string>",
"position": 123,
"url": "<string>",
"content_type": "<string>",
"width": 123,
"height": 123,
"duration_ms": 123,
"supplied": true
}
],
"author": {},
"counts": {
"likes": 123,
"views": 123,
"comments": 123,
"remixes": 123
},
"made_at": "<string>",
"published_at": "<string>",
"featured": true,
"pinned": true,
"original": true,
"remixed": true,
"liked": true,
"url": "<string>",
"description": "<string>",
"show_prompt": true,
"prompt": "<string>",
"params": {},
"remix_kind": "<string>",
"remix_of": {
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"author": {},
"url": "<string>"
},
"mine": {
"state": "<string>",
"state_reason": "<string>",
"approval": "<string>",
"approval_reason": "<string>",
"discoverable": true,
"profile_pinned": true,
"held": true,
"licence_version": "<string>",
"created_at": "<string>"
},
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}