API reference
Browse albums, fetch photos, and deliver private galleries from your own tools.
https://pic.haus/api/externalOn this page
Quickstart
Create an API key with albums:read. Set it as PICHAUS_API_KEY, then list your albums.
export PICHAUS_API=\
'https://pic.haus/api/external'
curl --fail-with-body \
"$PICHAUS_API/albums?limit=20" \
-H "Authorization: Bearer $PICHAUS_API_KEY"{
"success": true,
"data": [
{
"id": "4a376050-1a88-4a7e-bf03-61a03536c198",
"title": "Studio proofs",
"photoCount": 1
}
]
}Full JSON response
{
"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
}
}
}Examples use sample IDs. Use IDs from your own responses in later requests.
Authentication
Send the key as Authorization: Bearer $PICHAUS_API_KEY on every request, including image downloads. Keep it server-side and revoke it if exposed. PicHaus only shows the full key once.
Keys can access active, standard albums you own in your personal workspace. They cannot access team albums, albums shared with you, or end-to-end encrypted albums.
albums:read- List albums and read album details.
photos:read- List and sample photos, check processing, and fetch image bytes.
albums:write- Create private albums and edit their basic details.
photos:upload- Upload photos to an album.
share-links:read- List an album’s active view links, including links made in the app.
share-links:write- Create and revoke expiring view links.
Deliver an album
- Create a private album and save its ID as
ALBUM_ID. - Upload each photo and save its ID as
PHOTO_ID. - Check processing until the status is
completed. - Create a view link and give the returned URL to your client.
Generate unique CREATE_KEY and SHARE_KEY values before the two create requests. A share link does not publish your album or send email.
Albums
List albums
albums:read/albumsFind 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.
Query parameters 10
page1–10000 (default: 1)- One-based page number.
limit1–100 (default: 20)- Results per page.
orderasc · desc (default: desc)- Sort direction.
qstring- Case-insensitive literal search of title and description.
tagstring- Match one exact, case-sensitive tag.
tagsstring- Match any exact, case-sensitive tag in a comma-separated list. Combined with tag when both are sent.
visibilityall · public · private (default: all)- Filter your albums by publication status.
fromEventDateinteger- Earliest event time, inclusive.
toEventDateinteger- Latest event time, inclusive.
sortBycreatedAt · eventDate · title · updatedAt (default: createdAt)- Album field to sort by.
curl --fail-with-body \
"$PICHAUS_API/albums?limit=20" \
-H "Authorization: Bearer $PICHAUS_API_KEY"{
"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
}
}
}Get an album
albums:read/albums/{id}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.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID" \
-H "Authorization: Bearer $PICHAUS_API_KEY"{
"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"
}
}
}Create a private album
albums:write/albumsCreate a standard, private album in your personal workspace. Your plan’s album limit applies. Publication and expiry are managed in the app.
Required header: Idempotency-Key
Request body 4
titlestring · required- Album name.
descriptionstring or null- Album description. Set to null to clear.
tagsarray- Replace the tags. Send an empty array to clear.
eventDateinteger or null- Event date in Unix seconds. Set to null to clear.
curl --fail-with-body \
"$PICHAUS_API/albums" \
-H "Authorization: Bearer $PICHAUS_API_KEY" \
-X POST \
-H 'Content-Type: application/json' \
-H "Idempotency-Key: $CREATE_KEY" \
--data '{"title":"Studio proofs","tags":["proofs"]}'{
"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
}
}Update an album
albums:write/albums/{id}Edit an album’s title, description, tags, or event date. Omitted fields are left unchanged. This does not change publication or sharing permissions.
Request body 4
titlestring- Album name.
descriptionstring or null- Album description. Set to null to clear.
tagsarray- Replace the tags. Send an empty array to clear.
eventDateinteger or null- Event date in Unix seconds. Set to null to clear.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID" \
-H "Authorization: Bearer $PICHAUS_API_KEY" \
-X PATCH \
-H 'Content-Type: application/json' \
--data '{"title":"Studio proofs — final"}'{
"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
}
}Photos
List album photos
photos:read/albums/{id}/photosList ready photos in one album. Like the self-hosted API, this endpoint omits the selected cover photo; use Get an album for its URLs.
Query parameters 9
page1–10000 (default: 1)- One-based page number.
limit1–100 (default: 50)- Results per page.
orderasc · desc (default: desc)- Sort direction.
orientationany · landscape · portrait · square (default: any)- Filter by image dimensions before pagination.
fromDateTakeninteger- Earliest capture time, inclusive. Photos without a capture date do not match.
toDateTakeninteger- Latest capture time, inclusive.
sortBycreatedAt · dateTaken · originalName (default: createdAt)- Photo field to sort by.
photographerUUID or me- Filter by uploader UUID or use me for the key owner.
onlyMetrue · false (default: false)- Set to true to use the key owner regardless of photographer.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID/photos?orientation=landscape" \
-H "Authorization: Bearer $PICHAUS_API_KEY"{
"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"
}
}
}Sample photos from an album
photos:read/albums/{id}/randomSample ready photos from one album without including its selected cover. Repeating a request can return different photos.
Query parameters 4
count1–50 (default: 1)- Maximum photos to return. Fewer may match.
orientationany · landscape · portrait · square (default: any)- Filter by image dimensions.
fromDateTakeninteger- Earliest capture time, inclusive. Photos without a capture date do not match.
toDateTakeninteger- Latest capture time, inclusive.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID/random?count=1" \
-H "Authorization: Bearer $PICHAUS_API_KEY"{
"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
}
}
}Sample photos across albums
photos:read/photos/randomSample 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.
Query parameters 12
count1–50 (default: 1)- Maximum photos to return. Fewer may match.
orientationany · landscape · portrait · square (default: any)- Filter by image dimensions.
fromDateTakeninteger- Earliest capture time, inclusive. Photos without a capture date do not match.
toDateTakeninteger- Latest capture time, inclusive.
qstring- Case-insensitive literal search of title and description.
tagstring- Match one exact, case-sensitive tag.
tagsstring- Match any exact, case-sensitive tag in a comma-separated list. Combined with tag when both are sent.
visibilityall · public · private (default: public)- Filter your albums by publication status.
fromEventDateinteger- Earliest event time, inclusive.
toEventDateinteger- Latest event time, inclusive.
albumIdUUID- Restrict the sample to one album.
albumIdsstring- Sample from up to 50 comma-separated album UUIDs. Only IDs accessible to the key can match.
curl --fail-with-body \
"$PICHAUS_API/photos/random?count=1&tags=proofs,portfolio&visibility=private" \
-H "Authorization: Bearer $PICHAUS_API_KEY"{
"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": []
}
}
}Upload a photo
photos:upload/albums/{id}/photosSend 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.
Request body 1
filefile · required- A single photo file.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID/photos" \
-H "Authorization: Bearer $PICHAUS_API_KEY" \
-F 'file=@studio-01.jpg'{
"success": true,
"data": {
"photoId": "7f79938d-54c3-4a68-bc2a-bf59d741e275",
"duplicate": false
}
}200 · The album already contains these file bytes
{
"success": true,
"data": {
"photoId": "7f79938d-54c3-4a68-bc2a-bf59d741e275",
"duplicate": true
}
}Upload a desktop-processed photo
photos:upload/albums/{id}/photos/processedSend 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.
Request body 3
filefile · required- Original image; normal upload size limit, filename up to 512 characters.
thumbnailfile · required- Orientation-correct WebP, at most 400 × 400 pixels and 512 KiB.
metadatastring · required- 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.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID/photos/processed" \
-H "Authorization: Bearer $PICHAUS_API_KEY" \
-F 'file=@photo.jpg' -F 'thumbnail=@thumb.webp' -F 'metadata=<metadata.json'{
"success": true,
"data": {
"photoId": "7f79938d-54c3-4a68-bc2a-bf59d741e275",
"duplicate": false
}
}200 · Success
{
"success": true,
"data": {
"photoId": "7f79938d-54c3-4a68-bc2a-bf59d741e275",
"duplicate": true
}
}Prepare a direct S3 upload
photos:upload/albums/{id}/direct-uploadsRequires 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.
Request body 3
filenamestring · required- Original filename.
sizeinteger · required- Exact original byte length, within the configured upload limit.
sha256string · required- SHA-256 of the original, lowercase hexadecimal.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID/direct-uploads" \
-H "Authorization: Bearer $PICHAUS_API_KEY" \
-H 'Content-Type: application/json' --data @upload.json{
"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>"
}
}
}Finalize a direct S3 upload
photos:upload/albums/{id}/direct-uploads/{uploadId}/finalizeAfter 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.
Request body 2
thumbnailfile · required- Orientation-correct WebP, at most 400 × 400 pixels and 512 KiB.
metadatastring · required- 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.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID/direct-uploads/$UPLOAD_ID/finalize" \
-H "Authorization: Bearer $PICHAUS_API_KEY" \
-F 'thumbnail=@thumb.webp' -F 'metadata=<metadata.json'{
"success": true,
"data": {
"photoId": "7f79938d-54c3-4a68-bc2a-bf59d741e275",
"duplicate": false
}
}200 · Success
{
"success": true,
"data": {
"photoId": "7f79938d-54c3-4a68-bc2a-bf59d741e275",
"duplicate": true
}
}Check photo processing
photos:read/albums/{id}/photos/{photoId}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.
curl --fail-with-body \
"$PICHAUS_API/albums/$ALBUM_ID/photos/$PHOTO_ID" \
-H "Authorization: Bearer $PICHAUS_API_KEY"{
"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"
}
}200 · Example while processing
{
"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"
}
}Download an image
photos:read/photos/{photoId}/{variant}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.
curl --fail-with-body \
"$PICHAUS_API/photos/$PHOTO_ID/thumb" \
-H "Authorization: Bearer $PICHAUS_API_KEY" \
--output thumbnail.imageContent-Type: image/webpErrors & limits
All API timestamps are Unix seconds (UTC). Paginated responses include page, limit, total, and hasMore; advance page until hasMore is false. Results can shift between pages if albums or photos change.
Each account can make 120 read and 30 write requests per minute across all its keys. Requests may also be limited by IP. On 429, wait for the number of seconds in Retry-After.
Photo responses include signedUrl and signedThumbnailUrl: presigned storage URLs that fetch the image without your API key until signedUrlExpiresAt (about 5 minutes). Do not send your key to them, and request the photo again for fresh URLs. They are null when the storage does not support direct delivery; use url and thumbnailUrl with your key instead.
Album and view-link creation require an Idempotency-Key (1–128 letters, digits, or ._:-). Use a fresh key for each action. To retry, send the same key and payload within 24 hours. Reusing a key with different input returns 409; a deleted, expired, revoked, or inaccessible resource is not recreated.
400- Invalid request. Check the parameters, body, and required headers.
401- Missing, invalid, expired, or revoked API key.
403- The key is missing a required scope, or the workspace plan does not allow the action.
404- The resource does not exist or is outside the key’s access.
409- The idempotency key was reused with different input, or the same photo is still uploading.
410- The upload session expired or the uploaded photo was deleted.
413- The upload is too large.
429- Rate limit reached. Wait for
Retry-Afterbefore retrying. 500- Unexpected server error. Only retry a write when it is safe to replay.
503- Temporarily unavailable. Honor
Retry-Afterwhen present.
{
"statusCode": 403,
"statusMessage": "Missing required scope: photos:read",
"message": "Missing required scope: photos:read"
}