---
title: "Mint a signed upload URL for a pack-opening template GLB"
method: POST
path: "/api/admin/packs/upload-glb-template"
tags: ["Admin", "Packs"]
---

# Mint a signed upload URL for a pack-opening template GLB

`POST /api/admin/packs/upload-glb-template`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/admin/packs/upload-glb-template`
- Auth: HTTP bearer

Team templates (canManageTeam) land at teams/{teamId}/templates/. Global templates require scope "global" and an admin, and land at templates/. Omitting teamId without scope global is rejected. The file never passes through this route: PUT it to signedUrl, then POST /api/admin/packs/confirm-upload with kind "glb-template" before persisting modelUrl and glbTemplateVersion. Validation: .glb, MIME model/gltf-binary or application/octet-stream, 1 byte–10MB, magicBytes start with glTF. Header, material slots, and extensions are checked on confirm.

## Request body

- object
  - `teamId` string: Team id or slug. Required unless scope is global.
  - `scope` 'team' | 'global'
  - `fileName` string, required
  - `fileSize` integer, required
  - `mimeType` 'model/gltf-binary' | 'application/octet-stream', required
  - `magicBytes` string, byte, required: Base64 of the file's first ≥4 bytes.

## Response `200`

{ signedUrl, token, path, publicUrl, bucket, contentType }

- object
  - `success` true, required
  - `data` object, required
    - `signedUrl` string, required
    - `token` string, required
    - `path` string, required: Storage key under teams/{teamId}/templates/ or templates/, ending in .glb.
    - `publicUrl` string, required
    - `bucket` 'pack-assets', required
    - `contentType` 'model/gltf-binary' | 'application/octet-stream', required

## Other responses

- `400`: VALIDATION_ERROR — bad extension, MIME, size (max 10MB), or magic bytes; or missing teamId
- `401`: Authentication required
- `403`: FORBIDDEN — caller cannot manage the team
- `500`: Signed URL mint failed

## Changes

- **2026-11-18** `6de639c52609`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/admin/packs/upload-glb-template/post.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
