---
title: "Add a gallery design to the organization"
method: POST
path: "/v2/organizations/{organizationId}/templates/from-gallery"
tags: ["Template gallery"]
---

# Add a gallery design to the organization

`POST /v2/organizations/{organizationId}/templates/from-gallery`

## Request

- Base URL: `https://api.pdfs.build`
- URL: `https://api.pdfs.build/v2/organizations/{organizationId}/templates/from-gallery`
- Auth: HTTP bearer

Copies a gallery design into your organization as a template of your own and, unless `publish` is `false`, publishes it in the same call so the render API can use it at once. Give it an `externalId` to render it by a slug of your choosing; the default is the new template's UUID. The copy is yours from then on: edits, versions and the published-template quota are the organization's, and the gallery is never rendered from directly.

## Request body

- FromGalleryRequest
  - `galleryId` string, required
  - `externalId` string: The slug to render the copy by. 1-128 URL-safe characters; defaults to the new template's UUID.
  - `name` string: A name for the copy; defaults to the design's.
  - `publish` boolean: `false` leaves the copy as a draft for the editor instead of publishing it.

## Response `201`

The new template. `publishedVersion` is the version the API serves, or `null` when `publish` was `false`.

- FromGalleryResult
  - `id` string, uuid, required
  - `externalId` string, required
  - `galleryId` string, required
  - `name` string, required
  - `status` 'draft' | 'published', required
  - `publishedVersion` integer, nullable, required

## Other responses

- `400`: `invalid_from_gallery_request` (with `issues`) or `invalid_external_id`.
- `401`: Missing, invalid or expired API key.
- `402`: `template_limit_reached`: publishing one more template would pass the plan's published-template limit.
- `403`: The organization in the URL does not match the API key's organization.
- `404`: `gallery_template_not_found`.
- `409`: `external_id_conflict`: the organization already has a template with that external id.
- `422`: The design failed the compile gate; the draft is kept and returned as `template`.
- `502`: The service that owns this resource could not be reached. Safe to retry.

---

[API](https://skmtc.dev/pdfs/apis/pdfs-build-api.md) · [All operations](https://skmtc.dev/pdfs/apis/pdfs-build-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pdfs/apis/pdfs-build-api/revisions/1c7340b9521d?raw)
