# Media tools

[All tool areas](/docs/tools.md). Each tool acts within your access.

## Media

### add_photo_from_url

Add a photo to guest pages from a public https address: the API fetches it once the change is applied (JPEG, PNG, WebP, or AVIF, at most 10 MB) and puts it after the subject's other photos. Photos belong to the organization (neither productId nor locationId), a location, a product, or a product at one location (both). The first photo of a product is its cover. Alt text is required. Returns a preview to confirm; the fetch happens on apply, so a bad image fails then.

Changes · Members of an organization · Needs content:write

#### Input

- `productId` — string; optional. A product's photos (with locationId: the product's photos at that location only)
- `locationId` — string; optional. A location's photos (with productId: see productId)
- `url` — string; required. A public https address of the image maxLength: 2000
- `altText` — string; required. What the photo shows, for screen readers and when it can't load (required: guest pages show every photo with its alt text) minLength: 1; maxLength: 300

#### Output

- `id` — string; required. 
- `subject` — object; required. 
  - `subject.kind` — string; required.  Allowed: "organization", "location", "product", "product\_location"
  - `subject.productId` — string or null; required. 
  - `subject.locationId` — string or null; required. 
- `src` — string; required. The original image's address
- `key` — string; required. Its key on the media host: responsive sizes are `<media host>/cdn-cgi/image/width=<w>,format=auto/<key>`
- `alt` — string; required. 
- `width` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `height` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `contentType` — string; required.  Allowed: "image/jpeg", "image/png", "image/webp", "image/avif"
- `byteSize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `position` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `sourceUrl` — string or null; required. 

### get_content

Get what guest pages show for one subject, as staff edit it: its photos in order (with ids, alt text, and size) and its content (the organization's profile, a product's or a location's content; a product at a location has photos only). Photos belong to the organization (neither productId nor locationId), a location, a product, or a product at one location (both). Use before changing content or photos.

Reads · Members of an organization · Needs content:read

#### Input

- `productId` — string; optional. A product's photos (with locationId: the product's photos at that location only)
- `locationId` — string; optional. A location's photos (with productId: see productId)

#### Output

- `images` — object; required. 
  - `images.baseUrl` — string; required. The media host
  - `images.transformations` — boolean; required. Whether the media host resizes: `<baseUrl>/cdn-cgi/image/width=<w>,format=auto/<key>` (Cloudflare Image Transformations). When false (local development), use `src`
- `subject` — object; required. 
  - `subject.kind` — string; required.  Allowed: "organization", "location", "product", "product\_location"
  - `subject.productId` — string or null; required. 
  - `subject.locationId` — string or null; required. 
- `organizationProfile` — object or null; required. 
  - `organizationProfile.pitch` — string or null; required.  minLength: 1; maxLength: 300
  - `organizationProfile.coverPhotoId` — string or null; required. 
  - `organizationProfile.logoPhotoId` — string or null; required. 
  - `organizationProfile.about` — object or null; required. 
    - `organizationProfile.about.title` — string; required.  minLength: 1; maxLength: 120
    - `organizationProfile.about.body` — string; required.  minLength: 1; maxLength: 4000
    - `organizationProfile.about.photoId` — string or null; required.  default: null
  - `organizationProfile.privateEvents` — object or null; required. 
    - `organizationProfile.privateEvents.title` — string; required.  minLength: 1; maxLength: 120
    - `organizationProfile.privateEvents.body` — string; required.  minLength: 1; maxLength: 2000
    - `organizationProfile.privateEvents.photoId` — string or null; required.  default: null
    - `organizationProfile.privateEvents.email` — string or null; required.  format: "email"; maxLength: 254; default: null
  - `organizationProfile.contact` — object; required. 
    - `organizationProfile.contact.email` — string or null; required.  format: "email"; maxLength: 254; default: null
    - `organizationProfile.contact.phone` — string or null; required.  minLength: 1; maxLength: 40; default: null
  - `organizationProfile.socials` — array; required.  maxItems: 10
    - `organizationProfile.socials[]` — object; optional. 
      - `organizationProfile.socials[].label` — string; required.  minLength: 1; maxLength: 40
      - `organizationProfile.socials[].url` — string; required.  format: "uri"; maxLength: 500
  - `organizationProfile.faqs` — array; required.  maxItems: 30
    - `organizationProfile.faqs[]` — object; optional. 
      - `organizationProfile.faqs[].question` — string; required.  minLength: 1; maxLength: 300
      - `organizationProfile.faqs[].answer` — string; required.  minLength: 1; maxLength: 2000
- `productContent` — object or null; required. 
  - `productContent.tagline` — string or null; required.  minLength: 1; maxLength: 200
  - `productContent.facts` — array; required.  maxItems: 8
    - `productContent.facts[]` — object; optional. 
      - `productContent.facts[].icon` — string; required.  Allowed: "clock", "users", "age", "language", "utensils", "accessibility", "shirt", "door", "ticket"
      - `productContent.facts[].label` — string; required.  minLength: 1; maxLength: 80
  - `productContent.highlights` — array; required.  maxItems: 12
    - `productContent.highlights[]` — object; optional. 
      - `productContent.highlights[].title` — string; required.  minLength: 1; maxLength: 120
      - `productContent.highlights[].body` — string; required.  minLength: 1; maxLength: 1000
      - `productContent.highlights[].photoId` — string or null; required.  default: null
  - `productContent.steps` — array; required.  maxItems: 12
    - `productContent.steps[]` — object; optional. 
      - `productContent.steps[].title` — string; required.  minLength: 1; maxLength: 120
      - `productContent.steps[].body` — string; required.  minLength: 1; maxLength: 1000
      - `productContent.steps[].photoId` — string or null; required.  default: null
  - `productContent.goodToKnow` — array; required.  maxItems: 12
    - `productContent.goodToKnow[]` — object; optional. 
      - `productContent.goodToKnow[].icon` — string; required.  Allowed: "clock", "users", "age", "language", "utensils", "accessibility", "shirt", "door", "ticket"
      - `productContent.goodToKnow[].title` — string; required.  minLength: 1; maxLength: 120
      - `productContent.goodToKnow[].body` — string; required.  minLength: 1; maxLength: 1000
  - `productContent.faqs` — array; required.  maxItems: 30
    - `productContent.faqs[]` — object; optional. 
      - `productContent.faqs[].question` — string; required.  minLength: 1; maxLength: 300
      - `productContent.faqs[].answer` — string; required.  minLength: 1; maxLength: 2000
- `locationContent` — object or null; required. 
  - `locationContent.venueName` — string or null; required.  minLength: 1; maxLength: 120
  - `locationContent.directions` — string or null; required.  minLength: 1; maxLength: 1000
- `photos` — array; required. 
  - `photos[]` — object; optional. 
    - `photos[].id` — string; required. 
    - `photos[].subject` — object; required. 
      - `photos[].subject.kind` — string; required.  Allowed: "organization", "location", "product", "product\_location"
      - `photos[].subject.productId` — string or null; required. 
      - `photos[].subject.locationId` — string or null; required. 
    - `photos[].src` — string; required. The original image's address
    - `photos[].key` — string; required. Its key on the media host: responsive sizes are `<media host>/cdn-cgi/image/width=<w>,format=auto/<key>`
    - `photos[].alt` — string; required. 
    - `photos[].width` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].height` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].contentType` — string; required.  Allowed: "image/jpeg", "image/png", "image/webp", "image/avif"
    - `photos[].byteSize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].position` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].sourceUrl` — string or null; required. 

