NylorunDocsBeta
Runtime APIAgents

Upload a definition file

PUT
/v1/files/{file}

Stores the body, at most 10485760 bytes, at the SHA-256 the path names; a body with another hash stores nothing (400). A file the Tenant holds already is kept as it is (200).

Authorization

applicationKey
headerAuthorizationBearer <token>

An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).

Path Parameters

file*string

sha256: and the SHA-256 of the file's bytes, 64 lowercase hex digits

Header Parameters

Nylorun-Protocol*string

The protocol version, 8

Request Body

The file's bytes

body*fileapplication/octet-stream
Formatbinary

Response Body

The Tenant held the file already

application/json
  1. response
sha256*string
Match^sha256:[0-9a-f]{64}$
size*integer
Range0 <= value <= 10485760
import { createClient } from "@nylorun/agents";const client = await createClient();const file = await client.files.upload(bytes);
{  "sha256": "string",  "size": 0}