Start here
Publish a project to the Community
/v1/studio/projects/{project}/publicationon https://api.auray.ai/v1Publish the project to the Community, or publish it again as it is now: a SNAPSHOT of the folders and items named — never what is in the Trash or not ready — copied into the Community, with the can…
Publish the project to the Community, or publish it again as it is now: a SNAPSHOT of the folders and items named — never what is in the Trash or not ready — copied into the Community, with the canvases named while show_canvas is on, only ever as a reader may see them. It is published under the owner's public profile, so only the project's owner may, with the licence ticked as for a single work and a Terms version that states it. Every word a stranger would read — title, description, the items' names, shown prompts and canvases — passes the automatic check first. On its page and the owner's profile once its files are copied (copying says how far); in the public feeds only once our team approves it. Publishing again copies beside the live snapshot and replaces it when done, back in our team's queue. A request copies what it has time for and the rest is finished in the background. Takes a key holding studio:write — Account offers it unticked — or the desktop's own session key. Spends nothing.
#Authentication
Authorization: Bearer auray_sk_… — a key with the scope the route names.
#Request
#Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | yes |
#Body
application/json, required.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
folders | string[] | yes | — | Whole folders: all, generations, uploads, or a member's folder by its id. |
items | string[] | yes | — | Single items besides. |
canvases | string[] | no | — | The canvases shown while show_canvas is on. |
show_prompts | boolean | no | true | Show each asset's prompt and the canvases' prompts. |
show_canvas | boolean | no | false | Show the canvases named in canvases, read-only. |
discoverable | boolean | no | true | Let it into the public feeds and search once approved. |
show_spend | boolean | no | false | Ask for its info card to say what its generations cost. Kept, and shown nowhere for now: a published work's cost is not shown. |
title | string | yes | — | 0 to 100 characters. |
description | string | no | — | 0 to 2000 characters. May be null. |
category | string | yes | — | One of "film", "short", "series", "trailer", "commercial", "music_video", "animation", "documentary", "fashion", "game", "worldbuilding", "experimental", "other". |
cover_item_id | string | no | — | A picture or a clip of the snapshot as its cover; left out, the project's own. May be null. |
licence | boolean | yes | — | Publishing grants the display and remix licences the Terms state, for this project. One of true. |
terms_version | string | no | — | The Terms version you accepted that states what publishing a project grants and shows. Defaults to the current one. |
#Example request
curl -X POST https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"folders": [
"all"
],
"items": [],
"canvases": [],
"title": "Night harbour",
"description": "A short about a lighthouse keeper.",
"category": "short",
"show_prompts": true,
"show_canvas": false,
"discoverable": true,
"show_spend": false,
"licence": true
}'const res = await fetch("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"folders": [
"all"
],
"items": [],
"canvases": [],
"title": "Night harbour",
"description": "A short about a lighthouse keeper.",
"category": "short",
"show_prompts": true,
"show_canvas": false,
"discoverable": true,
"show_spend": false,
"licence": true
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"folders": [
"all"
],
"items": [],
"canvases": [],
"title": "Night harbour",
"description": "A short about a lighthouse keeper.",
"category": "short",
"show_prompts": True,
"show_canvas": False,
"discoverable": True,
"show_spend": False,
"licence": True
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"folders": [
"all"
],
"items": [],
"canvases": [],
"title": "Night harbour",
"description": "A short about a lighthouse keeper.",
"category": "short",
"show_prompts": true,
"show_canvas": false,
"discoverable": true,
"show_spend": false,
"licence": true
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication", 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/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication");
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([
"folders" => [
"all",
],
"items" => [],
"canvases" => [],
"title" => "Night harbour",
"description" => "A short about a lighthouse keeper.",
"category" => "short",
"show_prompts" => true,
"show_canvas" => false,
"discoverable" => true,
"show_spend" => false,
"licence" => 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/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"folders" => [
"all"
],
"items" => [],
"canvases" => [],
"title" => "Night harbour",
"description" => "A short about a lighthouse keeper.",
"category" => "short",
"show_prompts" => true,
"show_canvas" => false,
"discoverable" => true,
"show_spend" => false,
"licence" => 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 = """
{
"folders": [
"all"
],
"items": [],
"canvases": [],
"title": "Night harbour",
"description": "A short about a lighthouse keeper.",
"category": "short",
"show_prompts": true,
"show_canvas": false,
"discoverable": true,
"show_spend": false,
"licence": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication"))
.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/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/publication");
var body = """
{
"folders": [
"all"
],
"items": [],
"canvases": [],
"title": "Night harbour",
"description": "A short about a lighthouse keeper.",
"category": "short",
"show_prompts": true,
"show_canvas": false,
"discoverable": true,
"show_spend": false,
"licence": 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()}");#Responses
#201 Created
Created.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
object | string | yes | — | One of "project_publication". |
project_id | string | yes | — | |
publication_id | string | yes | — | The Community work it is: GET /community/publications/{id}. |
url | string | yes | — | Its page under its author's profile on auray.ai. A URL. |
title | string | yes | — | 0 to 100 characters. |
description | string | yes | — | 0 to 2000 characters. May be null. |
category | string | yes | — | One of "film", "short", "series", "trailer", "commercial", "music_video", "animation", "documentary", "fashion", "game", "worldbuilding", "experimental", "other". |
toggles | object | yes | — | What a publication shows. Hiding prompts or canvases deletes them from it; showing them again is a new snapshot. |
toggles.show_prompts | boolean | yes | — | Each asset's prompt, and the canvases' prompts, are shown. |
toggles.show_canvas | boolean | yes | — | The canvases chosen are shown, read-only — only ever as a reader may see them. |
toggles.discoverable | boolean | yes | — | It may enter the public feeds and search once our team approves it. |
toggles.show_spend | boolean | yes | — | Its author asked for the info card to say what its generations cost; no public answer says it for now. |
selection | object | yes | — | What the live snapshot was made from, in the project's own ids. |
selection.folders | string[] | yes | — | |
selection.items | string[] | yes | — | |
selection.canvases | string[] | yes | — | |
items | integer | yes | — | How many assets the live snapshot shows. 0 to …. |
mine | boolean | yes | — | The caller is the publication's author. Only its author changes or unpublishes it, and only its author is told its moderation standing — after an ownership transfer that may be the former owner. |
standing | null or object | yes | — | Where it stands in the Community and why — answered to its author alone; null for every other member. |
fingerprint | string | yes | — | What the live snapshot was made from, as changed compares it. |
changed | boolean | yes | — | The project changed since inside what was published: publishing again makes a new snapshot. |
copying | null or object | yes | — | A snapshot whose files are still being copied, and how far it has got; null when none is. A first publish is on no page until it is done. |
published_at | string | yes | — | Null while its first snapshot is still being copied. May be null. |
republished_at | string | yes | — | May be null. |
request_id | string | no | — | Mirrored in the X-Request-Id header. |
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 |
#400 Bad Request
#401 Unauthorized
#403 Forbidden
#404 Not Found
#409 Conflict
#413 Payload Too Large
#422 Unprocessable Content
#428 Precondition Required
#429 Too Many Requests
#500 Internal Server Error
#502 Bad Gateway
#503 Service Unavailable
#Status codes
| Status | Meaning |
|---|---|
201 | Created. |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
409 | Conflict |
413 | Payload Too Large |
422 | Unprocessable Content |
428 | Precondition Required |
429 | Too Many Requests |
500 | Internal Server Error |
502 | Bad Gateway |
503 | Service Unavailable |
Every refusal names its code, and every code is explained at Errors.