### remove_photo

Remove a photo from guest pages. Content that shows it (a highlight, the cover) is left without a photo. It can be undone for 15 minutes; after that the file is deleted. Returns a preview to confirm.

Changes · Members of an organization · Needs content:write

#### Input

- `photoId` — string; required. The media's id, from get_content

#### Output

- `id` — string; required. 
- `removed` — boolean; required.  Value: true

### reorder_photos

Put a subject's photos in a new order: list every one of its photos (get_content) once, first to last. A product's first photo is its cover. Photos belong to the organization (neither productId nor locationId), a location, a product, or a product at one location (both). Returns a preview to confirm.

Changes · Members of an organization · Needs content:write

#### Input

- `productId` — string; optional. A product's photos (with locationId: the product's photos at that location only)
- `locationId` — string; optional. A location's photos (with productId: see productId)
- `photoIds` — array; required.  minItems: 1; maxItems: 100
  - `photoIds[]` — string; optional. The media's id, from get_content

#### Output

- `photos` — array; required. 
  - `photos[]` — object; optional. 
    - `photos[].id` — string; required. 
    - `photos[].subject` — object; required. 
      - `photos[].subject.kind` — string; required.  Allowed: "organization", "location", "product", "product\_location"
      - `photos[].subject.productId` — string or null; required. 
      - `photos[].subject.locationId` — string or null; required. 
    - `photos[].src` — string; required. The original image's address
    - `photos[].key` — string; required. Its key on the media host: responsive sizes are `<media host>/cdn-cgi/image/width=<w>,format=auto/<key>`
    - `photos[].alt` — string; required. 
    - `photos[].width` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].height` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].contentType` — string; required.  Allowed: "image/jpeg", "image/png", "image/webp", "image/avif"
    - `photos[].byteSize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].position` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `photos[].sourceUrl` — string or null; required. 

