Uploading templates
Upload the Nubu Builder's template package as a zip and let Nubu read it.
A template arrives through the API as the package the Nubu Builder exports: one .zip. Nubu reads it after the upload and checks it exactly as the upload drawer in the app would.
What the package must contain
- the
.nubu.jsonschema and the After Effects.aepproject the Builder exported; - a
thumbnail.jpgorthumbnail.pngat the top level; - an
examplesfolder with one rendered example per comp, each named after its comp (for exampleREEL_10S_1080x1920.mp4orREEL_10S_1080x1920_EXAMPLE.mp4); - an After Effects version Nubu supports.
The Builder's export has all of this. A package that does not is refused with every problem named, and nothing half-finished enters the gallery.
Uploading
The flow is the asset upload's: begin, PUT the zip, complete. A package that would not fit the organisation's remaining storage is refused at the begin, and at a replacement, with 409 conflict and details.reason storage_full; deleting templates frees the space at once.
curl -X POST https://app.nubu.app/api/v1/templates/uploads \
-H "Authorization: Bearer nubu_api_..." \
-H "Content-Type: application/json" \
-d '{ "filename": "summer-sale.zip", "size_bytes": 83211042, "name": "Summer sale" }'
The answer (201) carries the template_id and an upload plan (a single PUT at or under 100 MiB, else multipart parts; see Uploading assets for the part mechanics, with POST /templates/uploads/<template_id>/parts for fresh part URLs). PUT the zip with Content-Type: application/zip, then complete:
curl -X POST https://app.nubu.app/api/v1/templates/uploads/<template_id>/complete \
-H "Authorization: Bearer nubu_api_..." \
-H "Content-Type: application/json" \
-d '{}'
(Send { "upload_id": "..." } for a multipart upload.) Nubu reads the package, and the answer carries the ready template: its comps, the examples with the comp each one belongs to, and a download_url for the package.
A refused package answers 422 validation_failed; details lists one entry per problem, each with a code:
| Code | Meaning |
|---|---|
not_a_zip | The upload is not a zip archive. |
missing_schema | No .nubu.json in the package. |
missing_aep | No .aep project in the package. |
invalid_schema | The .nubu.json could not be read. |
missing_version, unsupported_version | The package declares no After Effects version, or one Nubu does not support. |
no_thumbnail | No thumbnail.jpg or thumbnail.png. |
no_examples, too_many_examples | No examples, or more than twelve. |
example_unmatched | An example matches no comp by name (examples names it). |
example_ambiguous | Two examples match the same comp (examples and comp name them). |
Fix the package and upload it again. POST /templates/uploads/<template_id>/abort abandons an upload before it is completed.
Reading, editing, replacing and deleting
GET /templateslists templates (filters:folder_id,status,q,tag);GET /templates/<id>adds the comps, the examples and a 15-minutedownload_urlfor the package.PATCH /templates/<id>with any ofname,tagsandfolder_id.- Replacing a package keeps the template id and every flow that uses it.
POST /templates/<id>/replacewithsize_bytesanswers anuploadplan and aversion; PUT the new zip, thenPOST /templates/<id>/replace/completewith thatversion(and theupload_idfor a multipart one). The new package is checked like a fresh upload; until it passes, the current package stays live.POST /templates/<id>/replace/partsre-mints part URLs andPOST /templates/<id>/replace/abortdiscards the attempt. DELETE /templates/<id>removes the template and its files. A template used by a creative that is queued or rendering answers409 conflictuntil that render finishes.