# Articlore API (version 1.0.0) Base URL: https://app.articlore.com/v1 Upload 3D data (point clouds, meshes, scene layers) and GeoTIFF orthophotos or elevation models, follow their processing, and stream the result to your own application: 3D data as [3D Tiles](https://docs.ogc.org/cs/22-025r4/22-025r4.html), rasters as web map tiles. **Guides:** [quick start](/docs/guides/quick-start.md), [uploading from a script](/docs/guides/uploading.md), [viewer tokens](/docs/guides/viewer-tokens.md), [webhooks](/docs/guides/webhooks.md), [desktop apps](/docs/guides/desktop-apps.md), [processing errors](/docs/guides/processing-errors.md) (every `failure.code`). For AI coding tools, the whole documentation is plain text at [/llms.txt](/llms.txt) and [/llms-full.txt](/llms-full.txt). **Authentication.** Every call carries an API token: `Authorization: Bearer tk_live_…`. Create tokens in the app under *API tokens*. A token has scopes (below) and may be limited to some projects or assets and to the web domains that may stream with it. Calls outside what a token applies to get 403 `ACC_000`, or 404 for assets it cannot see. **Streaming.** A processed asset streams from `https://tiles.articlore.com/{assetId}/tileset.json?token=…` (or with the same `Authorization` header). Pages that show a viewer should not carry a long-lived token: let your server mint a short-lived viewer token for each page with `POST /tokens/{id}/viewer`. A raster asset (`type: raster`) streams as XYZ map tiles, 256 pixels, Web Mercator: `https://tiles.articlore.com/{assetId}/{z}/{x}/{y}.webp` for imagery (`rasterKind: imagery`; transparent where the files have no data) and `…/{z}/{x}/{y}.png` for elevation (`rasterKind: elevation`; Terrarium encoding, height = R × 256 + G + B / 256 − 32768 metres, as MapLibre's `raster-dem` reads with `encoding: "terrarium"`). `https://tiles.articlore.com/{assetId}/tilejson.json?token=…` describes them (TileJSON 3.0: zoom levels, bounds, and tile URLs that carry the same token). GeoTIFFs, and PNG or JPEG images with a world file of their name (`.pgw`, `.jgw`, `.wld`; with a `.prj` or `srsIn` for the coordinate system), are a raster; uploaded with a mesh they are its textures. Such an image is always imagery. **Text point files.** `.xyz` and `.pts` are points. A `.txt` or `.csv` is points when it is uploaded without other data and its first lines hold numbers; next to other data it is taken for notes and left out. Their columns are found from a first line that names them or from their number; `textLayout` says them when that is wrong (a `failure.code` of `columns_not_recognised`, or a point cloud that looks wrong), for all text files of the asset at once. **Rate limit.** 600 calls a minute per token (bursts of 120). Over it: 429 `RTL_000` with `Retry-After`. **Errors** are `{"code": "AST_000", "message": "…", "timestamp": "…"}`. Codes: `AUT_000` unknown, revoked or expired token; `BCR_000` no token; `AUT_001` route is for the web app only; `ACC_000` outside the token's projects or assets; `ACC_002` the account is suspended (payment overdue: reads and deletions still work, nothing else; 402); `ACC_003` the account was closed (403); `ACC_004` the organisation has a payment open and cannot be deleted by its Owner (409); `ACC_005` sign in again first (deleting the organisation, web app only; 403); `ACC_006` and `ACC_007` two-factor sign-in is missing (web app only; API tokens are never asked for it; 403, 409); `AST_*` assets; `UPL_*` uploads; `PRJ_*` projects; `QTA_*` plan limits (402 or 429). Limits come from the organisation's plan, with what support added; a lower limit never removes what exists, it only stops adding more. **Uploading** is four steps. Bytes go straight to storage, never through this API: 1. `POST /uploads` with the files' names and sizes: creates the asset(s) and one upload session per file. Send an `Idempotency-Key` header (a UUID you make, new for each upload) so that retrying a request whose answer you did not get returns the same assets instead of making new ones. 2. For each part `n` (1-based, `chunkSize` bytes each, the last one shorter): `POST /uploads/{session}/parts/{n}` gives a presigned URL; `PUT` exactly that part's bytes to it (the URL is signed for its length); then `POST /uploads/{session}/parts/{n}/uploaded`. 3. `POST /uploads/{session}/complete` for each session. 4. Processing starts once every file of an asset is complete. A webhook tells you when it ends (below), or poll `GET /assets/{id}` until `state` is `ready` (or `failed`). **Zips.** A zip is one asset: point clouds or GeoTIFFs (also in folders, and with the same file names in several of them), one mesh with its textures, one SLPK, or a 3D Tiles folder. What is inside need not be listed: the list of files is read from the zip itself when its upload is completed, before the asset is queued. Until then the asset's `type` is `point-cloud` and its `sourceFormat` `ZIP`, and the zip's own size counts against your processing limit; what it unpacks to does from then on. If you do send the list (`entries` with each file's unpacked size), the same rules apply when the upload is created, so a wrong zip is refused before a byte is sent. **Webhooks.** Register an https URL with `POST /webhooks` and the events you want: `asset.processing` (a processor started a run; again on each retry, with `data.attempt`), `asset.processed`, `asset.failed`, `asset.needs_files` (an OBJ's textures were not uploaded) and `usage.warning` (80 % or all of a plan limit used: storage, or this month's streaming or processing; with a streaming allowance also when streaming stops, `level` 100 + the allowance; once a month per meter and level, also emailed to owners and admins). A webhook is told about the assets of every project, or of those in `projectIds` (the project the asset is in when the event happens); `usage.warning` and `ping` are about no project and sent whatever the projects. Each event is a `POST` of JSON (`WebhookPayload`) with `X-Articlore-Event`, `X-Articlore-Delivery` (one id per delivery) and `X-Articlore-Signature: t=,v1=`, where `v1` is the HMAC-SHA256 of `.` keyed with the webhook's `secret`. Check it before trusting a delivery, and refuse ones whose `t` is old: ```js const [t, v1] = sig.split(",").map((p) => p.slice(p.indexOf("=") + 1)); const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"); const ok = crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected)) && Math.abs(Date.now() / 1000 - Number(t)) < 300; ``` Answer with any 2xx within 10 seconds. Anything else is retried after 1 min, 5 min, 30 min, 2 h, 6 h and 12 h, then given up; `GET /webhooks/{id}/deliveries` shows each try. An event can arrive more than once: use the payload's `id` to do it once. The person who uploaded an asset in the app also gets an email. # Guide: Desktop apps: QGIS, ArcGIS Pro, game engines Desktop applications stream with the token in the URL, like a web page does: `https://tiles.articlore.com/{assetId}/tileset.json?token=…` (3D Tiles) or `https://tiles.articlore.com/{assetId}/{z}/{x}/{y}.webp?token=…` (imagery; `.png` for imagery processed at quality *Original*: the asset's `tilejson.json` names the right one). Two things to know: - **No allowed domains.** A token limited to some websites only streams to browsers on those sites (they send `Origin` or `Referer`); a desktop application sends neither and is refused. Use a token with an empty *Allowed domains* list for desktop apps, and a short-lived viewer token where you can ([Viewer tokens](viewer-tokens.md)). - **The token must reach every tile.** CesiumJS-based apps keep the `?token=` of the tileset URL on every tile request. Where an app does not, give it the token as a custom request parameter (`token` = your token) rather than in the URL. ArcGIS Pro documents this as *Custom request parameters* when adding a 3D tiles layer from a path. Our sample pages for ArcGIS Pro, QGIS, Unreal and Unity follow once each is tried on a real machine. What ArcGIS Pro 3.7 reads from 3D Tiles (Esri's table): meshes as `b3dm` or glTF content, with Draco, meshopt (new in 3.7), KTX2 and WebP; no point-cloud 3D Tiles (`pnts`), no implicit tiling. Our meshes are glTF content with meshopt and KTX2, so Pro 3.7 should read them; older Pro versions need uncompressed tiles (quality *Original*). # Guide: Processing errors When processing fails, the asset's `failure` (and the `asset.failed` / `asset.needs_files` webhook) says why: a `title` and `message` for people, and a stable `code` for your code to branch on. The message can change; the code does not. ## Something in the upload Change the files or a setting, then upload or process again. | Code | Title | What it means | What to do | |---|---|---|---| | `missing_files` | Missing files | The OBJ refers to material (.mtl) or texture files, the FBX, DAE or PLY to textures, or the glTF to buffers (.bin) or images, that were not uploaded. `missingFiles` lists them. | Add those files to the asset (POST /assets/{id}/files) and it is processed again, or process it without the textures (reprocess with skipMissingFiles; a glTF's buffers cannot be left out). | | `texture_too_large` | Texture too large | A texture is larger than 16384 × 16384 pixels, more than any graphics card can show. | Export the textures at 8192 pixels or less and upload them again. | | `texture_not_readable` | Texture not readable | A texture is not an image we can read: another file under that name, a damaged image, or a format other than PNG, JPEG, WebP, TIFF, BMP or TGA, such as DDS (glTF models: PNG, JPEG or WebP). | Save the texture as PNG or JPEG, check that it opens, and upload it again. | | `material_file_too_large` | Material file too large | A .mtl file is too large to be a material list; it is probably not one. | Check the .mtl file and upload the right one. | | `no_mesh` | No mesh | The upload holds no mesh file (.obj, .fbx, .dae, .ply, .gltf or .glb). | Upload the mesh with its textures. | | `one_mesh_per_asset` | One mesh per asset | A glTF or GLB model came with other meshes. Blocks of one mesh can be OBJ, FBX, DAE or PLY files; a glTF model is an asset of its own. | Upload each glTF or GLB as its own asset (mode separate), or export the blocks as OBJ, FBX, DAE or PLY. | | `too_many_blocks` | Too many blocks | The upload holds more meshes than one asset takes (2,000). | Upload them as several assets, or export larger blocks. | | `block_could_not_be_read` | Block could not be read | One of the meshes of an asset made of several is damaged, cut short or holds no faces; the message names it. The others are not tiled without it. | Export that block again, or leave it out, and upload the blocks again. | | `different_georeferences` | Different georeferences | The blocks of one mesh come with metadata.xml or .prj files that do not say the same coordinate system and origin; the message names two of them. | Export the blocks with one origin, or upload those of each origin as their own asset. | | `model_could_not_be_read` | Model could not be read | The model file (glTF, FBX, DAE or PLY) is damaged, cut short, or not what its name says; the message says what is wrong with it. | Export the model again and upload it again. | | `model_format_not_supported` | Model format not supported | An FBX file saved as text, or older than FBX 2011. | Save it as binary FBX 2011 or newer (or as OBJ or glTF) and upload it again. | | `model_too_large` | Model too large | An FBX, DAE or PLY file, or a mesh without textures, has more triangles than we read in one piece (20 million), or a DAE is larger than 1 GB. | Export the model in blocks and upload them together, as one asset (mode one). | | `one_slpk_per_asset` | One SLPK per asset | The asset holds more than one .slpk file, or a zip with several. | Upload each SLPK as its own asset. | | `georeference_could_not_be_read` | Georeference could not be read | The metadata.xml or .prj next to the mesh could not be read; the message says what is wrong with it. | Fix or remove the file, or set the coordinate system (srsIn) and upload again. | | `scene_layer_could_not_be_converted` | Scene layer could not be converted | The SLPK is damaged, is not an I3S package, or is a kind of scene layer we do not read yet (point cloud and building layers). The message says which. | Export the scene layer again as an integrated mesh or 3D object layer, or upload the source mesh instead. | | `one_tileset_per_asset` | One tileset per asset | An asset of existing 3D Tiles is one .3tz file or one zip of the tileset folder, and nothing else. | Upload the .3tz, or zip the folder holding tileset.json with its tiles, on its own. | | `no_tileset_json` | No tileset.json | The zip holds no tileset.json, so it is not a 3D Tiles tileset. | Zip the folder that holds tileset.json, with its tiles, and upload it again. | | `tileset_not_valid` | Tileset not valid | The tileset cannot be streamed as it is: a tile it names is missing or broken, or its JSON is wrong. The message names the file. | Check it with the 3D Tiles validator (github.com/CesiumGS/3d-tiles-validator), export it again and upload it. | | `no_files` | No files | The upload holds no point cloud file (LAS, LAZ, E57, PLY, XYZ, PTS, or points as .txt or .csv). | Upload the point cloud files, or a zip of them. | | `unsupported_file` | Unsupported file | A file is not a point cloud format we read. | Convert it to LAS or LAZ, or upload it as the type it is. | | `file_type_not_supported_yet` | File type not supported yet | The format is recognised but not processed yet. | Convert it to a supported format (see the upload page). | | `file_could_not_be_read` | File could not be read | A point cloud file is damaged, truncated, or its header does not match its content; the message names the file and the problem. | Export the file again and upload it again. | | `gaussian_splats_not_supported` | Gaussian splats not supported | A PLY file holds Gaussian splats, which we do not process yet; the message names it. As points they would be a meaningless cloud. | Upload the point cloud or the mesh they were made from. | | `no_points_found` | No points found | The upload holds only text files (.txt, .csv), and none of their first lines holds three numbers: a readme or a list, not points. | Upload the point cloud itself. | | `columns_not_recognised` | Columns not recognised | A text point cloud (XYZ, PTS, TXT, CSV) has columns we cannot tell apart, no X, Y and Z, decimal commas, or lines that do not fit; the message says which. | Choose its columns (textLayout, also when processing it again), or add a first line naming them, e.g. X,Y,Z,Red,Green,Blue,Intensity. Numbers need a decimal point. | | `columns_do_not_fit` | Columns do not fit | A text point cloud does not have the columns you chose: another number of them, another separator, or something that is not a number in one that is kept. The message names the file and shows the line. | Choose the columns again and process it again (textLayout). One choice is for files with the same columns: upload the others as their own asset. | | `different_coordinate_systems` | Different coordinate systems | The files of one asset are in different coordinate systems and cannot be merged. | Upload them as separate assets (mode separate), or reproject them to one system first. | | `unknown_coordinate_system` | Unknown coordinate system | The coordinate system written in the files, or the one you set, is not one we know. | Set an EPSG or ESRI code (srsIn), e.g. EPSG:25832, or EPSG:25832+5783 with a height system, and process again. | | `coordinate_system_not_supported` | Coordinate system not supported | The coordinate system cannot be turned into positions on Earth (it is local or geocentric in a way we cannot place). | Set the coordinate system the data was really captured in (srsIn), or place the asset on the map by hand after processing. | | `no_geotiff` | No GeoTIFF | A raster upload holds no GeoTIFF, and no PNG or JPEG with a world file. | Upload orthophotos or elevation models as GeoTIFF (.tif, .tiff), or images with their world files. | | `unreadable_file` | Unreadable file | A GeoTIFF, PNG or JPEG could not be read: it is damaged, truncated or not really one. | Export the file again and upload it again. | | `image_too_large` | Image too large | A PNG or JPEG has more pixels than we read from one image, or far more than a file of its size can really hold. The message says which. | Export it as a GeoTIFF, or cut it into several images, each with its world file. | | `not_georeferenced` | Not georeferenced | A GeoTIFF has no position on Earth (no geotags and no world file), or an image has no world file of its name we can read. | Export it with its georeference, or upload its world file (.tfw, .pgw, .jgw, .wld) and .prj with it. | | `no_coordinate_system` | No coordinate system | A GeoTIFF or image has a position but no coordinate system. | Set the coordinate system when uploading (srsIn), or upload its .prj with it. | | `not_on_the_map` | Not on the map | A GeoTIFF or image could not be placed on the web map grid: its coordinate system or extent cannot be shown in Web Mercator. | Check its coordinate system; reproject it (e.g. to EPSG:3857) and upload it again. | | `imagery_and_elevation_mixed` | Imagery and elevation mixed | One raster asset holds both images and elevation models. | Upload orthophotos and elevation models as separate assets. | | `no_heights` | No heights | The elevation model holds no heights: every pixel is empty (no data). | Check its no-data value and export it again. | | `tiling_failed` | Tiling failed | The tiler could not tile the data. The message says which step; it is usually a damaged or unusual file. | Check the file opens in another tool, export it again and process again. If it opens fine, contact support with the asset id. | | `import_failed` | Import failed | The file could not be fetched from the address given (POST /uploads/from-url): it is not https, not on the public internet, answered with an error (an expired presigned link), or its size differs from the size given. The message says which. | Check the address (a fresh presigned link) and the size, and import it again. Where the other side was only down for a moment, it is retried automatically. | | `source_file_missing` | Source file missing | An uploaded file is no longer in storage. | Upload the file again. | | `not_a_zip_file` | Not a zip file | The file ends in .zip and could not be opened as one: it is damaged, cut off, or another format. | Make the zip again, check that it opens, and upload it again. | | `damaged_zip_file` | Damaged zip file | The zip opened, and a file in it could not be read: it is damaged, or packed in a way we do not know (Deflate64, as Windows packs large files). | Make the zip again with ordinary (Deflate) compression, or without any, and upload it again. | | `empty_zip_file` | Empty zip file | The zip holds no files (folders, and what operating systems add, do not count). | Check what was put into the zip and upload it again. | | `encrypted_zip_file` | Encrypted zip file | The zip is protected with a password. | Make the zip without a password. | | `unsafe_zip_file` | Unsafe zip file | The zip holds a link, a file outside its own folder, or a name that cannot be used (3D Tiles packages: also a name over 255 bytes or a path over 900). | Make the zip again from the files themselves, with shorter names where the message says so. | | `two_files_with_the_same_name` | Two files with the same name | Two files of the upload would be one: in the same folder of a zip, or in a zip and next to it. The same name in different folders is fine, except where a model could mean either of two files (two textures or material files of one name that the folders in the model do not tell apart). | Rename one of them, also where another file refers to it, and upload again. | | `too_many_files_in_the_zip` | Too many files in the zip | The zip lists more files than we unpack (20,000). | Split it into several assets, or leave out the files that are not needed. | | `the_zip_unpacks_to_too_much` | The zip unpacks to too much | The files in the zip are larger than its listing said. | Make the zip again with an ordinary program and upload it again. | | `zip_cannot_be_processed` | Zip cannot be processed | What a zip sent without its list of files (`entries`) holds cannot become one asset: no file we process, or several kinds of data. The message says which. Completing the upload answers with the same message (400). | Zip each kind of data, and each mesh with its textures, separately and upload again. | | `files_of_different_kinds` | Files of different kinds | Some of the PLY files hold faces (meshes) and others, or the other files, only points. Completing the upload answers with the same message (400 `UPL_006`). | Upload the meshes and the point clouds as separate assets. | | `processing_limit_reached` | Processing limit reached | The files of a zip sent without its list of files (`entries`) unpack to more than your plan processes this month. Completing the upload answers with the same message (402 `QTA_001`). The files are kept. | Process the asset again (POST /assets/{id}/reprocess) when there is room, or ask for a larger plan. | | `processing_was_cancelled` | Processing was cancelled | You, or someone in your organisation, or support cancelled processing. The files are kept. | Process it again when you want (POST /assets/{id}/reprocess). | ## On our side These are retried automatically. You only need to act when the last attempt fails, as the table says. | Code | Title | What it means | What to do | |---|---|---|---| | `text_point_clouds_not_supported_here` | Text point clouds not supported here | The processor that took the job cannot read text point clouds. | Nothing: it is retried on another processor. | | `e57_support_missing` | E57 support missing | The processor that took the job cannot read E57 files. | Nothing: it is retried on another processor. If it keeps failing, contact support. | | `processor_ran_out_of_memory` | Processor ran out of memory | Our processor ran out of memory on these files. | Nothing: it is retried automatically, on its own. If every attempt fails, we are notified. | | `processor_ran_out_of_disk_space` | Processor ran out of disk space | Our processor ran out of working space. | Nothing: it is retried automatically. | | `too_large_for_this_processor` | Too large for this processor | These files need more working space than the processor that took them has. | Nothing: another processor is tried. If none is large enough, contact support. | | `storage_unavailable` | Storage unavailable | Our file storage did not answer. | Nothing: it is retried automatically. | | `processor_could_not_start_the_job` | Processor could not start the job | Our processor could not prepare its working space. | Nothing: it is retried automatically. | | `unsupported_pipeline` | Unsupported pipeline | The processor that took the job cannot process this type of data. | Nothing: it is retried on another processor. | | `mesh_tiler_missing` | Mesh tiler missing | The processor that took the job cannot tile meshes. | Nothing: it is retried on another processor. | | `raster_tools_missing` | Raster tools missing | The processor that took the job cannot read GeoTIFF files. | Nothing: it is retried on another processor. | | `processing_produced_invalid_tiles` | Processing produced invalid tiles | The tiles came out broken, so they were not published. The asset keeps streaming its previous version, if it has one. | Nothing to change on your side; we are notified. Contact support if you need it soon. | | `output_unexpectedly_large` | Output unexpectedly large | The tiles came out far larger than the source, which means something went wrong; nothing was published. | Contact support with the asset id. | | `processing_stalled` | Processing stalled | A tool stopped making progress: it printed nothing and did no work for 30 minutes, so it was stopped. | Nothing: it is retried automatically. If every attempt stalls, we are notified and look into it. | | `processing_took_too_long` | Processing took too long | Processing ran longer than the time limit (6 hours) and was stopped. | Split the data into smaller assets, or contact support. | | `processing_failed` | Processing failed | An error we did not expect stopped processing, or the result could not be published. The message carries a reference for support. | Nothing: it is retried automatically, and we are notified. If it keeps failing, contact support with the reference. | | `worker_restarted` | Processing failed | The processor stopped while working on these files on every attempt (most often out of memory). | Contact support with the asset id; splitting the data into smaller assets usually helps. | | `worker_silent` | Processing failed | We lost contact with the processor on every attempt. | Contact support with the asset id. | | `released_too_often` | Processing failed | The processor had to restart while working on these files too many times. | Contact support with the asset id. | # Guide: Quick start: from a file to a 3D view From TypeScript or a shell, the SDK and the `articlore` command line do all of this in one call (`sdks/typescript`; `articlore upload site.laz --wait`). By hand: You need an API token with `assets:write` (create one in the app under *API tokens*, preset *Full access* or a custom one). Every call below sends it as `Authorization: Bearer tk_live_…`. ```sh export API=https://app.articlore.com/v1 export TOKEN=tk_live_... ``` 1. Start the upload. The answer has the new asset and one upload session per file. ```sh curl -s -X POST "$API/uploads" \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{"files":[{"name":"site.laz","size":734003200}],"name":"Quarry survey","mode":"one"}' ``` 2. Upload the bytes part by part (see [Uploading from a script](uploading.md)), then complete each session. 3. Processing starts by itself. Wait for the `asset.processed` webhook ([Webhooks](webhooks.md)), or poll `GET /assets/{id}` until `state` is `ready` (or `failed`, with `failure.title` and `failure.message` saying why). 4. Stream it: `https://tiles.articlore.com/{assetId}/tileset.json?token=…` is a 3D Tiles tileset for CesiumJS, three.js (3DTilesRendererJS), deck.gl and other 3D Tiles viewers. Rasters stream as XYZ tiles (`tilejson.json`). On a public page, use a short-lived viewer token ([Viewer tokens](viewer-tokens.md)). The full reference is at [/docs/](../index.html); the same reference as plain text for AI tools is [/llms-full.txt](/llms-full.txt). # Guide: Uploading from a script Bytes go straight to storage, never through the API. An upload is resumable: parts already uploaded stay uploaded. 1. `POST /uploads` with every file's `name` and `size`. Send an `Idempotency-Key` header: a value you make (a UUID), new for each upload. If the answer is lost and you send the same request again with the same key within 24 hours, you get the same assets back, with their sessions as they are now, instead of new ones. The same key with a different request is refused (409 `UPL_009`). 2. For each session, the file is split into parts of `chunkSize` bytes (the last one shorter). For part `n` (1-based): - `POST /uploads/{sessionId}/parts/{n}` gives a presigned `url`; - `PUT` exactly that part's bytes to it (it is signed for that length; no `Authorization` header); - `POST /uploads/{sessionId}/parts/{n}/uploaded`. 3. `POST /uploads/{sessionId}/complete` once every part is in. When every file of an asset is complete, it is queued. What its files show to be wrong at once (a damaged file, a missing texture, a zip with a password) makes it `failed` in seconds, with the same `failure.code` as a processing run. To resume after a crash: `GET /assets/{id}/uploads` lists the sessions with `uploadedBytes` as storage sees them; upload the parts after that. To stop: `DELETE /assets/{id}/uploads` (a new asset is deleted with it). Several files can become one asset (`"mode":"one"`): point clouds are merged, a raster upload becomes one mosaic, several meshes are the blocks of one mesh (below), an OBJ, FBX, DAE or PLY takes its textures (and an OBJ its MTL), and a `.gltf` its `.bin` buffers and images (a `.glb` is one file). `"mode":"separate"` makes one asset per main file. Files of different kinds, such as a mesh next to point clouds, cannot become one asset (400 `UPL_006`). A glTF is placed on Earth from a `metadata.xml` with `ENU:lat,lon`, or on the map after processing (`PUT /assets/{id}/placement`); the other meshes from a `metadata.xml` (`` and ``, as ContextCapture, DJI Terra and Metashape write it), a `.prj`, or `srsIn`. ## Zips A zip is one asset: point clouds (merged), rasters (one mosaic), one mesh or the blocks of one, with their textures, one SLPK, or a 3D Tiles folder. Files may lie in folders, and the same name may be in several of them (`north/tile_1.laz`, `south/tile_1.laz`): a raster keeps the world file and `.prj` of its own folder, and a texture is the one its `.mtl` leads to. Two things are refused (`two_files_with_the_same_name`): the same name twice in one folder (or in a zip and next to it), and a texture or material file of several of that name when the model could mean either. You need not say what a zip holds: the list of files is read from it when its upload is completed. Until then the asset is called a `point-cloud` of the format `ZIP`. If the zip cannot become an asset, the last `complete` answers 400 (`UPL_008`, `UPL_006`) and the asset is `failed` with `zip_cannot_be_processed`; if it unpacks to more than your plan processes this month, 402 `QTA_001` and `processing_limit_reached` (the files are kept: process the asset again when there is room). 503 `UPL_010` means the zip could not be read just now: send the same request again. Send the list yourself, `"entries":[{"name":"north/tile_1.laz","size":}]` with the file, to have all this checked by `POST /uploads`, before a byte is sent. A worker never unpacks more than was listed. ## Meshes in blocks Photogrammetry exports a mesh as many blocks, such as `Data/Tile_+001_+002/Tile_+001_+002.obj` with its `.mtl` and textures, and one `metadata.xml` at the top. Zip the folder, or upload the files together with `"mode":"one"`, and they become one asset: one tree of tiles, with coarse tiles across the blocks. OBJ, FBX, DAE and PLY blocks may be mixed, up to 2,000; each glTF or GLB is an asset of its own. All blocks share one coordinate system and origin: a `metadata.xml` (or `.prj`) next to a block may repeat it, but one that says another is refused (`different_georeferences`). A block that cannot be read stops processing, and the failure names it (`block_could_not_be_read`). ## Formats Meshes: OBJ; FBX (binary, 2011 or newer, also with the textures inside it); COLLADA (`.dae`); PLY with faces (colours per point, or one or more textures); glTF and GLB. Units and the up axis are read from FBX and DAE. Textures may be PNG, JPEG, WebP, TIFF, BMP or TGA. A mesh without textures is shown in the colours of its points or materials. A `.ply` of points alone is a point cloud: which of the two it is shows in its header, read when the upload is complete (the asset is a `point-cloud` until then), or at the address when it is imported. Gaussian splats (a `.ply` whose points have `f_dc_*`, `scale_*` and `rot_*`, or `.splat`, `.spz`, `.ksplat`, `.sog`) are not processed yet and refused (`gaussian_splats_not_supported`); they are never tiled as points. Point clouds as text: `.xyz` or `.pts` files, one point per line, separated by spaces, commas, semicolons or tabs; `.txt` and `.csv` files too, when they are uploaded without other data and their first lines hold numbers (a readme is refused, `no_points_found`; next to other data they are taken for notes and left out). The columns are found from a first line naming them (`X Y Z Red Green Blue Intensity Classification`, also `Easting`, `Northing`, `Height`) or else from their number: 3 = X Y Z, 4 = + intensity, 6 = + colour, 7 = + intensity and colour (Leica PTS, whose first line, the point count, is skipped). Colour may be 0–255 or 0–65535. Use a decimal point. Text files hold no coordinate system: set `srsIn`. Other columns named in the first line are left out. When the columns found are wrong, or cannot be told apart (`columns_not_recognised`), say them with `textLayout`, at the upload, at an import or when processing again: `{"columns":["y","x","z","ignore","red","green","blue"],"separator":"comma","headerLines":1}`. Columns are `x`, `y`, `z` (all three, each once), `intensity`, `red` with `green` and `blue`, `classification`, or `ignore`, as many as the lines have; the separator is `comma`, `semicolon`, `tab` or `space`; `headerLines` are the lines before the first point. One choice is for all text files of the asset: a file with other columns fails (`columns_do_not_fit`). Rasters: GeoTIFF; PNG and JPEG with a world file of the same name (`.pgw` or `.pngw`, `.jgw` or `.jpgw`, or `.wld`) and, for the coordinate system, a `.prj` of the same name or `srsIn`. Such an image is imagery, whatever its bands. Without a world file it is refused, and next to a GeoTIFF of its name it is left out (a preview picture). At most 2.5 billion pixels an image; interlaced PNG and progressive JPEG up to 80 million. Options: `srsIn` sets the coordinate system when the files have none (`EPSG:25832`, or `EPSG:25832+5783` with a height system); `quality` chooses the tile quality (below). ## Tile quality `quality` is `standard` (the default, recommended), `high` or `original`, on `POST /uploads`, `POST /uploads/from-url` and `POST /assets/{id}/reprocess`. The asset's `quality` says what it was processed with. It is part of the tiles, so changing it processes the asset again (charged as processing; the current version streams until the new one is ready); asking for the quality it already has is refused (409 `AST_001`). What each choice means depends on the data: | Data | `standard` | `high` | `original` | |---|---|---|---| | Meshes, scene layers | Compressed geometry (steps of about 6 mm on a 100 m model), compact KTX2 textures, at most 4,096 pixels a side in each tile: smallest | Finer geometry (about 1.5 mm on 100 m), the full detail of the textures (up to 8,192 pixels a side in each tile) | Float positions, the full detail of the textures, not compressed: largest | | Point clouds | Position, colour, classification and intensity; positions in 16-bit steps of each tile, compressed | Also every other attribute the file has (GPS time, return number, scan angle, user data, point source id, scanner channel), as glTF point metadata; compressed | Every attribute and float positions (no rounding); still compressed; largest | | Raster imagery | WebP tiles at quality 85 | WebP tiles at quality 95 | Lossless PNG tiles (`{z}/{x}/{y}.png`; the TileJSON names them): largest | | Elevation models | – | – | – | Elevation models are always lossless (Terrarium PNG, and quantized-mesh terrain): they have no quality (`quality` is `null`) and a reprocess with one is refused (400 `AST_004`), as for a 3D Tiles tileset. A GeoTIFF's kind is known after processing, so an upload of rasters takes a quality, and an elevation model ignores it. An attribute a file does not have is simply left out. Read the tile URLs from the TileJSON (`tiles[0]`) rather than writing `.webp`: imagery at `original` is PNG. 3D Tiles you already have (from ContextCapture, Metashape, ArcGIS or your own tiler): upload the `.3tz`, or a zip of the folder that holds `tileset.json` with its tiles. It is checked (the tileset JSON, every tile it names present and well formed) and streamed as it is, as asset type `tileset`; nothing in the tiles is changed. Its coordinate system is in the tiles, so `srsIn` does not apply. A failure says which file is wrong (`tileset_not_valid`, `no_tileset_json`). ## Importing from a URL For a large file already in a bucket or on a web server, let a processor fetch it instead of uploading it: ```sh curl -s -X POST "$API/uploads/from-url" -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \ -d '{"url":"https://my-bucket.s3.eu-central-1.amazonaws.com/site.laz?X-Amz-Signature=…","size":734003200,"name":"Site"}' ``` The asset is queued at once; the processor downloads the file into the asset's source files (so it can be downloaded and processed again later), then processes it. The address must be public https (a presigned link valid until the job starts: give it a day), and `size` the file's exact size (without it, it is asked for at the address). With the command line: `articlore import --size --wait`. A zip is imported like an uploaded one. The list of files in it is read at the address, so the server there must send parts of a file (HTTP `Range`, as S3 and most web servers do). `POST /uploads/from-url/check` with `{"url": …}` says beforehand what a file would become: its size, the files in a zip, and the answer of `POST /uploads/detect`; or why it cannot be imported (`UPL_011` the address, `UPL_008` the zip, `UPL_013` a damaged file or Gaussian splats). ## How long processing takes `GET /processing-estimates` tells how long processing took for others: seconds per gigabyte of source, per type and size, as the range three runs in five fall into. Multiply by the size of your files (a zip counts what it unpacks to). Waiting for a free processor comes on top, and a type or size that has too few runs yet has no entry. # Guide: Viewer tokens: streaming on a public page A web page that shows a viewer exposes whatever token it streams with. Do not put an API token there. Instead, let your server mint a short-lived viewer token for each page view: ```sh curl -s -X POST "$API/tokens/{tokenId}/viewer" \ -H "Authorization: Bearer $SERVER_TOKEN" -H "Content-Type: application/json" \ -d '{"ttlSeconds":3600,"assetIds":["ab12cd34"]}' ``` The server token needs `tokens:viewer` and `assets:read`. The answer's `token` (`tk_view_…`) streams only, only the assets given (or everything the parent token reaches), and stops by itself after `ttlSeconds` (60 to 86400). Revoking the parent token stops its viewer tokens within about a minute. Hand the viewer token to the page and stream with it: ```js const tileset = await Cesium.Cesium3DTileset.fromUrl( `https://tiles.articlore.com/ab12cd34/tileset.json?token=${viewerToken}`); ``` A token can also be limited to *allowed domains*: browsers then stream with it only from those sites. Desktop applications (QGIS, ArcGIS Pro, game engines) send no `Origin` or `Referer`, so give them a token without a domain list. # Guide: Webhooks Register an https URL with `POST /webhooks` and the events you want: | Event | When | |---|---| | `asset.processing` | A processor started a run; sent again on each retry, with `data.attempt` | | `asset.processed` | The asset is ready to stream | | `asset.failed` | Processing failed; `data.failure` has its title and message | | `asset.needs_files` | An OBJ refers to textures that were not uploaded; `data.failure.missingFiles` lists them | | `usage.warning` | 80 % (`level: 80`) or all (`level: 100`) of a plan limit is used: `meter` is `storage`, `streaming` or `processing`, with `used`, `limit` and `month`. On a plan whose streaming goes on past the limit, a last one says it has stopped (`level` 100 + the allowance, e.g. `120`). Once a month per meter and level; owners and admins also get an email | A webhook is told about the assets of every project, unless you limit it: `projectIds` takes 1 to 100 project ids when you register or change it (`null`: every project again). What counts is the project the asset is in when the event happens, so an asset you move is reported to the webhooks of its new project from then on. Deleting a project takes it out of its webhooks; a webhook with none left is told about no asset until you choose projects again. `usage.warning` and the test `ping` are about no project and are sent whatever the projects. A token limited to some projects manages the webhooks for those projects: it must give `projectIds` among its own, and cannot choose `usage.warning`. Each event is a `POST` of JSON with `X-Articlore-Event`, `X-Articlore-Delivery` (one id per delivery: use it to ignore a repeat) and `X-Articlore-Signature: t=,v1=`. `v1` is the HMAC-SHA256 of `.` keyed with the webhook's `secret`. Check it before trusting a delivery, and refuse ones whose `t` is old: ```js const [t, v1] = sig.split(",").map((p) => p.slice(p.indexOf("=") + 1)); const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"); const ok = crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(expected)) && Math.abs(Date.now() / 1000 - Number(t)) < 300; ``` Answer with any 2xx within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2, 6 and 12 hours. `GET /webhooks/{id}/deliveries` shows each delivery and its answer; `POST …/deliveries/{d}/redeliver` sends one again (not one about a project the webhook is no longer limited to), and `POST /webhooks/{id}/test` sends a `ping`. # Reference ## Assets ### GET /assets List assets. Scope: `assets:read` Every asset the token can see; with `ids`, only those (missing ids are deleted or not visible). Parameters: - `ids` (query) Responses: - 200: Assets - 401: `AUT_000`: the token is unknown, revoked or expired. `BCR_000`: no token (and no session) ### GET /assets/{id} Get an asset. Scope: `assets:read` Parameters: - `id` (path, required) Responses: - 200: The asset - 404: `AST_000`: not found, or not visible to this token ### PATCH /assets/{id} Rename or move an asset. Scope: `assets:write` Absent fields stay as they are. Parameters: - `id` (path, required) Responses: - 200: The asset - 404: `AST_000`: not found, or not visible to this token ### DELETE /assets/{id} Delete an asset. Scope: `assets:write` Deletes its source files and tiles. Viewers streaming it stop within about a minute. Parameters: - `id` (path, required) Responses: - 204: Deleted - 404: `AST_000`: not found, or not visible to this token ### POST /assets/{id}/reprocess Process an asset again. Scope: `assets:write` A failed asset can always be processed again. A processed one only with a new `srsIn`, `quality` or `textLayout` (that run is charged like an upload); the same one again is `409`. Every field is optional, and kept for later runs. `quality` on a tileset or an elevation model is `400` (`AST_004`): they have no tile preset; `textLayout` on an asset without text point files is `400` (`AST_005`). Parameters: - `id` (path, required) Responses: - 200: The asset, now queued - 400: `AST_002` coordinate system, `AST_004` tile quality (not standard, high or original, or a tileset or elevation model), `AST_005` text columns (not usable, or no text point files) - 402: `QTA_000` storage, `QTA_001` processing of the month, `QTA_002` over the storage limit; `ACC_002` the account is suspended - 409: `AST_001`: not in a state that can be processed again, or the same coordinate system, quality or text columns again ### PUT /assets/{id}/placement Move a processed asset on the globe. Scope: `assets:write` Not processing: no tile is rebuilt and nothing is charged. Viewers see the new position within a minute. Parameters: - `id` (path, required) Responses: - 200: The asset - 400: `AST_003`: not a rigid move near the Earth, or the asset is not published yet ### DELETE /assets/{id}/placement Put the asset back where processing placed it. Scope: `assets:write` Parameters: - `id` (path, required) Responses: - 200: The asset ### GET /assets/{id}/share The asset's share link. Scope: `assets:read` A share link opens the asset in a read-only viewer, without signing in: for people who do not write code. Its streaming counts as yours. Parameters: - `id` (path, required) Responses: - 200: The share link - 404: `AST_000`: the asset is not shared ### PUT /assets/{id}/share Share the asset with a link, or change the link's expiry or password. Scope: `assets:write` Sharing again keeps the same link. Without `expiresAt` it works until sharing is stopped. Without `password` the link keeps the one it has, or none; a new one ends the pages that are open within a minute. The password cannot be read back. Parameters: - `id` (path, required) Responses: - 200: The share link - 400: `BRQ_000`: the password is shorter than 8 or longer than 128 characters, or the expiry is in the past - 409: `AST_001`: the asset is not processed yet ### DELETE /assets/{id}/share Stop sharing. Scope: `assets:write` The link stops working; pages already open stop streaming within a minute. Parameters: - `id` (path, required) Responses: - 204: Not shared any more ### PUT /assets/{id}/share/password Set or change the link's password. Scope: `assets:write` Whoever opens the link is asked for it. Pages already open stop streaming within a minute. Nobody can read the password back. Parameters: - `id` (path, required) Responses: - 200: The share link - 400: `BRQ_000`: shorter than 8 or longer than 128 characters - 404: `AST_000`: the asset is not shared ### DELETE /assets/{id}/share/password Remove the link's password. Scope: `assets:write` The same link opens without a password; pages already open stop streaming within a minute. Parameters: - `id` (path, required) Responses: - 200: The share link - 404: `AST_000`: the asset is not shared ### POST /assets/{id}/cancel Stop processing. Scope: `assets:write` Parameters: - `id` (path, required) Responses: - 200: The asset ### POST /assets/{id}/dequeue Remove a queued asset from the queue. Scope: `assets:write` Parameters: - `id` (path, required) Responses: - 204: Removed ### GET /assets/{id}/log Processing log. Scope: `assets:read` Of the latest run, or of the one named. Logs of earlier runs are kept 90 days; after that they are empty. Parameters: - `id` (path, required) - `run` (query): The id of a run (`GET /assets/{id}/runs`); one of another asset is `404` Responses: - 200: Log lines, oldest first ### GET /assets/{id}/runs Processing runs. Scope: `assets:read` The latest 20, newest first. Every upload, retry and reprocess is a run. Parameters: - `id` (path, required) Responses: - 200: The runs ### GET /assets/{id}/source-url Download link for the main source file. Scope: `assets:read` The first file uploaded (the point cloud, OBJ, package or first GeoTIFF). `GET /assets/{id}/source-files` gives every file. Parameters: - `id` (path, required) Responses: - 200: A presigned URL, valid for an hour ### GET /assets/{id}/source-files Download links for every source file. Scope: `assets:read` Your original files, as uploaded (an OBJ with its MTL and textures, every GeoTIFF of a mosaic, a zip as it was), each with its own presigned link valid for an hour. Processed tiles are streamed, not downloaded. Parameters: - `id` (path, required) Responses: - 200: The files, in upload order - 409: The upload is not finished yet (`AST_001`) ## Uploads ### GET /assets/{id}/uploads Upload sessions of an asset. Scope: `assets:write` What storage already holds of each file, to resume an interrupted upload. Parameters: - `id` (path, required) Responses: - 200: Sessions ### DELETE /assets/{id}/uploads Cancel an upload. Scope: `assets:write` Stops the upload and deletes the asset (or, after `POST /assets/{id}/files`, only the added files). Parameters: - `id` (path, required) Responses: - 204: Cancelled ### POST /assets/{id}/files Add missing files to a failed asset. Scope: `assets:write` For a mesh that failed because textures were missing (`failure.missingFiles`). Returns upload sessions for the new files; the asset is processed again once they are complete. Files it already has are skipped. Parameters: - `id` (path, required) Responses: - 201: Sessions to upload ### POST /uploads/detect Check files before uploading. Scope: `assets:write` What the files would become, and what the plan still allows. Creates nothing. Responses: - 200: Detection ### POST /uploads Start an upload. Scope: `assets:write` Creates the asset(s) and one upload session per file. See *Uploading* above. With an `Idempotency-Key`, sending the same request again within 24 hours returns the assets the first one made, with their sessions as they are now (parts already uploaded included), and creates nothing. The same key with a different request is refused (409 `UPL_009`). Parameters: - `Idempotency-Key` (header): Your id for this upload, e.g. a UUID: 1 to 128 letters, digits or `. _ : -`. Kept 24 hours. Request body example: ```json { "files": [ { "name": "site.laz", "size": 734003200 } ], "name": "Quarry survey", "mode": "one", "srsIn": "EPSG:32639" } ``` Responses: - 201: Assets and their upload sessions - 400: `UPL_002` nothing supported, `UPL_006` cannot become one asset, `UPL_008` the listed files of a zip cannot become one asset (or more than 100 zips came without their list), `AST_002` coordinate system, `AST_004` tile quality, `AST_005` text columns (not usable, or no text point files) - 402: `QTA_000` storage, `QTA_001` processing of the month, `QTA_002` over the storage limit; `ACC_002` the account is suspended - 409: `UPL_009`: the `Idempotency-Key` was used for another request, or what it made was deleted - 429: `QTA_003`: the plan's number of assets uploading, queued or processing at once is reached ### POST /uploads/from-url Import a file from a URL. Scope: `assets:write` One file a processor fetches from an https address instead of you uploading it: for large files already in a bucket (a presigned GET link) or on a web server. The asset is checked as an upload of it would be, then queued; the processor downloads the file into the asset's source files first (so it can be downloaded and processed again later, like an upload), then processes it. Only public https addresses are fetched, and the file must be exactly as large as when the import was made; otherwise processing fails with `failure.code` `import_failed`. A zip is imported like an uploaded one: the list of the files in it is read at the address first, so the server there must send parts of a file (`Range`, as S3 and most web servers do). A PLY's header is read there too: with faces it becomes a mesh, else a point cloud. Whatever else is wrong that a file's first bytes show is said at once by `POST /uploads/from-url/check`, and otherwise by the processing run. With an `Idempotency-Key`, sending the same request again within 24 hours returns the asset the first one made, as it is now, and creates nothing. The same key with a different request (another `url` too, such as a link signed again) is refused (409 `UPL_009`). Parameters: - `Idempotency-Key` (header): Your id for this import, e.g. a UUID: 1 to 128 letters, digits or `. _ : -`. Kept 24 hours. Request body example: ```json { "url": "https://my-bucket.s3.eu-central-1.amazonaws.com/surveys/site.laz?X-Amz-Signature=…", "size": 734003200, "name": "Quarry survey" } ``` Responses: - 201: The asset - 400: Not an https address, `UPL_011` the address cannot be imported from (it does not answer, is not public, the file has another size), `UPL_008` the zip cannot be used, `UPL_013` the file is damaged or holds splats, `UPL_002` a file we do not process, `AST_002` coordinate system, `AST_004` tile quality, or `AST_005` text columns - 402: `QTA_000` storage, `QTA_001` processing of the month, `QTA_002` over the storage limit; `ACC_002` the account is suspended - 409: `UPL_009`: the `Idempotency-Key` was used for another request, or what it made was deleted - 429: `QTA_003`: the plan's number of assets uploading, queued or processing at once is reached - 503: `UPL_012`: many addresses are being looked at right now; send the same request again in a moment ### POST /uploads/from-url/check Look at a file behind a URL. Scope: `assets:write` What an import from this address would become, before anything is made: the file's size, for a zip the files in it, and the answer `POST /uploads/detect` gives for it (a PLY with faces is a mesh here). The file's first bytes and a zip's table of contents are read at the address, with the same rules as the import. Request body example: ```json { "url": "https://my-bucket.s3.eu-central-1.amazonaws.com/surveys/site.zip?X-Amz-Signature=…" } ``` Responses: - 200: The file and what it would become - 400: Not an https address, `UPL_011` it cannot be imported from, `UPL_008` the zip cannot be used, `UPL_006` meshes and point clouds in one, `UPL_013` the file is damaged or holds splats - 503: `UPL_012`: many addresses are being looked at right now; send the same request again in a moment ### POST /uploads/{sessionId}/parts/{n} Presigned URL for one part. Scope: `assets:write` `PUT` exactly this part's bytes to the URL (it is signed for their length), then report it with `…/uploaded`. Parameters: - `sessionId` (path, required) - `n` (path, required): Part number, 1-based Responses: - 200: URL - 400: `UPL_003`: part number out of range ### POST /uploads/{sessionId}/parts/{n}/uploaded Report an uploaded part. Scope: `assets:write` Parameters: - `sessionId` (path, required) - `n` (path, required): Part number, 1-based Responses: - 200: Bytes of the file now in storage ### POST /uploads/{sessionId}/complete Finish a file's upload. Scope: `assets:write` Every part must be in, at its expected length. When all files of an asset are complete, they are checked and the asset is queued for processing. The check reads the first bytes of the files and the tables of contents of zips. Whatever is wrong that shows there (a damaged file, a missing texture, a zip with a password) makes the asset `failed` at once, with the `failure.code` a processing run would give it; the answer is still `204`. A zip sent without `entries` is identified here, by the rules a list is checked by when the upload is created. If it cannot become an asset (`UPL_008`, `UPL_006`, `UPL_002`) or goes past your plan (`QTA_001`), this answers with that and the asset is `failed` with the same message: `failure.code` `zip_cannot_be_processed` (or, for a file that is no zip, `not_a_zip_file`, `too_many_files_in_the_zip`) or `processing_limit_reached`. Its files are kept; after `QTA_001`, process it again when there is room. A zip added to an existing asset (`POST /assets/{id}/files`) that is refused is taken back instead, and the asset is as it was before. Parameters: - `sessionId` (path, required) Responses: - 204: Complete - 400: What a zip sent without `entries` holds was refused: `UPL_008`, `UPL_006`, `UPL_002`; the asset is `failed` - 402: `QTA_001`: what a zip sent without `entries` unpacks to goes past the processing limit; the asset is `failed` and can be processed again later - 409: `UPL_001` parts missing, `UPL_005` parts do not add up to the declared size - 503: `UPL_010`: the zip could not be read just now; nothing is lost, send the same request again ### GET /processing-estimates How long processing takes. Scope: `assets:read` Learnt once an hour from finished processing runs, per type of data and size of the source: three runs in five took between `lowSecondsPerGb` and `highSecondsPerGb` for each gigabyte (10^9 bytes) processing reads (a zip counts what it unpacks to). Take the entry of your type with `aboveBytes` < your size ≤ `upToBytes`; a source smaller than `smallestBytes` takes as long as one of that size. Waiting for a free processor comes on top. A type or size that has too few runs yet has no entry. Responses: - 200: What was learnt ## Projects ### GET /projects List projects. Scope: `projects:read` Responses: - 200: Projects ### POST /projects Create a project. Scope: `projects:write` Needs a token that applies to the whole organisation. Responses: - 201: The project - 409: `PRJ_001`: name already in use ### PATCH /projects/{id} Rename a project. Scope: `projects:write` Parameters: - `id` (path, required) Responses: - 200: The project ### DELETE /projects/{id} Delete a project. Scope: `projects:write` Its assets move to the Default project, which cannot be deleted (`PRJ_002`). Needs a token that applies to the whole organisation. Parameters: - `id` (path, required) Responses: - 204: Deleted ## Tokens ### GET /tokens List API tokens. Scope: `tokens:read` Responses: - 200: Tokens ### POST /tokens Create an API token. Scope: `tokens:write` A token can only create tokens with scopes and reach it holds itself. Responses: - 201: The token, with its secret - 402: `QTA_005`: the plan's number of API tokens is reached ### PUT /tokens/{id} Change an API token. Scope: `tokens:write` Replaces all of it; the secret stays. Ids in `appliesTo` the token already has and that were deleted since may be sent again: it lets go of them. Parameters: - `id` (path, required) Responses: - 200: The token - 404: `TOK_000`: no such token; `PRJ_000`, `AST_000`: a project or asset in `appliesTo` is not the organisation's ### DELETE /tokens/{id} Revoke an API token. Scope: `tokens:write` Streaming with it, and with viewer tokens made from it, stops within about a minute. Parameters: - `id` (path, required) Responses: - 204: Revoked ### POST /tokens/{id}/viewer Mint a short-lived viewer token. Scope: `tokens:viewer` Call this from your server for each page that shows a viewer, and put the viewer token in the page instead of an API token. It streams only, expires by itself, keeps the parent's allowed domains, and stops working when the parent is revoked. Needs `tokens:viewer` and `assets:read` on the assets it reaches. An organisation can have 10 000 of them open (not expired) at once: give them a life of an hour or so. Parameters: - `id` (path, required): The parent API token Responses: - 201: Viewer token - 429: `RTL_000`: 10 000 viewer tokens of the organisation are open (or the rate limit, see *Rate limit* above) ## Webhooks ### GET /webhooks List webhooks. Scope: `webhooks:read` A token limited to projects sees, and can change, the webhooks limited to its projects that leave out `usage.warning`; the others are not there for it (`404 WHK_000`). A token limited to assets cannot use webhooks (`403 ACC_000`). Responses: - 200: The webhooks ### POST /webhooks Register a webhook. Scope: `webhooks:write` An https URL on the public internet. As many webhooks as the plan includes, and at most 10 per organisation. A token limited to projects must give `projectIds`, among its own, and cannot choose `usage.warning`. Responses: - 201: The webhook with its signing secret - 400: `WHK_001`: the URL is not https, not on the public internet, an event is unknown, or `projectIds` is empty or has more than 100 projects - 402: `QTA_006`: the organisation has as many webhooks as its plan includes, or the plan includes none (existing ones keep working) - 403: `ACC_000`: the token is limited to projects and the webhook would tell more than it may see, or it is limited to assets - 404: `PRJ_000`: a project in `projectIds` is not the organisation's ### GET /webhooks/{id} Get a webhook. Scope: `webhooks:read` Parameters: - `id` (path, required) Responses: - 200: The webhook ### PATCH /webhooks/{id} Change a webhook's URL, events, projects, description, or pause it. Scope: `webhooks:write` What is given changes. Deliveries that still wait for projects the webhook is no longer limited to are not sent. Parameters: - `id` (path, required) Responses: - 200: The webhook - 400: `WHK_001`, as when registering - 403: `ACC_000`, as when registering - 404: `WHK_000`: no such webhook; `PRJ_000`: a project in `projectIds` is not the organisation's ### DELETE /webhooks/{id} Delete a webhook. Scope: `webhooks:write` Parameters: - `id` (path, required) Responses: - 204: Deleted, with its delivery log ### POST /webhooks/{id}/test Send a test event. Scope: `webhooks:write` Sends a `ping` event now (also to a paused webhook), to check your endpoint and its signature check. Parameters: - `id` (path, required) Responses: - 202: Queued ### GET /webhooks/{id}/deliveries The delivery log. Scope: `webhooks:read` Newest first; kept 30 days. Parameters: - `id` (path, required) - `limit` (query) Responses: - 200: Deliveries ### POST /webhooks/{id}/deliveries/{deliveryId}/redeliver Send a delivery again. Scope: `webhooks:write` A new delivery with the same body (and the same event `id`), sent now. Parameters: - `id` (path, required) - `deliveryId` (path, required) Responses: - 202: Queued - 400: `WHK_001`: it is about an asset of a project the webhook is no longer limited to ## Usage ### GET /usage/months Months with usage. Scope: `usage:read` Responses: - 200: Months as yyyy-mm, newest first ### GET /usage/{month} Usage of one month. Scope: `usage:read` Organisation-wide, whatever the token applies to. Sizes in bytes. Parameters: - `month` (path, required) Responses: - 200: Report ## Audit log ### GET /audit Who did what. Scope: `audit:read` What was done in the organisation, newest first: tokens, people, assets, projects, share links, webhooks, the organisation itself, its plan. Reads are not in it. Kept for 24 months. Only for a token that applies to everything (403 `ACC_000` otherwise). Parameters: - `from` (query): The first moment - `to` (query): The moment after the last - `actor` (query): Who: `person:{id}`, `token:{id}`, `support` or `system` - `group` (query) - `target` (query): The id of what it was done to, e.g. an asset's - `cursor` (query): `next` of the page before - `limit` (query) Responses: - 200: A page - 400: A filter or cursor that cannot be used ### GET /audit/export Who did what, as a CSV file. Scope: `audit:read` Every entry of the filter, newest first, at most 50,000 (400 `AUD_000`: choose a shorter time). UTF-8, with a first line naming the columns; times are UTC. A value a spreadsheet would take for a formula begins with an apostrophe. 20 an hour for an organisation (429 `RTL_000`). Parameters: - `from` (query): The first moment - `to` (query): The moment after the last - `actor` (query): Who: `person:{id}`, `token:{id}`, `support` or `system` - `group` (query) - `target` (query): The id of what it was done to, e.g. an asset's Responses: - 200: The file - 400: `AUD_000`: too many entries for one file; or a filter that cannot be used - 429: `RTL_000`