### update_location_content

Change what guest pages say about a location: the venue's name as guests know it (when it isn't the location's own, such as a partner restaurant) and arrival directions. The address is the location's own (update_location). Fields left out stay; null clears one. Returns a preview to confirm.

Changes · Members of an organization · Needs content:write

#### Input

- `locationId` — string; required. The location's id, from get_setup
- `venueName` — string or null; optional.  minLength: 1; maxLength: 120
- `directions` — string or null; optional.  minLength: 1; maxLength: 1000

#### Output

- `venueName` — string or null; required.  minLength: 1; maxLength: 120
- `directions` — string or null; required.  minLength: 1; maxLength: 1000

### update_organization_profile

Change the organization's homepage: its one-line pitch, cover photo and logo, about (title, story, photo), private events (title, pitch, photo, inquiry email), contact email and phone, social links, and FAQs. Each field given replaces that field whole; fields left out stay; null clears one. Photos are the organization's own (get_content with no product or location). Returns a preview to confirm.

Changes · Members of an organization · Needs content:write

#### Input

- `pitch` — string or null; optional.  minLength: 1; maxLength: 300
- `coverPhotoId` — string or null; optional. One of the organization's photos (get_content lists them)
- `logoPhotoId` — string or null; optional. One of the organization's photos (get_content lists them)
- `about` — object or null; optional. 
  - `about.title` — string; required.  minLength: 1; maxLength: 120
  - `about.body` — string; required.  minLength: 1; maxLength: 4000
  - `about.photoId` — string or null; optional. One of the organization's photos (get_content lists them) default: null
- `privateEvents` — object or null; optional. 
  - `privateEvents.title` — string; required.  minLength: 1; maxLength: 120
  - `privateEvents.body` — string; required.  minLength: 1; maxLength: 2000
  - `privateEvents.photoId` — string or null; optional. One of the organization's photos (get_content lists them) default: null
  - `privateEvents.email` — string or null; optional.  format: "email"; maxLength: 254; default: null
- `contact` — object; optional. 
  - `contact.email` — string or null; optional.  format: "email"; maxLength: 254; default: null
  - `contact.phone` — string or null; optional.  minLength: 1; maxLength: 40; default: null
- `socials` — array; optional.  maxItems: 10
  - `socials[]` — object; optional. 
    - `socials[].label` — string; required.  minLength: 1; maxLength: 40
    - `socials[].url` — string; required.  format: "uri"; maxLength: 500
- `faqs` — array; optional.  maxItems: 30
  - `faqs[]` — object; optional. 
    - `faqs[].question` — string; required.  minLength: 1; maxLength: 300
    - `faqs[].answer` — string; required.  minLength: 1; maxLength: 2000

#### Output

- `pitch` — string or null; required.  minLength: 1; maxLength: 300
- `coverPhotoId` — string or null; required. 
- `logoPhotoId` — string or null; required. 
- `about` — object or null; required. 
  - `about.title` — string; required.  minLength: 1; maxLength: 120
  - `about.body` — string; required.  minLength: 1; maxLength: 4000
  - `about.photoId` — string or null; required.  default: null
- `privateEvents` — object or null; required. 
  - `privateEvents.title` — string; required.  minLength: 1; maxLength: 120
  - `privateEvents.body` — string; required.  minLength: 1; maxLength: 2000
  - `privateEvents.photoId` — string or null; required.  default: null
  - `privateEvents.email` — string or null; required.  format: "email"; maxLength: 254; default: null
- `contact` — object; required. 
  - `contact.email` — string or null; required.  format: "email"; maxLength: 254; default: null
  - `contact.phone` — string or null; required.  minLength: 1; maxLength: 40; default: null
- `socials` — array; required.  maxItems: 10
  - `socials[]` — object; optional. 
    - `socials[].label` — string; required.  minLength: 1; maxLength: 40
    - `socials[].url` — string; required.  format: "uri"; maxLength: 500
- `faqs` — array; required.  maxItems: 30
  - `faqs[]` — object; optional. 
    - `faqs[].question` — string; required.  minLength: 1; maxLength: 300
    - `faqs[].answer` — string; required.  minLength: 1; maxLength: 2000

### update_photo

Change a photo's alt text (what it shows, for screen readers). Returns a preview to confirm.

Changes · Members of an organization · Needs content:write

#### Input

- `photoId` — string; required. The media's id, from get_content
- `altText` — string; required. What the photo shows, for screen readers and when it can't load (required: guest pages show every photo with its alt text) minLength: 1; maxLength: 300

