> ## Documentation Index
> Fetch the complete documentation index at: https://docs.9pic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Photo Sources

> List photo sources and review adding a shared folder.

## Overview

List configured photo sources or review adding a shared folder. Adding a source does not import photos.

OAuth only. Read calls require `events:read`. Writes require both `events:read` and `events:write`, plus an accepted organiser **admin** membership. Send a bearer token without `X-API-Key`.

## Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `org_id` | integer | Yes | Organiser where the caller has an accepted membership. |
| `event_id` | integer | Yes | Event owned by that organiser. |

## GET — List Sources

```
GET /api/v1/ext/{org_id}/event/{event_id}/photo-sources
```

### Example Request

```bash cURL theme={null}
curl -i -X GET \
  -H "Authorization: Bearer <oauth_access_token>" \
  "https://api.9pic.ai/api/v1/ext/903/event/456/photo-sources"
```

```python Python theme={null}
import requests

response = requests.get(
    "https://api.9pic.ai/api/v1/ext/903/event/456/photo-sources",
    headers={"Authorization": "Bearer <oauth_access_token>"},
)
print(response.status_code, response.json())
```

```javascript JavaScript theme={null}
const response = await fetch("https://api.9pic.ai/api/v1/ext/903/event/456/photo-sources", {
  method: "GET",
  headers: { "Authorization": "Bearer <oauth_access_token>" },
});
console.log(await response.json());
```

### Example Response

```json theme={null}
{
  "responseType": "success",
  "message": "Records",
  "data": {
    "event_id": 456,
    "sources": [
      {
        "source_id": 1,
        "name": "9Pic Storage",
        "provider": "9pic_storage",
        "url": null,
        "status": "new"
      }
    ],
    "total": 1
  }
}
```

## POST — Add Source

```
POST /api/v1/ext/{org_id}/event/{event_id}/photo-sources
```

### Request Body

Required fields: `name` (1–100 characters), `provider` (`googledrive`, `dropbox`, `onedrive`, `sharepoint`) and `url` (up to 1000 characters). Use a supported HTTPS shared-folder URL without credentials or fragments. The provider integration must already be available.

This write runs in one call: send `mode: "execute"` with a stable `idempotency_key`. No review token or confirmation is needed. `mode: "preview"` remains available as an optional dry run that returns `proposed` and `consequences` without changing anything. See [Operations](/api-reference/operations) for retry rules and status tracking.

### Example Request

```bash cURL theme={null}
curl -i -X POST \
  -H "Authorization: Bearer <oauth_access_token>" \
  -H "Content-Type: application/json" \
  "https://api.9pic.ai/api/v1/ext/903/event/456/photo-sources" \
  -d '{"mode": "execute", "idempotency_key": "event-456-source-race-photos", "name": "Race photos", "provider": "googledrive", "url": "https://drive.google.com/drive/folders/example-folder"}'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.9pic.ai/api/v1/ext/903/event/456/photo-sources",
    headers={"Authorization": "Bearer <oauth_access_token>"},
    json={'mode': 'execute', 'idempotency_key': 'event-456-source-race-photos', 'name': 'Race photos', 'provider': 'googledrive', 'url': 'https://drive.google.com/drive/folders/example-folder'},
)
print(response.status_code, response.json())
```

```javascript JavaScript theme={null}
const response = await fetch("https://api.9pic.ai/api/v1/ext/903/event/456/photo-sources", {
  method: "POST",
  headers: { "Authorization": "Bearer <oauth_access_token>", "Content-Type": "application/json" },
  body: JSON.stringify({"mode": "execute", "idempotency_key": "event-456-source-race-photos", "name": "Race photos", "provider": "googledrive", "url": "https://drive.google.com/drive/folders/example-folder"}),
});
console.log(await response.json());
```

### Example Response

```json theme={null}
{
  "responseType": "success",
  "message": "Source added",
  "data": {
    "mode": "execute",
    "operation": "add_photo_source",
    "org_id": 903,
    "event_id": 456,
    "review_token": null,
    "expires_at": null,
    "proposed": {
      "name": "Race photos",
      "provider": "googledrive",
      "url": "https://drive.google.com/drive/folders/example-folder"
    },
    "consequences": [
      "Adds a shared-folder source. Import must be started separately."
    ],
    "operation_id": "ddc661a7-8861-4793-9437-af42a82d12f8",
    "status": "completed",
    "result": {
      "event_id": 456,
      "source_id": 2,
      "name": "Race photos",
      "provider": "googledrive"
    }
  }
}
```

## Response Models

[PhotoSourcesData](/api-reference/models/workflow#photosourcesdata) and [GuardedOperationData](/api-reference/models/workflow#guardedoperationdata).

## Error Responses

| Status | Meaning |
| - | - |
| `400` / `422` | Invalid input or missing `idempotency_key` at execution. |
| `401` | Invalid or expired access token. |
| `403` | Missing scopes, membership, admin role, or entitlement. |
| `404` | Event configuration or caller-owned operation not found. |
| `409` | Retry key reused for a different action, duplicate source, active work, or state conflict. |
| `503` | Organiser writes are temporarily unavailable. |

See [Errors](/api-reference/errors) and [Conventions](/api-reference/conventions).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.