EQTY LabDocs

Renew agent verifiable credential

Returns a freshly issued verifiable credential for the signing agent's registered DID. The signature covers @method, @target-uri, and x-viper-nonce. Returns 404 when the gateway has no credential issuer configured.

posthttps://<host>/v1/agents/credentials/renew
bash
curl --request POST \
  --url 'https://<host>/v1/agents/credentials/renew' \
  --header 'Signature: <api-key>'
javascript
const response = await fetch("https://<host>/v1/agents/credentials/renew", {
  method: "POST",
  headers: {
    "Signature": "<api-key>"
  }
});

const data = await response.json();
typescript
interface CredentialRenewalResponseBody {
  agent_id?: string;
  correlation_id?: string;
  did?: string;
  vc?: unknown;
}

const response = await fetch("https://<host>/v1/agents/credentials/renew", {
  method: "POST",
  headers: {
    "Signature": "<api-key>"
  }
});
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);

const data: CredentialRenewalResponseBody = await response.json();
python
import requests

response = requests.post(
    "https://<host>/v1/agents/credentials/renew",
    headers={
        "Signature": "<api-key>",
    },
)
response.raise_for_status()
print(response.json())
go
package main

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

func main() {
	req, err := http.NewRequest(http.MethodPost, "https://<host>/v1/agents/credentials/renew", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Signature", "<api-key>")

	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;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://<host>/v1/agents/credentials/renew"))
            .header("Signature", "<api-key>")
            .method("POST", HttpRequest.BodyPublishers.noBody())
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
csharp
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://<host>/v1/agents/credentials/renew");
request.Headers.Add("Signature", "<api-key>");

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

$ch = curl_init('https://<host>/v1/agents/credentials/renew');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Signature: <api-key>',
    ],
    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/agents/credentials/renew")
request = Net::HTTP::Post.new(uri)
request["Signature"] = "<api-key>"

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()
        .post("https://<host>/v1/agents/credentials/renew")
        .header("Signature", "<api-key>")
        .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.

Responses

200OK

application/json
  • agent_idstring
  • correlation_idstring
  • didstring
  • vcany
Examplejson
{
  "agent_id": "string",
  "correlation_id": "string",
  "did": "string",
  "vc": null
}

401Unauthorized

application/json
  • codestring
  • correlation_idstring
  • messagestring
Examplejson
{
  "code": "string",
  "correlation_id": "string",
  "message": "string"
}

403Forbidden

application/json
  • codestring
  • correlation_idstring
  • messagestring
Examplejson
{
  "code": "string",
  "correlation_id": "string",
  "message": "string"
}

404Not Found

application/json
  • codestring
  • correlation_idstring
  • messagestring
Examplejson
{
  "code": "string",
  "correlation_id": "string",
  "message": "string"
}

502Bad Gateway

application/json
  • codestring
  • correlation_idstring
  • messagestring
Examplejson
{
  "code": "string",
  "correlation_id": "string",
  "message": "string"
}