EQTY LabDocs

Revoke credential

Sets the credential's bit in its bitstring status list and returns the re-signed list, so verifiers see it revoked. Revoking a credential again returns the list unchanged. An agent certification can be revoked only by a caller in its own organization: a holder of organization-level manage_programs, or the auditor who authorized it, who must revoke through the Governance Service so it can vouch for the request with X-Governance-Authorization. Any other credential needs revoke_credentials in at least one project.

posthttps://<host>/credentials/v1/revoke/{credentialId}
bash
curl --request POST \
  --url 'https://<host>/credentials/v1/revoke/{credentialId}' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{"credentialStatus":{"statusListCredential":"http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2","statusListIndex":"0"}}'
javascript
const response = await fetch("https://<host>/credentials/v1/revoke/{credentialId}", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "credentialStatus": {
      "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
      "statusListIndex": "0"
    }
  })
});

const data = await response.json();
typescript
const response = await fetch("https://<host>/credentials/v1/revoke/{credentialId}", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "credentialStatus": {
      "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
      "statusListIndex": "0"
    }
  })
});
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);

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

response = requests.post(
    "https://<host>/credentials/v1/revoke/{credentialId}",
    headers={
        "Authorization": "Bearer <token>",
        "Content-Type": "application/json",
    },
    json={
        "credentialStatus": {
            "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
            "statusListIndex": "0",
        },
    },
)
response.raise_for_status()
print(response.json())
go
package main

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

func main() {
	body := strings.NewReader(`{
	  "credentialStatus": {
	    "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
	    "statusListIndex": "0"
	  }
	}`)
	req, err := http.NewRequest(http.MethodPost, "https://<host>/credentials/v1/revoke/{credentialId}", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")

	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>/credentials/v1/revoke/{credentialId}"))
            .header("Authorization", "Bearer <token>")
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString("""
                {
                  "credentialStatus": {
                    "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
                    "statusListIndex": "0"
                  }
                }
                """))
            .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 System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://<host>/credentials/v1/revoke/{credentialId}");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "<token>");
request.Content = new StringContent("""
    {
      "credentialStatus": {
        "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
        "statusListIndex": "0"
      }
    }
    """, Encoding.UTF8, "application/json");

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

$ch = curl_init('https://<host>/credentials/v1/revoke/{credentialId}');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <token>',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
      "credentialStatus": {
        "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
        "statusListIndex": "0"
      }
    }
    JSON,
    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>/credentials/v1/revoke/{credentialId}")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = <<~'JSON'
  {
    "credentialStatus": {
      "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
      "statusListIndex": "0"
    }
  }
JSON

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 (features "json"), serde_json, tokio (features "full")
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let response = reqwest::Client::new()
        .post("https://<host>/credentials/v1/revoke/{credentialId}")
        .header("Authorization", "Bearer <token>")
        .json(&json!({
            "credentialStatus": {
                "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
                "statusListIndex": "0"
            }
        }))
        .send()
        .await?;

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

Authorizations

  • BearerAuth · HTTP bearer (JWT)

Parameters

Path parameters

NameTypeDescription
credentialId
required
string

Credential identifier

Header parameters

NameTypeDescription
X-Governance-Authorizationstring | null

Governance's own bearer token, Bearer <token>, which it adds when it forwards the revocation of the auditor who authorized an agent certification, having checked they still review its program

Request bodyrequired

application/json
  • credentialStatusCredentialStatusrequired
    Show CredentialStatus
    • statusListCredentialstringrequired
    • statusListIndexstringrequired
Examplejson
{
  "credentialStatus": {
    "statusListCredential": "http://localhost:3050/credentials/v1/status-lists/bea5c950-15c2-4d28-a5a0-4638dcce30b2",
    "statusListIndex": "0"
  }
}

Responses

200The status list credential, re-signed with the credential's bit set

application/json

any

401Missing or invalid bearer token, or the X-Governance-Authorization header is malformed or Auth Service refuses its token

application/json
  • callstackobject
    Show properties

    object | null

  • errorstringrequired
Examplejson
{
  "callstack": {},
  "error": "string"
}

403Caller holds revoke_credentials in no project, or, for an agent certification, neither holds organization-level manage_programs nor authorized the certification, or authorized it but the request carries no X-Governance-Authorization header whose token holds organization-level certify_agents

application/json
  • callstackobject
    Show properties

    object | null

  • errorstringrequired
Examplejson
{
  "callstack": {},
  "error": "string"
}

404No revocation status is allocated for the credential, the request names another status list or index, or the credential is another organization's agent certification

application/json
  • callstackobject
    Show properties

    object | null

  • errorstringrequired
Examplejson
{
  "callstack": {},
  "error": "string"
}

500Internal error

application/json
  • callstackobject
    Show properties

    object | null

  • errorstringrequired
Examplejson
{
  "callstack": {},
  "error": "string"
}

503Auth Service unavailable

application/json
  • callstackobject
    Show properties

    object | null

  • errorstringrequired
Examplejson
{
  "callstack": {},
  "error": "string"
}