{"openapi":"3.1.0","info":{"title":"Socialphotos API","version":"1.0.0","description":"Manage Shopify customer photo and video galleries, curate incoming uploads and social posts, tag Shopify products, manage Upload Pages, import Instagram and TikTok links, and read storefront analytics."},"servers":[{"url":"https://socialphotosapp.com/api/v1","description":"Socialphotos API v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Per-store API key created in Settings -> API & MCP (format: sp_live_...)."}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object"}},"required":["code","message"]}},"required":["error"]},"PaginationMeta":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total_count":{"type":"integer"},"total_pages":{"type":"integer"}}}}},"paths":{"/account":{"get":{"summary":"Get authenticated store account summary and plan capabilities","tags":["Account"],"responses":{"200":{"description":"Store summary and counts"}}}},"/sources":{"get":{"summary":"List incoming customer uploads and social posts across sources","tags":["Sources"],"parameters":[{"name":"source_type","in":"query","schema":{"type":"string","enum":["upload_page","customer_upload","bulk_upload","instagram_post","instagram_tag","instagram_mention","instagram_story","instagram_hashtag","instagram_link","tiktok_link"]}},{"name":"upload_page_id","in":"query","schema":{"type":"integer"}},{"name":"media_type","in":"query","schema":{"type":"string","enum":["IMAGE","VIDEO"]}},{"name":"curated","in":"query","schema":{"type":"boolean"}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100}}],"responses":{"200":{"description":"Paginated source items"}}}},"/sources/{source_type}/{id}":{"get":{"summary":"Get one source item","tags":["Sources"],"parameters":[{"name":"source_type","in":"path","required":true,"schema":{"type":"string","enum":["upload_page","customer_upload","bulk_upload","instagram_post","instagram_tag","instagram_mention","instagram_story","instagram_hashtag","instagram_link","tiktok_link"]}},{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Source item"}}},"delete":{"summary":"Delete a source item (preserves independent curated copies and gallery placements)","tags":["Sources"],"parameters":[{"name":"source_type","in":"path","required":true,"schema":{"type":"string","enum":["upload_page","customer_upload","bulk_upload","instagram_post","instagram_tag","instagram_mention","instagram_story","instagram_hashtag","instagram_link","tiktok_link"]}},{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"}}}},"/photos":{"get":{"summary":"List curated photos","tags":["Photos"],"parameters":[{"name":"gallery_id","in":"query","schema":{"type":"integer"}},{"name":"product_id","in":"query","schema":{"type":"integer"}},{"name":"media_type","in":"query","schema":{"type":"string","enum":["IMAGE","VIDEO"]}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100}}],"responses":{"200":{"description":"Paginated curated photos"}}}},"/photos/curate":{"post":{"summary":"Curate a source item into one or more galleries and/or tagged products","tags":["Photos"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["source_type","source_id"],"properties":{"source_type":{"type":"string","enum":["upload_page","customer_upload","bulk_upload","instagram_post","instagram_tag","instagram_mention","instagram_story","instagram_hashtag","instagram_link","tiktok_link"]},"source_id":{"type":"integer"},"gallery_ids":{"type":"array","items":{"type":"integer"}},"product_ids":{"type":"array","items":{"type":"integer"}}}}}}},"responses":{"201":{"description":"Curated photo created and placed"},"200":{"description":"Existing curated photo placed"}}}},"/photos/{id}":{"get":{"summary":"Get one curated photo with gallery and product placements","tags":["Photos"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Curated photo"}}},"patch":{"summary":"Update curated photo caption or username","tags":["Photos"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"caption":{"type":"string"},"username":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated curated photo"}}},"delete":{"summary":"Delete curated photo and all placements (preserves original source record)","tags":["Photos"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"}}}},"/galleries":{"get":{"summary":"List page galleries","tags":["Galleries"],"parameters":[{"name":"include_deleted","in":"query","schema":{"type":"boolean","default":false}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100}}],"responses":{"200":{"description":"Paginated galleries"}}},"post":{"summary":"Create a page gallery","tags":["Galleries"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"visible":{"type":"boolean","default":true}}}}}},"responses":{"201":{"description":"Gallery created"}}}},"/galleries/{id}":{"get":{"summary":"Get a gallery and its ordered photos","tags":["Galleries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Gallery details"}}},"patch":{"summary":"Update a gallery title or visibility","tags":["Galleries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Updated gallery"}}},"delete":{"summary":"Soft-delete a gallery","tags":["Galleries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Deleted"}}}},"/galleries/{id}/photos":{"post":{"summary":"Add a curated photo or source item to a gallery","tags":["Galleries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"201":{"description":"Added to gallery"}}}},"/galleries/{id}/photos/{photo_id}":{"delete":{"summary":"Remove a photo from a gallery (keeps curated photo and other placements)","tags":["Galleries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"photo_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Removed"}}}},"/galleries/{id}/reorder":{"put":{"summary":"Reorder photos in a gallery (top of gallery first)","tags":["Galleries"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Reordered gallery"}}}},"/products":{"get":{"summary":"List synced Shopify products","tags":["Products"],"parameters":[{"name":"search","in":"query","schema":{"type":"string"}},{"name":"has_photos","in":"query","schema":{"type":"boolean"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100}}],"responses":{"200":{"description":"Paginated products"}}}},"/products/sync":{"post":{"summary":"Trigger async Shopify product sync","tags":["Products"],"responses":{"202":{"description":"Sync queued"}}}},"/products/{id}":{"get":{"summary":"Get a product and its ordered tagged photos","tags":["Products"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Product details"}}}},"/products/{id}/photos":{"post":{"summary":"Tag a product on a curated photo or source item (Advanced+ plan)","tags":["Products"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"201":{"description":"Product tagged"},"402":{"description":"Advanced or Premium plan required"}}}},"/products/{id}/photos/{photo_id}":{"delete":{"summary":"Remove a product tag from a photo (Advanced+ plan)","tags":["Products"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"photo_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Untagged"}}}},"/products/{id}/reorder":{"put":{"summary":"Reorder tagged photos on a product gallery (Advanced+ plan)","tags":["Products"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Reordered product gallery"}}}},"/upload_pages":{"get":{"summary":"List Upload Pages and shareable public URLs","tags":["Upload Pages"],"responses":{"200":{"description":"Paginated Upload Pages"}}},"post":{"summary":"Create an Upload Page","tags":["Upload Pages"],"responses":{"201":{"description":"Upload Page created"}}}},"/upload_pages/{id}":{"get":{"summary":"Get one Upload Page","tags":["Upload Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Upload Page"}}},"patch":{"summary":"Rename or enable/disable an Upload Page","tags":["Upload Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Updated Upload Page"}}},"delete":{"summary":"Retire an Upload Page and its source uploads (preserves curated copies)","tags":["Upload Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Retired"}}}},"/imports":{"get":{"summary":"List recent Instagram and TikTok link imports","tags":["Imports"],"parameters":[{"name":"platform","in":"query","schema":{"type":"string","enum":["instagram","tiktok"]}},{"name":"limit","in":"query","schema":{"type":"integer","default":25,"maximum":100}}],"responses":{"200":{"description":"Recent imports"}}}},"/imports/instagram":{"post":{"summary":"Queue an Instagram post or reel URL for import","tags":["Imports"],"responses":{"202":{"description":"Import queued"}}}},"/imports/tiktok":{"post":{"summary":"Queue a TikTok video or photo post URL for import","tags":["Imports"],"responses":{"202":{"description":"Import queued"}}}},"/analytics/overview":{"get":{"summary":"Get gallery impressions, photo views, clicks, and product clicks","tags":["Analytics"],"parameters":[{"name":"start_date","in":"query","schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Analytics overview"}}}}}}