#### Output

- `id` — string; required. 
- `subject` — object; required. 
  - `subject.kind` — string; required.  Allowed: "organization", "location", "product", "product\_location"
  - `subject.productId` — string or null; required. 
  - `subject.locationId` — string or null; required. 
- `src` — string; required. The original image's address
- `key` — string; required. Its key on the media host: responsive sizes are `<media host>/cdn-cgi/image/width=<w>,format=auto/<key>`
- `alt` — string; required. 
- `width` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `height` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `contentType` — string; required.  Allowed: "image/jpeg", "image/png", "image/webp", "image/avif"
- `byteSize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `position` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
- `sourceUrl` — string or null; required. 

### update_product_content

Change what a product's page says: its tagline, facts (short lines with an icon), highlights, what you'll do (steps), good to know, and FAQs. Each field given replaces that field whole (send the full list); fields left out stay. Highlights and steps can show one of the product's own photos (photoId). Returns a preview to confirm.

Changes · Members of an organization · Needs content:write

#### Input

- `productId` — string; required. The product's id, from list_products
- `tagline` — string or null; optional.  minLength: 1; maxLength: 200
- `facts` — array; optional.  maxItems: 8
  - `facts[]` — object; optional. 
    - `facts[].icon` — string; required.  Allowed: "clock", "users", "age", "language", "utensils", "accessibility", "shirt", "door", "ticket"
    - `facts[].label` — string; required.  minLength: 1; maxLength: 80
- `highlights` — array; optional.  maxItems: 12
  - `highlights[]` — object; optional. 
    - `highlights[].title` — string; required.  minLength: 1; maxLength: 120
    - `highlights[].body` — string; required.  minLength: 1; maxLength: 1000
    - `highlights[].photoId` — string or null; optional. One of the product's photos (get_content lists them) default: null
- `steps` — array; optional.  maxItems: 12
  - `steps[]` — object; optional. 
    - `steps[].title` — string; required.  minLength: 1; maxLength: 120
    - `steps[].body` — string; required.  minLength: 1; maxLength: 1000
    - `steps[].photoId` — string or null; optional. One of the product's photos (get_content lists them) default: null
- `goodToKnow` — array; optional.  maxItems: 12
  - `goodToKnow[]` — object; optional. 
    - `goodToKnow[].icon` — string; required.  Allowed: "clock", "users", "age", "language", "utensils", "accessibility", "shirt", "door", "ticket"
    - `goodToKnow[].title` — string; required.  minLength: 1; maxLength: 120
    - `goodToKnow[].body` — string; required.  minLength: 1; maxLength: 1000
- `faqs` — array; optional.  maxItems: 30
  - `faqs[]` — object; optional. 
    - `faqs[].question` — string; required.  minLength: 1; maxLength: 300
    - `faqs[].answer` — string; required.  minLength: 1; maxLength: 2000

#### Output

- `tagline` — string or null; required.  minLength: 1; maxLength: 200
- `facts` — array; required.  maxItems: 8
  - `facts[]` — object; optional. 
    - `facts[].icon` — string; required.  Allowed: "clock", "users", "age", "language", "utensils", "accessibility", "shirt", "door", "ticket"
    - `facts[].label` — string; required.  minLength: 1; maxLength: 80
- `highlights` — array; required.  maxItems: 12
  - `highlights[]` — object; optional. 
    - `highlights[].title` — string; required.  minLength: 1; maxLength: 120
    - `highlights[].body` — string; required.  minLength: 1; maxLength: 1000
    - `highlights[].photoId` — string or null; required.  default: null
- `steps` — array; required.  maxItems: 12
  - `steps[]` — object; optional. 
    - `steps[].title` — string; required.  minLength: 1; maxLength: 120
    - `steps[].body` — string; required.  minLength: 1; maxLength: 1000
    - `steps[].photoId` — string or null; required.  default: null
- `goodToKnow` — array; required.  maxItems: 12
  - `goodToKnow[]` — object; optional. 
    - `goodToKnow[].icon` — string; required.  Allowed: "clock", "users", "age", "language", "utensils", "accessibility", "shirt", "door", "ticket"
    - `goodToKnow[].title` — string; required.  minLength: 1; maxLength: 120
    - `goodToKnow[].body` — string; required.  minLength: 1; maxLength: 1000
- `faqs` — array; required.  maxItems: 30
  - `faqs[]` — object; optional. 
    - `faqs[].question` — string; required.  minLength: 1; maxLength: 300
    - `faqs[].answer` — string; required.  minLength: 1; maxLength: 2000
