# Photoshoots

> Turns product photos into shoot photos: on a model, on a ghost mannequin or on a mannequin.

## Tasks

- [Create a photoshoot](https://docs.refabric.com/task-api-reference/photoshoot.create) — `photoshoot.create`: Shoot your garments on AI models: each product on each model in its poses, on one backdrop, with optional product views. Delivered as one record whose items are the images.
- [Create a ghost photoshoot](https://docs.refabric.com/task-api-reference/ghost_photoshoot.create) — `ghost_photoshoot.create`: Shoot your products with nobody in them: on an invisible mannequin, laid flat or in close-up, one image per view. Delivered as one record whose items are the images.
- [Create a mannequin photoshoot](https://docs.refabric.com/task-api-reference/mannequin_photoshoot.create) — `mannequin_photoshoot.create`: Put the garments of mannequin or worn photos on AI models, keeping each photo's pose and framing. Delivered as one record whose items are the images.

## Quick start (`photoshoot.create`)

```python
import os
import time
import requests

headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}

job = requests.post(
    "https://api.refabric.com/v1/tasks/photoshoot.create",
    headers=headers,
    json={
        "products": [
            {
                "image": "file:812",
            },
        ],
        "models": [
            "model:5501",
        ],
    },
).json()
print(job["job_id"])

while True:
    status = requests.get(job["status_url"], headers=headers).json()
    if status["lifecycle"] == "terminal":
        break
    time.sleep(5)

print(requests.get(job["result_url"], headers=headers).json())
```

```javascript
const headers = {
  Authorization: `Key ${process.env.REFABRIC_API_KEY}`,
  "Content-Type": "application/json",
};

const job = await fetch("https://api.refabric.com/v1/tasks/photoshoot.create", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "products": [
      {
        "image": "file:812"
      }
    ],
    "models": [
      "model:5501"
    ]
  }),
}).then((r) => r.json());
console.log(job.job_id);

let status = job;
while (status.lifecycle !== "terminal") {
  await new Promise((r) => setTimeout(r, 5000));
  status = await fetch(job.status_url, { headers }).then((r) => r.json());
}

console.log(await fetch(job.result_url, { headers }).then((r) => r.json()));
```

```bash
curl -X POST "https://api.refabric.com/v1/tasks/photoshoot.create" \
  -H "Authorization: Key $REFABRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Prefer: wait=60" \
  -d '{"products":[{"image":"file:812"}],"models":["model:5501"]}'
```
