{"openapi":"3.1.0","info":{"title":"PicHaus API","version":"1.0.0","description":"Use the PicHaus API to browse albums, fetch photos, and deliver a private client gallery from your own tools."},"externalDocs":{"url":"https://pic.haus/en/docs"},"servers":[{"url":"https://pic.haus/api/external"}],"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"PicHaus API key"}},"schemas":{"Error":{"type":"object","required":["statusCode","statusMessage","message"],"properties":{"statusCode":{"type":"integer"},"statusMessage":{"type":"string"},"message":{"type":"string"}}},"Pagination":{"type":"object","required":["page","limit","total","hasMore"],"properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"hasMore":{"type":"boolean"}}},"Album":{"type":"object","required":["id","title","description","tags","photoCount","eventDate","createdAt","updatedAt","isPublic"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"photoCount":{"type":"integer"},"eventDate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"},"isPublic":{"type":"boolean"}}},"Photo":{"type":"object","required":["id","filename","originalName","width","height","blurhash","dateTaken","createdAt","url","thumbnailUrl","signedUrl","signedThumbnailUrl","signedUrlExpiresAt"],"properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"originalName":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"blurhash":{"type":"string"},"dateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"integer"},"url":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"signedUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedThumbnailUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedUrlExpiresAt":{"anyOf":[{"type":"integer"},{"type":"null"}]}}},"ViewLink":{"type":"object","required":["id","url","label","expiresAt","createdAt","hasPassword","canDownload","selectedPhotoCount"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"integer"},"hasPassword":{"type":"boolean"},"canDownload":{"type":"boolean"},"selectedPhotoCount":{"anyOf":[{"type":"integer"},{"type":"null"}]}}}}},"paths":{"/albums":{"get":{"operationId":"listAlbums","tags":["Albums"],"summary":"List albums","description":"Find your albums by title, description, tags, visibility, or event date. Photo counts include photos still processing. The timeline groups the current page by UTC month, using the creation date if no event date is set.","security":[{"ApiKey":[]}],"x-pichaus-scope":"albums:read","parameters":[{"name":"page","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"One-based page number.","in":"query"},{"name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Results per page.","in":"query"},{"name":"order","schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Sort direction.","in":"query"},{"name":"q","schema":{"type":"string","maxLength":200},"description":"Case-insensitive literal search of title and description.","in":"query"},{"name":"tag","schema":{"type":"string","maxLength":40},"description":"Match one exact, case-sensitive tag.","in":"query"},{"name":"tags","schema":{"type":"string","maxLength":820},"description":"Match any exact, case-sensitive tag in a comma-separated list. Combined with tag when both are sent.","in":"query"},{"name":"visibility","schema":{"type":"string","enum":["all","public","private"],"default":"all"},"description":"Filter your albums by publication status.","in":"query"},{"name":"fromEventDate","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Earliest event time, inclusive.","in":"query"},{"name":"toEventDate","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Latest event time, inclusive.","in":"query"},{"name":"sortBy","schema":{"type":"string","enum":["createdAt","eventDate","title","updatedAt"],"default":"createdAt"},"description":"Album field to sort by.","in":"query"}],"responses":{"200":{"description":"A page of albums","content":{"application/json":{"schema":{"type":"object","required":["success","data","pagination","summary"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Album"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"summary":{"type":"object","required":["filters","timeline"],"properties":{"filters":{"type":"object","required":["q","tag","tags","visibility","fromEventDate","toEventDate","sortBy","order"],"properties":{"q":{"anyOf":[{"type":"string"},{"type":"null"}]},"tag":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"visibility":{"type":"string","enum":["all","public","private"]},"fromEventDate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"toEventDate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"sortBy":{"type":"string","enum":["createdAt","eventDate","title","updatedAt"]},"order":{"type":"string","enum":["asc","desc"]}}},"timeline":{"type":"object","additionalProperties":{"type":"integer"}}}}}},"examples":{"typical":{"value":{"success":true,"data":[{"id":"4a376050-1a88-4a7e-bf03-61a03536c198","title":"Studio proofs","description":null,"tags":["proofs"],"photoCount":1,"eventDate":null,"createdAt":1785679200,"updatedAt":1785679200,"isPublic":false}],"pagination":{"page":1,"limit":20,"total":1,"hasMore":false},"summary":{"filters":{"q":null,"tag":null,"tags":[],"visibility":"all","fromEventDate":null,"toEventDate":null,"sortBy":"createdAt","order":"desc"},"timeline":{"2026-08":1}}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAlbum","tags":["Albums"],"summary":"Create a private album","description":"Create a standard, private album in your personal workspace. Your plan’s album limit applies. Publication and expiry are managed in the app.","security":[{"ApiKey":[]}],"x-pichaus-scope":"albums:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique key per action. Retained for 24 hours.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Album name."},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"description":"Album description. Set to null to clear."},"tags":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":20,"description":"Replace the tags. Send an empty array to clear."},"eventDate":{"anyOf":[{"type":"integer","minimum":0,"maximum":253402300799},{"type":"null"}],"description":"Event date in Unix seconds. Set to null to clear."}}}}}},"responses":{"201":{"description":"Album created or replayed","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Album"}}},"examples":{"typical":{"value":{"success":true,"data":{"id":"4a376050-1a88-4a7e-bf03-61a03536c198","title":"Studio proofs","description":null,"tags":["proofs"],"photoCount":0,"eventDate":null,"createdAt":1785679200,"updatedAt":1785679200,"isPublic":false}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The idempotency key was reused with different input, or the same photo is still uploading.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}":{"get":{"operationId":"getAlbum","tags":["Albums"],"summary":"Get an album","description":"Read album details and links to its photo collections. Cover image URLs require photos:read, and its signed URLs are null for keys without that scope. coverPhoto is the selected cover photo or, when the album has no cover of its own, its newest ready landscape-first photo, matching the app. previewImageUrl is that photo’s thumbnail, or null when there is none (including albums whose cover is an uploaded image). The collaborator count includes only collaborators who uploaded at least one photo.","security":[{"ApiKey":[]}],"x-pichaus-scope":"albums:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["id","title","description","tags","photoCount","eventDate","createdAt","updatedAt","isPublic","collaboratorCount","coverPhoto","previewImageUrl","links"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"photoCount":{"type":"integer"},"eventDate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"integer"},"updatedAt":{"type":"integer"},"isPublic":{"type":"boolean"},"collaboratorCount":{"type":"integer"},"coverPhoto":{"anyOf":[{"type":"object","required":["id","blurhash","thumbnailUrl","fullUrl","signedThumbnailUrl","signedFullUrl","signedUrlExpiresAt"],"properties":{"id":{"type":"string","format":"uuid"},"blurhash":{"type":"string"},"thumbnailUrl":{"type":"string","format":"uri"},"fullUrl":{"type":"string","format":"uri"},"signedThumbnailUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedFullUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedUrlExpiresAt":{"anyOf":[{"type":"integer"},{"type":"null"}]}}},{"type":"null"}]},"previewImageUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"links":{"type":"object","required":["photos","randomPhotos"],"properties":{"photos":{"type":"string","format":"uri"},"randomPhotos":{"type":"string","format":"uri"}}}}}}},"examples":{"typical":{"value":{"success":true,"data":{"id":"4a376050-1a88-4a7e-bf03-61a03536c198","title":"Studio proofs","description":null,"tags":["proofs"],"photoCount":1,"eventDate":null,"createdAt":1785679200,"updatedAt":1785679200,"isPublic":false,"collaboratorCount":0,"coverPhoto":null,"previewImageUrl":null,"links":{"photos":"https://pic.haus/api/external/albums/4a376050-1a88-4a7e-bf03-61a03536c198/photos","randomPhotos":"https://pic.haus/api/external/albums/4a376050-1a88-4a7e-bf03-61a03536c198/random"}}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateAlbum","tags":["Albums"],"summary":"Update an album","description":"Edit an album’s title, description, tags, or event date. Omitted fields are left unchanged. This does not change publication or sharing permissions.","security":[{"ApiKey":[]}],"x-pichaus-scope":"albums:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"Album name."},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"description":"Album description. Set to null to clear."},"tags":{"type":"array","items":{"type":"string","maxLength":40},"maxItems":20,"description":"Replace the tags. Send an empty array to clear."},"eventDate":{"anyOf":[{"type":"integer","minimum":0,"maximum":253402300799},{"type":"null"}],"description":"Event date in Unix seconds. Set to null to clear."}},"minProperties":1}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/Album"}}},"examples":{"typical":{"value":{"success":true,"data":{"id":"4a376050-1a88-4a7e-bf03-61a03536c198","title":"Studio proofs — final","description":null,"tags":["proofs"],"photoCount":1,"eventDate":null,"createdAt":1785679200,"updatedAt":1785679200,"isPublic":false}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/photos":{"get":{"operationId":"listPhotos","tags":["Photos"],"summary":"List album photos","description":"List ready photos in one album. Like the self-hosted API, this endpoint omits the selected cover photo; use Get an album for its URLs.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"One-based page number.","in":"query"},{"name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Results per page.","in":"query"},{"name":"order","schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Sort direction.","in":"query"},{"name":"orientation","schema":{"type":"string","enum":["any","landscape","portrait","square"],"default":"any"},"description":"Filter by image dimensions before pagination.","in":"query"},{"name":"fromDateTaken","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Earliest capture time, inclusive. Photos without a capture date do not match.","in":"query"},{"name":"toDateTaken","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Latest capture time, inclusive.","in":"query"},{"name":"sortBy","schema":{"type":"string","enum":["createdAt","dateTaken","originalName"],"default":"createdAt"},"description":"Photo field to sort by.","in":"query"},{"name":"photographer","schema":{"anyOf":[{"type":"string","format":"uuid"},{"const":"me","type":"string"}]},"description":"Filter by uploader UUID or use me for the key owner.","in":"query"},{"name":"onlyMe","schema":{"type":"string","enum":["true","false"],"default":"false"},"description":"Set to true to use the key owner regardless of photographer.","in":"query"}],"responses":{"200":{"description":"A page of ready photos","content":{"application/json":{"schema":{"type":"object","required":["success","data","pagination","meta"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Photo"}},"pagination":{"$ref":"#/components/schemas/Pagination"},"meta":{"type":"object","required":["filters"],"properties":{"filters":{"type":"object","required":["orientation","fromDateTaken","toDateTaken","sortBy","order"],"properties":{"orientation":{"type":"string","enum":["any","landscape","portrait","square"]},"fromDateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"toDateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"sortBy":{"type":"string","enum":["createdAt","dateTaken","originalName"]},"order":{"type":"string","enum":["asc","desc"]}}}}}}},"examples":{"typical":{"value":{"success":true,"data":[{"id":"7f79938d-54c3-4a68-bc2a-bf59d741e275","filename":"upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg","originalName":"studio-01.jpg","width":2400,"height":1600,"blurhash":"L6Pj0^i_.AyE_3t7t7R**0o#DgR4","dateTaken":1785672000,"createdAt":1785679320,"url":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/full","thumbnailUrl":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/thumb","signedUrl":"https://storage.example.com/photos/upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedThumbnailUrl":"https://storage.example.com/thumbnails/7f79938d-54c3-4a68-bc2a-bf59d741e275.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedUrlExpiresAt":1785679620}],"pagination":{"page":1,"limit":50,"total":1,"hasMore":false},"meta":{"filters":{"orientation":"landscape","fromDateTaken":null,"toDateTaken":null,"sortBy":"createdAt","order":"desc"}}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"uploadPhoto","tags":["Photos"],"summary":"Upload a photo","description":"Send one image as multipart form data. The default limit is 10 MiB per file; the deployment and your storage quota can impose other limits. Retrying identical bytes in the same album returns the existing photo ID (200). If the other upload is still in flight, wait for Retry-After on 409.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"A single photo file."}}}}}},"responses":{"200":{"description":"The album already contains these file bytes","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["photoId","duplicate"],"properties":{"photoId":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"}}}}},"examples":{"typical":{"value":{"success":true,"data":{"photoId":"7f79938d-54c3-4a68-bc2a-bf59d741e275","duplicate":true}}}}}}},"201":{"description":"Photo accepted for processing","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["photoId","duplicate"],"properties":{"photoId":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"}}}}},"examples":{"typical":{"value":{"success":true,"data":{"photoId":"7f79938d-54c3-4a68-bc2a-bf59d741e275","duplicate":false}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The idempotency key was reused with different input, or the same photo is still uploading.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The upload is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/random":{"get":{"operationId":"randomAlbumPhotos","tags":["Photos"],"summary":"Sample photos from an album","description":"Sample ready photos from one album without including its selected cover. Repeating a request can return different photos.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"count","schema":{"type":"integer","minimum":1,"maximum":50,"default":1},"description":"Maximum photos to return. Fewer may match.","in":"query"},{"name":"orientation","schema":{"type":"string","enum":["any","landscape","portrait","square"],"default":"any"},"description":"Filter by image dimensions.","in":"query"},{"name":"fromDateTaken","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Earliest capture time, inclusive. Photos without a capture date do not match.","in":"query"},{"name":"toDateTaken","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Latest capture time, inclusive.","in":"query"}],"responses":{"200":{"description":"Random ready photos from the album","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Photo"}},"meta":{"type":"object","required":["filters"],"properties":{"filters":{"type":"object","required":["orientation","fromDateTaken","toDateTaken","count"],"properties":{"orientation":{"type":"string","enum":["any","landscape","portrait","square"]},"fromDateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"toDateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"count":{"type":"integer"}}}}}}},"examples":{"typical":{"value":{"success":true,"data":[{"id":"7f79938d-54c3-4a68-bc2a-bf59d741e275","filename":"upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg","originalName":"studio-01.jpg","width":2400,"height":1600,"blurhash":"L6Pj0^i_.AyE_3t7t7R**0o#DgR4","dateTaken":1785672000,"createdAt":1785679320,"url":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/full","thumbnailUrl":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/thumb","signedUrl":"https://storage.example.com/photos/upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedThumbnailUrl":"https://storage.example.com/thumbnails/7f79938d-54c3-4a68-bc2a-bf59d741e275.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedUrlExpiresAt":1785679620}],"meta":{"filters":{"count":1,"orientation":"any","fromDateTaken":null,"toDateTaken":null}}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/photos/random":{"get":{"operationId":"randomPhotos","tags":["Photos"],"summary":"Sample photos across albums","description":"Sample ready photos that meet all supplied album and photo filters. By default, only published albums are eligible. Use visibility=all to include private albums or visibility=private to sample only private albums. The result is empty when no photos match.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:read","parameters":[{"name":"count","schema":{"type":"integer","minimum":1,"maximum":50,"default":1},"description":"Maximum photos to return. Fewer may match.","in":"query"},{"name":"orientation","schema":{"type":"string","enum":["any","landscape","portrait","square"],"default":"any"},"description":"Filter by image dimensions.","in":"query"},{"name":"fromDateTaken","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Earliest capture time, inclusive. Photos without a capture date do not match.","in":"query"},{"name":"toDateTaken","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Latest capture time, inclusive.","in":"query"},{"name":"q","schema":{"type":"string","maxLength":200},"description":"Case-insensitive literal search of title and description.","in":"query"},{"name":"tag","schema":{"type":"string","maxLength":40},"description":"Match one exact, case-sensitive tag.","in":"query"},{"name":"tags","schema":{"type":"string","maxLength":820},"description":"Match any exact, case-sensitive tag in a comma-separated list. Combined with tag when both are sent.","in":"query"},{"name":"visibility","schema":{"type":"string","enum":["all","public","private"],"default":"public"},"description":"Filter your albums by publication status.","in":"query"},{"name":"fromEventDate","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Earliest event time, inclusive.","in":"query"},{"name":"toEventDate","schema":{"type":"integer","minimum":0,"maximum":253402300799},"description":"Latest event time, inclusive.","in":"query"},{"name":"albumId","schema":{"type":"string","format":"uuid"},"description":"Restrict the sample to one album.","in":"query"},{"name":"albumIds","schema":{"type":"string","maxLength":1849,"pattern":"^[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}(?:,[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})*$"},"description":"Sample from up to 50 comma-separated album UUIDs. Only IDs accessible to the key can match.","in":"query"}],"responses":{"200":{"description":"Random ready photos with album references","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"type":"object","required":["id","filename","originalName","width","height","blurhash","dateTaken","createdAt","url","thumbnailUrl","signedUrl","signedThumbnailUrl","signedUrlExpiresAt","album"],"properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"originalName":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"blurhash":{"type":"string"},"dateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"integer"},"url":{"type":"string","format":"uri"},"thumbnailUrl":{"type":"string","format":"uri"},"signedUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedThumbnailUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedUrlExpiresAt":{"anyOf":[{"type":"integer"},{"type":"null"}]},"album":{"type":"object","required":["id","title"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"}}}}}},"meta":{"type":"object","required":["filters"],"properties":{"filters":{"type":"object","required":["orientation","fromDateTaken","toDateTaken","count","q","tag","tags","visibility","fromEventDate","toEventDate","albumId","albumIds"],"properties":{"orientation":{"type":"string","enum":["any","landscape","portrait","square"]},"fromDateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"toDateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"count":{"type":"integer"},"q":{"anyOf":[{"type":"string"},{"type":"null"}]},"tag":{"anyOf":[{"type":"string"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"visibility":{"type":"string","enum":["all","public","private"]},"fromEventDate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"toEventDate":{"anyOf":[{"type":"integer"},{"type":"null"}]},"albumId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"albumIds":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}}},"examples":{"typical":{"value":{"success":true,"data":[{"id":"7f79938d-54c3-4a68-bc2a-bf59d741e275","filename":"upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg","originalName":"studio-01.jpg","width":2400,"height":1600,"blurhash":"L6Pj0^i_.AyE_3t7t7R**0o#DgR4","dateTaken":1785672000,"createdAt":1785679320,"url":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/full","thumbnailUrl":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/thumb","signedUrl":"https://storage.example.com/photos/upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedThumbnailUrl":"https://storage.example.com/thumbnails/7f79938d-54c3-4a68-bc2a-bf59d741e275.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedUrlExpiresAt":1785679620,"album":{"id":"4a376050-1a88-4a7e-bf03-61a03536c198","title":"Studio proofs"}}],"meta":{"filters":{"count":1,"orientation":"any","fromDateTaken":null,"toDateTaken":null,"q":null,"tag":null,"tags":["proofs","portfolio"],"visibility":"private","fromEventDate":null,"toEventDate":null,"albumId":null,"albumIds":[]}}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/photos/processed":{"post":{"operationId":"uploadProcessedPhoto","tags":["Photos"],"summary":"Upload a desktop-processed photo","description":"Send exactly file, thumbnail, and metadata. The server validates image bytes and derives original size, hash, and dimensions. Supplied EXIF and previews skip server extraction and generation. Identical originals return the existing photo without replacing metadata. Poll photo processing before delivery.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","thumbnail","metadata"],"properties":{"file":{"type":"string","format":"binary","description":"Original image; normal upload size limit, filename up to 512 characters."},"thumbnail":{"type":"string","format":"binary","description":"Orientation-correct WebP, at most 400 × 400 pixels and 512 KiB."},"metadata":{"type":"string","maxLength":4096,"description":"JSON string with all fields: version:1, blurhash (valid Base83, maximum 166 characters), cameraModel, lens, focalLength, iso, aperture, shutterSpeed, dateTaken. Unknown EXIF values must be null. Strings are at most 255 characters; ISO is an integer 0–2147483647; dateTaken is UTC Unix seconds 0–253402300799. No extra fields."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["photoId","duplicate"],"properties":{"photoId":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"}}}}},"examples":{"typical":{"value":{"success":true,"data":{"photoId":"7f79938d-54c3-4a68-bc2a-bf59d741e275","duplicate":true}}}}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["photoId","duplicate"],"properties":{"photoId":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"}}}}},"examples":{"typical":{"value":{"success":true,"data":{"photoId":"7f79938d-54c3-4a68-bc2a-bf59d741e275","duplicate":false}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The idempotency key was reused with different input, or the same photo is still uploading.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The upload is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/direct-uploads":{"post":{"operationId":"initiateDirectUpload","tags":["Photos"],"summary":"Prepare a direct S3 upload","description":"Requires operator-enabled direct uploads and S3 storage. Returns a 15-minute signed PUT URL for a private staging object. PUT the exact original bytes with every returned header; never send the API key to S3. A repeated PUT may return 412; proceed to finalize if the first PUT succeeded. Each initiation creates a new session. Admission limits: 20 sessions and 256 MiB per user, 1 GiB globally, counted until expiry. Quota is checked at finalization.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","size","sha256"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":512,"description":"Original filename."},"size":{"type":"integer","minimum":1,"maximum":2147483647,"description":"Exact original byte length, within the configured upload limit."},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"SHA-256 of the original, lowercase hexadecimal."}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["uploadId","expiresAt","method","url","headers"],"properties":{"uploadId":{"type":"string","format":"uuid"},"expiresAt":{"type":"integer"},"method":{"type":"string"},"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}}},"examples":{"typical":{"value":{"success":true,"data":{"uploadId":"7f79938d-54c3-4a68-bc2a-bf59d741e275","expiresAt":1800000000,"method":"PUT","url":"https://storage.example/signed-upload","headers":{"Content-Type":"application/octet-stream","Content-Length":"123456","If-None-Match":"*","x-amz-checksum-sha256":"<base64 SHA-256>"}}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The idempotency key was reused with different input, or the same photo is still uploading.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The upload is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/direct-uploads/{uploadId}/finalize":{"post":{"operationId":"finalizeDirectUpload","tags":["Photos"],"summary":"Finalize a direct S3 upload","description":"After PUT completes, send exactly thumbnail and metadata. The server reads and verifies the staged original, then persists a canonical copy with normal quota and recovery checks. This is not a zero-copy path. Retry finalization with the same upload ID after network errors. Successful receipts return the same photo ID for at least 24 hours after expiry; deleted photos or unfinished expired sessions return 410. Use the processed multipart route when direct uploads are unavailable.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:upload","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"uploadId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["thumbnail","metadata"],"properties":{"thumbnail":{"type":"string","format":"binary","description":"Orientation-correct WebP, at most 400 × 400 pixels and 512 KiB."},"metadata":{"type":"string","maxLength":4096,"description":"JSON string with all fields: version:1, blurhash (valid Base83, maximum 166 characters), cameraModel, lens, focalLength, iso, aperture, shutterSpeed, dateTaken. Unknown EXIF values must be null. Strings are at most 255 characters; ISO is an integer 0–2147483647; dateTaken is UTC Unix seconds 0–253402300799. No extra fields."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["photoId","duplicate"],"properties":{"photoId":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"}}}}},"examples":{"typical":{"value":{"success":true,"data":{"photoId":"7f79938d-54c3-4a68-bc2a-bf59d741e275","duplicate":true}}}}}}},"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["photoId","duplicate"],"properties":{"photoId":{"type":"string","format":"uuid"},"duplicate":{"type":"boolean"}}}}},"examples":{"typical":{"value":{"success":true,"data":{"photoId":"7f79938d-54c3-4a68-bc2a-bf59d741e275","duplicate":false}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The idempotency key was reused with different input, or the same photo is still uploading.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"The upload session expired or the uploaded photo was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The upload is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/photos/{photoId}":{"get":{"operationId":"getPhoto","tags":["Photos"],"summary":"Check photo processing","description":"Use the photo ID from an upload to check its status. Pending and processing photos are not yet ready; if processing fails, check the album in PicHaus. Image URLs are null until processing completes.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"photoId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","required":["id","filename","originalName","width","height","blurhash","dateTaken","createdAt","url","thumbnailUrl","signedUrl","signedThumbnailUrl","signedUrlExpiresAt","processingStatus"],"properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"originalName":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"blurhash":{"type":"string"},"dateTaken":{"anyOf":[{"type":"integer"},{"type":"null"}]},"createdAt":{"type":"integer"},"url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedThumbnailUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"signedUrlExpiresAt":{"anyOf":[{"type":"integer"},{"type":"null"}]},"processingStatus":{"type":"string","enum":["pending","processing","completed","failed"]}}}}},"examples":{"typical":{"value":{"success":true,"data":{"id":"7f79938d-54c3-4a68-bc2a-bf59d741e275","filename":"upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg","originalName":"studio-01.jpg","width":2400,"height":1600,"blurhash":"L6Pj0^i_.AyE_3t7t7R**0o#DgR4","dateTaken":1785672000,"createdAt":1785679320,"url":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/full","thumbnailUrl":"https://pic.haus/api/external/photos/7f79938d-54c3-4a68-bc2a-bf59d741e275/thumb","signedUrl":"https://storage.example.com/photos/upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedThumbnailUrl":"https://storage.example.com/thumbnails/7f79938d-54c3-4a68-bc2a-bf59d741e275.webp?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=…","signedUrlExpiresAt":1785679620,"processingStatus":"completed"}}},"alternative":{"summary":"Example while processing","value":{"success":true,"data":{"id":"7f79938d-54c3-4a68-bc2a-bf59d741e275","filename":"upload-7f79938d-54c3-4a68-bc2a-bf59d741e275.jpeg","originalName":"studio-01.jpg","width":2400,"height":1600,"blurhash":"L6Pj0^i_.AyE_3t7t7R**0o#DgR4","dateTaken":null,"createdAt":1785679320,"url":null,"thumbnailUrl":null,"signedUrl":null,"signedThumbnailUrl":null,"signedUrlExpiresAt":null,"processingStatus":"pending"}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/photos/{photoId}/{variant}":{"get":{"operationId":"downloadPhoto","tags":["Photos"],"summary":"Download an image","description":"Fetch the thumbnail or original image with the same Bearer key. Responses are image bytes, not JSON or redirects. A missing thumbnail falls back to the original, so check Content-Type. When a photo response includes signedUrl or signedThumbnailUrl, you can fetch those directly without the key instead.","security":[{"ApiKey":[]}],"x-pichaus-scope":"photos:read","parameters":[{"name":"photoId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"variant","in":"path","required":true,"schema":{"type":"string","enum":["full","thumb"]}}],"responses":{"200":{"description":"Binary image with its actual Content-Type","content":{"image/*":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/share-links":{"get":{"operationId":"listShareLinks","tags":["Share links"],"summary":"List view links","description":"List the album’s view links that guests can still open, newest first, including links made in the app. Revoked, disabled, and expired links are not included. App links can have no expiry (expiresAt is null), a password, downloads, or a selection of photos (selectedPhotoCount; null means the whole album). Anyone with a link URL can open it, so treat URLs as secrets.","security":[{"ApiKey":[]}],"x-pichaus-scope":"share-links:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"page","schema":{"type":"integer","minimum":1,"maximum":10000,"default":1},"description":"One-based page number.","in":"query"},{"name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Results per page.","in":"query"}],"responses":{"200":{"description":"A page of usable view links","content":{"application/json":{"schema":{"type":"object","required":["success","data","pagination"],"properties":{"success":{"type":"boolean","const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/ViewLink"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"examples":{"typical":{"value":{"success":true,"data":[{"id":"3f87b235-160a-44fa-8da1-bd5946de65fe","url":"https://pic.haus/v/example-view-link-01","label":"Client proofs","expiresAt":1786284000,"createdAt":1785679400,"hasPassword":false,"canDownload":false,"selectedPhotoCount":null}],"pagination":{"page":1,"limit":50,"total":1,"hasMore":false}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createShareLink","tags":["Share links"],"summary":"Create a view link","description":"Create a link that anyone holding it can use until it expires or is revoked. This does not publish the album, enable downloads, or send email. Set an expiry within 30 days and no later than the album’s expiry.","security":[{"ApiKey":[]}],"x-pichaus-scope":"share-links:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique key per action. Retained for 24 hours.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expiresAt"],"properties":{"expiresAt":{"type":"integer","minimum":0,"maximum":253402300799,"description":"Future Unix timestamp in seconds."},"label":{"type":"string","maxLength":200,"description":"Optional name for this link."}}}}}},"responses":{"201":{"description":"View link created or replayed","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"type":"boolean","const":true},"data":{"$ref":"#/components/schemas/ViewLink"}}},"examples":{"typical":{"value":{"success":true,"data":{"id":"3f87b235-160a-44fa-8da1-bd5946de65fe","url":"https://pic.haus/v/example-view-link-01","label":"Client proofs","expiresAt":1786284000,"createdAt":1785679400,"hasPassword":false,"canDownload":false,"selectedPhotoCount":null}}}}}}},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The idempotency key was reused with different input, or the same photo is still uploading.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/albums/{id}/share-links/{linkId}":{"delete":{"operationId":"revokeShareLink","tags":["Share links"],"summary":"Revoke a view link","description":"Use the link ID, not the token in the guest URL. Revocation ends access and invalidates guest sessions for that link. Repeating a successful revocation returns 204.","security":[{"ApiKey":[]}],"x-pichaus-scope":"share-links:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"linkId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Link revoked; no response body"},"400":{"description":"Invalid request. Check the parameters, body, and required headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is missing a required scope, or the workspace plan does not allow the action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The resource does not exist or is outside the key’s access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After before retrying.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error. Only retry a write when it is safe to replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Honor Retry-After when present.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}