# Socialphotos REST API v1 & Remote MCP Server

> Manage a Shopify store's Socialphotos customer photo and video galleries programmatically or from AI agents (Claude Code, Cursor, Codex, ChatGPT Custom GPT Actions, and Streamable HTTP MCP clients).

- REST API base URL: `https://socialphotosapp.com/api/v1`
- OpenAPI 3.1 JSON schema (public): `https://socialphotosapp.com/api/v1/openapi.json`
- Remote MCP server (Streamable HTTP JSON-RPC 2.0): `https://socialphotosapp.com/mcp`
- MCP Server Card: `https://socialphotosapp.com/.well-known/mcp/server-card.json`
- RFC 9727 API Catalog: `https://socialphotosapp.com/.well-known/api-catalog`
- HTML docs: https://socialphotosapp.com/support/api

## Authentication & Plans

Create a per-store Bearer API key (`sp_live_...`) inside the Socialphotos app under **Settings -> API & MCP** (`https://socialphotosapp.com/settings/api`).

- Pass `Authorization: Bearer sp_live_...` on every REST and MCP request.
- Access levels: `read_write` (Full access) or `read` (Read only). Up to 10 active keys per store.
- Plan requirements: Active **Basic ($19/mo)**, **Advanced ($35/mo)**, or **Premium ($55/mo)** plan. Setup, Free, and canceled stores return HTTP `402` (`plan_required`).
- Product tagging and product gallery reordering require **Advanced** or **Premium** (HTTP `402`, `plan_upgrade_required` on Basic). Storefront video display requires **Premium**.
- Rate limits: 120 requests/minute per API key across REST and MCP, 30 write requests/minute on REST endpoints, 10 Instagram/TikTok link imports/minute.

## Step-by-Step Curation Workflow

Socialphotos stores content as **Sources -> Curated Photos (`Submission`) -> Page Galleries & Tagged Products**:

1. **Inspect incoming uncurated items:** Call `list_sources(curated: false)` (or `GET /api/v1/sources?curated=false`). Each item includes `id`, `source_type`, `media_type`, `username`, `caption`, `thumbnail_url`, `media_url`, and `curated`.
2. **Inspect destinations:** Call `list_galleries` (page galleries) and `list_products` (synced Shopify products).
3. **Approve (curate) selected photos:** Call `curate_photo(source_type, source_id, gallery_ids: [...], product_ids: [...])` (or `POST /api/v1/photos/curate`). This creates an independent curated copy, places it in the chosen galleries/products, flips `curated: true`, and fires Klaviyo `Approved Customer Photo` once on first curation if connected.
4. **Reject unwanted items:** Call `delete_source(source_type, id)` (or `DELETE /api/v1/sources/:source_type/:id`) to remove unwanted items from incoming sources. Deleting a source preserves any independent curated copies already created from it.
5. **Reorder or edit:** Use `reorder_gallery` (`PUT /api/v1/galleries/:id/reorder`) with `photo_ids` ordered top-of-gallery first, or `update_photo` (`PATCH /api/v1/photos/:id`) to edit captions/usernames.

## Connecting AI Agents

### Claude Code (Remote MCP)

```bash
claude mcp add --transport http socialphotos https://socialphotosapp.com/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"
```

### Cursor (`.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "socialphotos": {
      "url": "https://socialphotosapp.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

### ChatGPT Custom GPT Actions (OpenAPI + Bearer Key)

1. Open **Explore GPTs -> Create -> Configure -> Actions -> Create new action**.
2. Click **Import from URL** and enter `https://socialphotosapp.com/api/v1/openapi.json`.
3. Under **Authentication**, choose **API Key**, set **Auth Type** to **Bearer**, and paste your `sp_live_...` key.
4. Ask the GPT to list uncurated photos with thumbnail previews, suggest gallery/product matches, and curate the ones you approve.

## MCP Tools (21 Tools)

Read-only API keys expose only the 8 read-only tools in `tools/list` and reject write calls with `insufficient_scope`.

