Presentations API

Manage presentations and the artworks shown in them

A presentation is a record of an event where artworks were shown: an exhibition, an art fair booth, an online viewing room, or a grant or residency application. Each one has a venue, dates, and a checklist of artworks in order. Artists keep presentations in Valise to build their exhibition history and CV.

The API doesn’t include a presentation’s photos or documents yet. We plan to add them.

How presentations work

A presentation points to its artworks by ID. To show one with its artworks, combine it with other records:

  • A presentation’s artworkIds are the IDs of artworks, in checklist order.
  • An artwork has the title, year, medium, and dimensions, and its images in gallery order. The first image is the one Valise shows for the artwork.
  • An artwork’s artistIds are the IDs of contacts, and a contact has the artist’s name. You need these to credit each artwork in a group show, or when a vault holds artworks by more than one artist.

To find the presentations an artwork has been in, list presentations and keep the ones with the artwork’s ID in artworkIds.

Use the list endpoints when you’re showing more than a few records. A list request returns up to 100 records, so a vault of 1,000 artworks takes 10 requests. Getting those artworks one at a time takes 1,000 requests, and the API allows 300 a minute.

The presentation object

FieldTypeDescription
idstringThe presentation’s ID.
titlestringThe title of the exhibition or event, up to 200 characters.
venuestringThe gallery, museum, fair, or other place that held the presentation, up to 200 characters.
locationstringThe city and country as text, like Montréal, Canada, up to 200 characters. It isn’t linked to the locations in the API.
typestringsolo or group.
startDatestringThe opening date, as a partial date: 2024, 2024-03, or 2024-03-10.
endDatestringThe closing date, in the same format.
notesstringPlain text, up to 8,000 characters.
artworkIdsstring[]The IDs of the artworks shown, in checklist order. Up to 100.
createdAtstringWhen the presentation was created, as a timestamp.
updatedAtstringWhen the presentation last changed.
{
  "id": "pq3x8vneh2kd0tz7wbm4ycs1",
  "title": "Quiet Rooms",
  "venue": "Gallery One",
  "location": "Montréal, Canada",
  "type": "solo",
  "startDate": "2024-03-10",
  "endDate": "2024-05",
  "notes": "Two rooms upstairs",
  "artworkIds": ["ahvxb9zbcew4a0fhroz9ijs0", "iogf1yv44dtudcam42a9rx8o"],
  "createdAt": "2024-09-06T11:17:15Z",
  "updatedAt": "2024-09-06T11:17:15Z"
}

The title, location, notes, startDate, and endDate fields are always in the response. They’re empty strings when they haven’t been filled in.

List presentations

The list is ordered by when each presentation was created, newest first. To order it by date, sort by the start date.

GET /v0/presentations
curl https://api.valise.works/v0/presentations \
  --header "Authorization: Bearer <API_KEY>"

Returns a page of presentations.

Get a presentation

GET /v0/presentations/{id}
curl https://api.valise.works/v0/presentations/pq3x8vneh2kd0tz7wbm4ycs1 \
  --header "Authorization: Bearer <API_KEY>"

Returns the presentation.

Create a presentation

POST /v0/presentations

The body takes venue, type, title, location, startDate, endDate, notes, and artworkIds. Only venue and type are required. The artworks in artworkIds go into the presentation in the order given.

Send each date as a partial date. The end date can’t be before the start date.

curl https://api.valise.works/v0/presentations \
  --request POST \
  --header "Authorization: Bearer <API_KEY>" \
  --header "Content-Type: application/json" \
  --data '{"venue": "Gallery One", "type": "solo", "startDate": "2024-03-10", "artworkIds": ["ahvxb9zbcew4a0fhroz9ijs0"]}'

Returns the new presentation. If one of the artworkIds isn’t in your vault or is listed twice, the API returns a 400 naming it and creates nothing. If your vault is at its plan’s limit of presentations, the API returns a 409.

Update a presentation

PATCH /v0/presentations/{id}

The body takes the same fields as creating a presentation, except artworkIds, all optional. Fields you leave out keep their value. To clear the title, location, notes, or a date, pass an empty string.

To change the artworks in the presentation, add, remove, or reorder them.

curl https://api.valise.works/v0/presentations/pq3x8vneh2kd0tz7wbm4ycs1 \
  --request PATCH \
  --header "Authorization: Bearer <API_KEY>" \
  --header "Content-Type: application/json" \
  --data '{"endDate": "2024-05"}'

Returns the updated presentation. The API checks the dates you send against the saved ones, and returns a 400 if the end date would come before the start date.

Delete a presentation

The artworks in the presentation aren’t deleted. This can’t be undone.

DELETE /v0/presentations/{id}
curl https://api.valise.works/v0/presentations/pq3x8vneh2kd0tz7wbm4ycs1 \
  --request DELETE \
  --header "Authorization: Bearer <API_KEY>"

Returns no content.

Add an artwork to a presentation

POST /v0/presentations/{id}/artworks

