EQTY LabDocs

Upload blob

Stores a CID-addressed blob, such as a state attestation, and records the uploading agent. The signature covers @method, @target-uri, and content-digest, with no attestation headers. Blobs are capped at the gateway's blob size limit, 64 MiB by default.

puthttps://<host>/v1/blobs/{cid}
bash
curl --request PUT \
  --url 'https://<host>/v1/blobs/{cid}' \
  --header 'Signature: <api-key>' \
  --header 'Content-Type: application/octet-stream' \
  --data-binary '@<file>'
javascript
const response = await fetch("https://<host>/v1/blobs/{cid}", {
  method: "PUT",
  headers: {
    "Signature": "<api-key>",
    "Content-Type": "application/octet-stream"
  },
  body: file
});

console.log(response.status);
typescript
declare const file: Blob;

const response = await fetch("https://<host>/v1/blobs/{cid}", {
  method: "PUT",
  headers: {
    "Signature": "<api-key>",
    "Content-Type": "application/octet-stream"
  },
  body: file
});
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);

console.log(response.status);
python
import requests

response = requests.put(
    "https://<host>/v1/blobs/{cid}",
    headers={
        "Signature": "<api-key>",
        "Content-Type": "application/octet-stream",
    },
    data=open("<file>", "rb"),
)
response.raise_for_status()
print(response.status_code)
go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	body, err := os.Open("<file>")
	if err != nil {
		panic(err)
	}
	defer body.Close()

	req, err := http.NewRequest(http.MethodPut, "https://<host>/v1/blobs/{cid}", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Signature", "<api-key>")
	req.Header.Set("Content-Type", "application/octet-stream")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Status, string(data))
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://<host>/v1/blobs/{cid}"))
            .header("Signature", "<api-key>")
            .header("Content-Type", "application/octet-stream")
            .method("PUT", HttpRequest.BodyPublishers.ofFile(Path.of("<file>")))
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
csharp
using System.Net.Http.Headers;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Put, "https://<host>/v1/blobs/{cid}");
request.Headers.Add("Signature", "<api-key>");
request.Content = new StreamContent(File.OpenRead("<file>"));
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");

using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
php
<?php

$ch = curl_init('https://<host>/v1/blobs/{cid}');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => [
        'Signature: <api-key>',
        'Content-Type: application/octet-stream',
    ],
    CURLOPT_POSTFIELDS => file_get_contents('<file>'),
    CURLOPT_RETURNTRANSFER => true,
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status . " " . $response . PHP_EOL;
ruby
require "net/http"

uri = URI("https://<host>/v1/blobs/{cid}")
request = Net::HTTP::Put.new(uri)
request["Signature"] = "<api-key>"
request["Content-Type"] = "application/octet-stream"
request.body = File.binread("<file>")

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
puts "#{response.code} #{response.body}"
rust
// Cargo.toml dependencies: reqwest, tokio (features "full")

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let response = reqwest::Client::new()
        .put("https://<host>/v1/blobs/{cid}")
        .header("Signature", "<api-key>")
        .header("Content-Type", "application/octet-stream")
        .body(std::fs::read("<file>")?)
        .send()
        .await?;

    println!("{} {}", response.status(), response.text().await?);
    Ok(())
}

Authorizations

  • AgentSignature · API key in header "Signature" — An RFC 9421 HTTP message signature by a registered agent's Ed25519 or P-256 key, sent with its Signature-Input header. The keyid is the agent's registered DID, created must fall within the signature's maximum age and clock skew, and the covered components start with @method and @target-uri. A request with a body also covers content-digest. Proxy and relay requests cover x-viper-nonce, x-viper-timestamp, and either x-viper-state-cid (state in an uploaded blob) or x-viper-credential-cid (state in the agent's state attestation credential); credential renewal covers x-viper-nonce. Viper signs every request this way.

Parameters

Path parameters

NameTypeDescription
cid
required
string

Blob CID

Request bodyrequired

Blob content

application/octet-stream

string

Responses

201Created

400Bad Request

text/plain
  • codestring
  • correlation_idstring
  • messagestring

401Unauthorized

text/plain
  • codestring
  • correlation_idstring
  • messagestring

403Forbidden

text/plain
  • codestring
  • correlation_idstring
  • messagestring

413Request Entity Too Large

text/plain
  • codestring
  • correlation_idstring
  • messagestring

500Internal Server Error

text/plain
  • codestring
  • correlation_idstring
  • messagestring