| Tool | Mode | Description |
| --- | --- | --- |
| `get_account` | Read | Get the authenticated store account summary, active plan, plan capabilities (product tagging, video display), and high-level counts of galleries, curated photos, products, and Upload Pages. |
| `list_sources` | Read | List incoming customer photo and video sources (Upload Page uploads, storefront customer uploads, bulk uploads, Instagram posts/tags/mentions/stories/hashtags/links, and TikTok links). Shows whether each item is already curated and its gallery/product placements. |
| `delete_source` | Write | Delete an incoming source record by source_type and id. Preserves any independent curated photo copy and its gallery/product placements. |
| `list_photos` | Read | List curated customer photos and videos with their gallery and tagged product placements. |
| `curate_photo` | Write | Curate an incoming source item (source_type + source_id) into an independent curated copy and add it to page galleries and/or tag Shopify products. Can also place an already curated photo (photo_id) into additional galleries or products. Product tagging requires the Advanced or Premium plan. |
| `update_photo` | Write | Update the caption and/or username displayed on a curated photo. |
| `delete_photo` | Write | Delete a curated photo and remove it from all galleries and tagged products. Leaves the original source item intact. |
| `list_galleries` | Read | List page galleries for the store along with visibility and photo counts. |
| `get_gallery` | Read | Get one page gallery along with its ordered curated photos (top-of-gallery first). |
| `create_gallery` | Write | Create a new page gallery (along with its widget settings) that can be embedded on Shopify pages. |
| `update_gallery` | Write | Rename a page gallery or toggle whether it is visible on the storefront. |
| `remove_from_gallery` | Write | Remove a curated photo from one page gallery while keeping the curated photo and its other gallery or product placements. |
| `reorder_gallery` | Write | Set the display order of curated photos inside a page gallery. Pass photo_ids from first (top of gallery) to last. |
| `list_products` | Read | List or search synced Shopify products with their internal id, shopify_product_id, handle, storefront url, and tagged photo count. |
| `tag_product` | Write | Tag a Shopify product on a curated photo (photo_id) or directly curate and tag an incoming source item (source_type + source_id). Requires the Advanced or Premium plan. |
| `untag_product` | Write | Remove a Shopify product tag from a curated photo while keeping the curated photo and its other placements. Requires the Advanced or Premium plan. |
| `list_upload_pages` | Read | List active customer Upload Pages with their shareable public_url, enabled state, and upload count. |
| `create_upload_page` | Write | Create a new hosted Upload Page link to share in post-purchase emails, SMS, QR codes, or support replies. |
| `update_upload_page` | Write | Rename an Upload Page or enable/disable it. |
| `import_social_link` | Write | Queue an asynchronous import of an Instagram post/reel URL or a TikTok video/photo URL into the store sources. |
| `get_analytics` | Read | Get gallery and product page photo analytics (gallery views, product views, total impressions, photo views, photo clicks, and product clicks) for a date range (default last 7 days, max 365 days). |

## REST API v1 Endpoints

| Endpoint | Summary |
| --- | --- |
| `GET /api/v1/account` | Get authenticated store account summary and plan capabilities |
| `GET /api/v1/sources` | List incoming customer uploads and social posts across sources |
| `GET /api/v1/sources/{source_type}/{id}` | Get one source item |
| `DELETE /api/v1/sources/{source_type}/{id}` | Delete a source item (preserves independent curated copies and gallery placements) |
| `GET /api/v1/photos` | List curated photos |
| `POST /api/v1/photos/curate` | Curate a source item into one or more galleries and/or tagged products |
| `GET /api/v1/photos/{id}` | Get one curated photo with gallery and product placements |
| `PATCH /api/v1/photos/{id}` | Update curated photo caption or username |
| `DELETE /api/v1/photos/{id}` | Delete curated photo and all placements (preserves original source record) |
| `GET /api/v1/galleries` | List page galleries |
| `POST /api/v1/galleries` | Create a page gallery |
| `GET /api/v1/galleries/{id}` | Get a gallery and its ordered photos |
| `PATCH /api/v1/galleries/{id}` | Update a gallery title or visibility |
| `DELETE /api/v1/galleries/{id}` | Soft-delete a gallery |
| `POST /api/v1/galleries/{id}/photos` | Add a curated photo or source item to a gallery |
| `DELETE /api/v1/galleries/{id}/photos/{photo_id}` | Remove a photo from a gallery (keeps curated photo and other placements) |
| `PUT /api/v1/galleries/{id}/reorder` | Reorder photos in a gallery (top of gallery first) |
| `GET /api/v1/products` | List synced Shopify products |
| `POST /api/v1/products/sync` | Trigger async Shopify product sync |
| `GET /api/v1/products/{id}` | Get a product and its ordered tagged photos |
| `POST /api/v1/products/{id}/photos` | Tag a product on a curated photo or source item (Advanced+ plan) |
| `DELETE /api/v1/products/{id}/photos/{photo_id}` | Remove a product tag from a photo (Advanced+ plan) |
| `PUT /api/v1/products/{id}/reorder` | Reorder tagged photos on a product gallery (Advanced+ plan) |
| `GET /api/v1/upload_pages` | List Upload Pages and shareable public URLs |
| `POST /api/v1/upload_pages` | Create an Upload Page |
| `GET /api/v1/upload_pages/{id}` | Get one Upload Page |
| `PATCH /api/v1/upload_pages/{id}` | Rename or enable/disable an Upload Page |
| `DELETE /api/v1/upload_pages/{id}` | Retire an Upload Page and its source uploads (preserves curated copies) |
| `GET /api/v1/imports` | List recent Instagram and TikTok link imports |
| `POST /api/v1/imports/instagram` | Queue an Instagram post or reel URL for import |
| `POST /api/v1/imports/tiktok` | Queue a TikTok video or photo post URL for import |
| `GET /api/v1/analytics/overview` | Get gallery impressions, photo views, clicks, and product clicks |