The body takes the artworkId of the artwork to add. The artwork goes at the end of the checklist.

curl https://api.valise.works/v0/presentations/pq3x8vneh2kd0tz7wbm4ycs1/artworks \
  --request POST \
  --header "Authorization: Bearer <API_KEY>" \
  --header "Content-Type: application/json" \
  --data '{"artworkId": "ahvxb9zbcew4a0fhroz9ijs0"}'

Returns the updated presentation. Adding an artwork that’s already in the presentation changes nothing. If the artwork isn’t in your vault, the API returns a 404. If the presentation already has 100 artworks, it returns a 409.

Remove an artwork from a presentation

The artwork itself isn’t deleted.

DELETE /v0/presentations/{id}/artworks/{artworkId}
curl https://api.valise.works/v0/presentations/pq3x8vneh2kd0tz7wbm4ycs1/artworks/ahvxb9zbcew4a0fhroz9ijs0 \
  --request DELETE \
  --header "Authorization: Bearer <API_KEY>"

Returns no content, even when the artwork isn’t in the presentation.

Reorder a presentation

POST /v0/presentations/{id}/reorder

The body takes artworkIds: every artwork in the presentation, exactly once, in the new order. This endpoint only changes the order. It can’t add or remove artworks.

curl https://api.valise.works/v0/presentations/pq3x8vneh2kd0tz7wbm4ycs1/reorder \
  --request POST \
  --header "Authorization: Bearer <API_KEY>" \
  --header "Content-Type: application/json" \
  --data '{"artworkIds": ["iogf1yv44dtudcam42a9rx8o", "ahvxb9zbcew4a0fhroz9ijs0"]}'

Returns the updated presentation. If the list doesn’t match the presentation’s artworks, the API returns a 400 naming each artwork that’s missing, duplicated, or not in the presentation.

Examples

Exhibition history

An exhibition history lists every presentation from newest to oldest, with its venue, title, location, dates, and artworks. To build one:

  1. List the presentations and the artworks, following page.next on each until it’s null.
  2. Map the artworks by ID, so each ID in a checklist finds its artwork without another request.
  3. Sort the presentations by startDate. Partial dates sort in date order as text.
  4. Build an entry for each presentation, formatting each date at the precision it has and looking up each artwork in the map.

Here’s the whole flow in JavaScript:

const headers = { Authorization: "Bearer <API_KEY>" }

// Follows page.next until it has every record.
const listAll = async (path) => {
  const records = []
  let next = `https://api.valise.works${path}`
  while (next) {
    const response = await fetch(next, { headers })
    if (!response.ok) throw new Error(`${response.status} from ${next}`)
    const body = await response.json()
    records.push(...body.data)
    next = body.page.next
  }
  return records
}

// Formats "2024", "2024-05", or "2024-05-10" with only the parts it has.
const formatPartialDate = (value, locale = "en-US") => {
  if (!value) return ""
  const [year, month, day] = value.split("-").map(Number)
  const date = new Date(Date.UTC(year, (month ?? 1) - 1, day ?? 1))
  return date.toLocaleDateString(locale, {
    timeZone: "UTC",
    year: "numeric",
    month: month ? "long" : undefined,
    day: day ? "numeric" : undefined,
  })
}

// 1. List the presentations and the artworks
const [presentations, artworks] = await Promise.all([
  listAll("/v0/presentations"),
  listAll("/v0/artworks"),
])

// 2. Map the artworks by ID
const artworksById = new Map(artworks.map((artwork) => [artwork.id, artwork]))

// 3. Sort by start date, newest first
presentations.sort((a, b) => b.startDate.localeCompare(a.startDate))

// 4. Build an entry for each presentation
const history = presentations.map((presentation) => ({
  venue: presentation.venue,
  title: presentation.title,
  location: presentation.location,
  // A Set drops the end date when it's the same as the start.
  dates: [...new Set([presentation.startDate, presentation.endDate])]
    .filter(Boolean)
    .map((date) => formatPartialDate(date))
    .join(" – "),
  works: presentation.artworkIds
    // Skips a work deleted between the two requests.
    .flatMap((id) => artworksById.get(id) ?? [])
    .map((artwork) => ({
      title: artwork.title,
      year: artwork.year,
      medium: artwork.medium,
      image: artwork.images[0]?.url,
    })),
}))

For the example presentation, the entry is:

{
  "venue": "Gallery One",
  "title": "Quiet Rooms",
  "location": "Montréal, Canada",
  "dates": "March 10, 2024 – May 2024",
  "works": [
    {
      "title": "Morning Grid",
      "year": "1962",
      "medium": "Acrylic on paper",
      "image": "https://uploads.valise.works/..."
    }
    // ...
  ]
}

A presentation with no dates sorts last and has an empty dates. An artwork with no images has no image. An artwork’s year is text as the artist entered it, like c. 2023. Show it as written.

Have more questions?

We're here to help. If you didn't find what you were looking for, or have more questions feel free to reach out.

Contact Us