Update a collection
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");curl_easy_setopt(hnd, CURLOPT_URL, "https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Idempotency-Key: looker-sync-2027-03-04-0001");headers = curl_slist_append(headers, "Authorization: Bearer <token>");headers = curl_slist_append(headers, "Content-Type: application/json");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{ \"name\": \"Spring lookbook – approved\", \"description\": \"Approved lookbook imagery for the spring launch.\", \"media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"add_media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"remove_media_ids\": [ \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"sharing\": { \"password\": \"pine-trail-2027\", \"expires_at\": \"2027-04-30\", \"allow_download\": true, \"allow_comments\": true, \"allow_status_change\": false } }");
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Patch, RequestUri = new Uri("https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332"), Headers = { { "Idempotency-Key", "looker-sync-2027-03-04-0001" }, { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"name\": \"Spring lookbook – approved\", \"description\": \"Approved lookbook imagery for the spring launch.\", \"media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"add_media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"remove_media_ids\": [ \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"sharing\": { \"password\": \"pine-trail-2027\", \"expires_at\": \"2027-04-30\", \"allow_download\": true, \"allow_comments\": true, \"allow_status_change\": false } }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332"
payload := strings.NewReader("{ \"name\": \"Spring lookbook – approved\", \"description\": \"Approved lookbook imagery for the spring launch.\", \"media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"add_media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"remove_media_ids\": [ \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"sharing\": { \"password\": \"pine-trail-2027\", \"expires_at\": \"2027-04-30\", \"allow_download\": true, \"allow_comments\": true, \"allow_status_change\": false } }")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "looker-sync-2027-03-04-0001") req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332")) .header("Idempotency-Key", "looker-sync-2027-03-04-0001") .header("Authorization", "Bearer <token>") .header("Content-Type", "application/json") .method("PATCH", HttpRequest.BodyPublishers.ofString("{ \"name\": \"Spring lookbook – approved\", \"description\": \"Approved lookbook imagery for the spring launch.\", \"media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"add_media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"remove_media_ids\": [ \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"sharing\": { \"password\": \"pine-trail-2027\", \"expires_at\": \"2027-04-30\", \"allow_download\": true, \"allow_comments\": true, \"allow_status_change\": false } }")) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"name\": \"Spring lookbook – approved\", \"description\": \"Approved lookbook imagery for the spring launch.\", \"media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"add_media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"remove_media_ids\": [ \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"sharing\": { \"password\": \"pine-trail-2027\", \"expires_at\": \"2027-04-30\", \"allow_download\": true, \"allow_comments\": true, \"allow_status_change\": false } }");Request request = new Request.Builder() .url("https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332") .patch(body) .addHeader("Idempotency-Key", "looker-sync-2027-03-04-0001") .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'PATCH', url: 'https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332', headers: { 'Idempotency-Key': 'looker-sync-2027-03-04-0001', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, data: { name: 'Spring lookbook – approved', description: 'Approved lookbook imagery for the spring launch.', media_ids: ['786beeda-55ac-4025-bf6e-43b2918e84a9', '7f114aec-ab11-4877-9b14-82e8c1cced16'], add_media_ids: ['786beeda-55ac-4025-bf6e-43b2918e84a9', '7f114aec-ab11-4877-9b14-82e8c1cced16'], remove_media_ids: ['7f114aec-ab11-4877-9b14-82e8c1cced16'], sharing: { password: 'pine-trail-2027', expires_at: '2027-04-30', allow_download: true, allow_comments: true, allow_status_change: false } }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332';const options = { method: 'PATCH', headers: { 'Idempotency-Key': 'looker-sync-2027-03-04-0001', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"name":"Spring lookbook – approved","description":"Approved lookbook imagery for the spring launch.","media_ids":["786beeda-55ac-4025-bf6e-43b2918e84a9","7f114aec-ab11-4877-9b14-82e8c1cced16"],"add_media_ids":["786beeda-55ac-4025-bf6e-43b2918e84a9","7f114aec-ab11-4877-9b14-82e8c1cced16"],"remove_media_ids":["7f114aec-ab11-4877-9b14-82e8c1cced16"],"sharing":{"password":"pine-trail-2027","expires_at":"2027-04-30","allow_download":true,"allow_comments":true,"allow_status_change":false}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")val body = RequestBody.create(mediaType, "{ \"name\": \"Spring lookbook – approved\", \"description\": \"Approved lookbook imagery for the spring launch.\", \"media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"add_media_ids\": [ \"786beeda-55ac-4025-bf6e-43b2918e84a9\", \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"remove_media_ids\": [ \"7f114aec-ab11-4877-9b14-82e8c1cced16\" ], \"sharing\": { \"password\": \"pine-trail-2027\", \"expires_at\": \"2027-04-30\", \"allow_download\": true, \"allow_comments\": true, \"allow_status_change\": false } }")val request = Request.Builder() .url("https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332") .patch(body) .addHeader("Idempotency-Key", "looker-sync-2027-03-04-0001") .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332";
let payload = json!({ "name": "Spring lookbook – approved", "description": "Approved lookbook imagery for the spring launch.", "media_ids": ("786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16"), "add_media_ids": ("786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16"), "remove_media_ids": ("7f114aec-ab11-4877-9b14-82e8c1cced16"), "sharing": json!({ "password": "pine-trail-2027", "expires_at": "2027-04-30", "allow_download": true, "allow_comments": true, "allow_status_change": false }) });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "looker-sync-2027-03-04-0001".parse().unwrap()); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PATCH \ --url https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: looker-sync-2027-03-04-0001' \ --data '{ "name": "Spring lookbook – approved", "description": "Approved lookbook imagery for the spring launch.", "media_ids": [ "786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16" ], "add_media_ids": [ "786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16" ], "remove_media_ids": [ "7f114aec-ab11-4877-9b14-82e8c1cced16" ], "sharing": { "password": "pine-trail-2027", "expires_at": "2027-04-30", "allow_download": true, "allow_comments": true, "allow_status_change": false } }'wget --quiet \ --method PATCH \ --header 'Idempotency-Key: looker-sync-2027-03-04-0001' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --body-data '{ "name": "Spring lookbook – approved", "description": "Approved lookbook imagery for the spring launch.", "media_ids": [ "786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16" ], "add_media_ids": [ "786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16" ], "remove_media_ids": [ "7f114aec-ab11-4877-9b14-82e8c1cced16" ], "sharing": { "password": "pine-trail-2027", "expires_at": "2027-04-30", "allow_download": true, "allow_comments": true, "allow_status_change": false } }' \ --output-document \ - https://api.focal.inc/v1/collections/e46511f7-712d-4342-884d-1d4f2a460332Rename a collection, change its description, change which media it holds, or configure its share link. Only the fields you include change.
sharing governs the public link in sharing.url: set or clear its password, set or clear an expiry day, and toggle whether guests may download, comment, or change media statuses. Only the sharing keys you include change. The link cannot be minted or revoked — archiving the collection is what stops it resolving.
Membership has three mutually exclusive forms: media_ids replaces the whole list (anything not named is removed), add_media_ids appends, and remove_media_ids takes ids out. Sending media_ids alongside either of the others is a 400. Removing media from a collection never touches the media themselves.
Returns the updated collection.
Required scope: collections:write. Rate-limit cost: 10. Honors an optional Idempotency-Key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
e46511f7-712d-4342-884d-1d4f2a460332Header Parameters
Section titled “Header Parameters”Example
looker-sync-2027-03-04-0001Client-generated key (≤255 chars) for safe retries. A retry with the same key replays the original response instead of re-applying the write; reusing a key with a different body → 400, an in-flight key → 409. Required on POST; optional on PATCH/DELETE. A UUID v4 is recommended — generate one per logical write and reuse it only for retries of that write.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Display name of the collection. 1–255 characters.
Example
Spring lookbook – approvedFree-text description of the collection (≤2000 characters).
Example
Approved lookbook imagery for the spring launch.REPLACES the collection’s membership with exactly this list, in this order — media not named here are removed. To add or remove a few without restating the rest, use add_media_ids / remove_media_ids instead. Cannot be combined with either.
Example
[ "786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16"]Append these media to the end of the collection, keeping what is already there. Ids already in the collection are ignored rather than duplicated. Cannot be combined with media_ids.
Example
[ "786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16"]Remove these media from the collection, leaving the rest in order. Ids that aren’t in the collection are ignored. The media themselves are untouched — only the membership changes. Cannot be combined with media_ids.
Example
[ "7f114aec-ab11-4877-9b14-82e8c1cced16"]Share-link settings. Only the keys you include change; the rest keep their current values. The link itself always exists and cannot be minted or revoked — archive the collection to stop it resolving.
object
Password a guest must type to open the share link. Send null to remove the password and let anyone with the link in. Never returned by any read — sharing.password_protected tells you whether one is set.
Example
pine-trail-2027Calendar day (YYYY-MM-DD) after which the share link stops resolving. Send null to let it live forever.
Example
2027-04-30Let guests download the collection’s media.
Example
trueLet guests comment on the collection’s media.
Example
trueLet guests change the status of the collection’s media.
Example
falseResponses
Section titled “Responses”OK
object
object
How many media the collection holds.
The collection’s media, in display order. Select it only when you need the membership itself — a large collection returns thousands of ids; media_count alone is usually what you want.
The user who created the collection; null for collections created before the column existed.
Browser URL that opens this collection in the Focal web app. Hand this to users as a clickable link. This is the internal view and needs a Focal account — for a link to send outside the organization use sharing.url.
The collection’s share link and the settings that govern it.
object
The collection’s share link — the browser URL that opens its guest view, with no Focal account needed. Hand this to people outside the organization. Every collection has one; what the other sharing fields control is who gets past it and what they may do once inside.
Whether the share link asks for a password before showing the collection. The password itself is never returned.
Calendar day (YYYY-MM-DD) after which the share link stops resolving, or null when it never expires.
Whether guests may download the collection’s media.
Whether guests may comment on the collection’s media.
Whether guests may change the status of the collection’s media.
Example
{ "data": { "id": "e46511f7-712d-4342-884d-1d4f2a460332", "name": "Spring lookbook – approved", "description": "Approved lookbook imagery for the spring launch.", "space_id": "6916bc3d-e1ab-425b-ac25-eefada01a9a2", "organization_id": "b46d9033-24b2-4441-87ad-2151088fde01", "media_count": 2, "media_ids": [ "786beeda-55ac-4025-bf6e-43b2918e84a9", "7f114aec-ab11-4877-9b14-82e8c1cced16" ], "created_by_id": "cfebb6ef-f092-4591-a6e3-e6667ab5a252", "created_at": "2027-03-04T10:15:00Z", "updated_at": "2027-03-06T14:42:00Z", "html_url": "https://app.focal.inc/spaces/6916bc3d-e1ab-425b-ac25-eefada01a9a2/collections/e46511f7-712d-4342-884d-1d4f2a460332", "sharing": { "url": "https://app.focal.inc/collections/e46511f7-712d-4342-884d-1d4f2a460332", "password_protected": true, "expires_at": "2027-04-30", "allow_download": true, "allow_comments": true, "allow_status_change": false } }}The request was malformed (invalid cursor, unknown type, validation failure, etc.). error.code is bad_request.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "bad_request", "message": "Invalid request body", "details": [ { "field": "space_id", "issue": "Invalid UUID" } ] }}Missing, invalid, or disabled token. error.code is unauthenticated.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "unauthenticated", "message": "Bearer token is missing or invalid" }}The token doesn’t have the scope this endpoint requires. error.code is forbidden.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "forbidden", "message": "Token doesn't have the required scope" }}Resource doesn’t exist or is outside the token’s space allow-list. The two cases share a response shape so a restricted token can’t probe for the existence of out-of-scope spaces. error.code is not_found.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "not_found", "message": "Not found" }}The request conflicts with the current state. Most commonly a concurrent request carrying the same Idempotency-Key is still in flight. error.code is conflict.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "conflict", "message": "A request with this Idempotency-Key is already being processed" }}Rate limit exceeded. error.code is rate_limited. Wait the number of seconds in the Retry-After header before retrying. Quotas are per-token; see the “Rate limiting” section at the top of this document.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "rate_limited", "message": "Rate limit of 1000 units per 60s exceeded (this request cost 5)" }}Headers
Section titled “Headers”Example
12Seconds to wait before retrying.