---
title: "Add a free photo from the search to the site's pictures"
method: POST
path: "/builder/sessions/{sessionId}/photos/import"
tags: ["Builder"]
---

# Add a free photo from the search to the site's pictures

`POST /builder/sessions/{sessionId}/photos/import`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/builder/sessions/{sessionId}/photos/import`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `sessionId` string, uuid, required

## Request body

- object
  - `id` string, required
  - `alt` string

## Response `201`

Stored

- object
  - `uploadId` string, uuid, required
  - `src` string, required: The picture's address on the site, e.g. /assets/team-3f2a9c1d.webp
  - `width` integer, required
  - `height` integer, required
  - `alt` string, nullable, required
  - `source` 'upload' | 'openverse' | 'ai', required
  - `license` object, nullable, required
  - `variants` object[], required
    - `src` string, required
    - `width` integer, required
  - `createdAt` string, required: ISO-8601 timestamp

## Other responses

- `400`: Invalid request (code invalid_request; details.reason: invalid, unmappable, not_found, secret_detected, unsupported, too_large, unreadable)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Refused for now (code conflict; details.reason: turn_running while the AI changes the site, stale when the files changed since the editor loaded them (details.version: the current one), previewing_version, archived, in_use)
- `429`: Too many changes at once (code rate_limited); see Retry-After
- `501`: Not available on this server (code not_configured)
- `503`: The photo could not be downloaded (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
