HomeAge Verification HeadlessAI Services for TerminalsAge Estimation VerifySupportTrust APIIdentity Verification LivenessDigital IDIdentity verificationDigital ID MigrationDBS RTWDigital IDDBS/RTW portaleSignaturesAge verificationAge estimationIn-Branch VerificationAge Estimation v2idv-portal-errorsIdentity ProfilesVerifiable Credentialssandbox-betaIdentity Verification APIAI Services APITrust APIProof of Age (PoA) API
Digital ID
v9.0
Document Attributes
Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Revoke a credential
AI Tools
Summarize Page
Copy Markdown
Open in ChatGPT
Open in Claude
Connect to Cursor
Connect to VS Code
You can revoke a credential from a users profile using the issuance token. This requires no interaction from the user and will automatically update the Yoti app. The user will no longer be able to share or use the Yoti credential.
const payload = new Payload({
issuance_token: attributeIssuanceDetails.getToken(),
name: 'com.example.someAttribute',
});
const request = new RequestBuilder()
.withBaseUrl('https://api.yoti.com/api/v1/attribute-registry')
.withEndpoint('/attribute/revoke')
.withPemString('PEM_CONTENT')
.withHeader('X-Yoti-Auth-Id', 'CLIENT_SDK_ID')
.withMethod('PUT')
.withPayload(payload)
.build();
const response = await request.execute();
byte[] payload = ...; // Payload is JSON converted to byte array
SignedRequest signedRequest = SignedRequestBuilderFactory.create()
.withKeyPair("PEM_CONTENT")
.withBaseUrl("https://api.yoti.com/api/v1/attribute-registry")
.withEndpoint("/attribute/revoke")
.withHttpMethod("PUT")
.withHeader("X-Yoti-Auth-Id", "CLIENT_SDK_ID")
.withPayload(payload)
.build();
// 'SomeModel' is a POJO that has been defined by the user and is
// used to map JSON response as the SDK doesn't have any built in
// classes to support this
SomeModel someModel = signedRequest.execute(SomeModel.class);
/**
* SignedRequest.execute() uses built in Java HTTP connectivity.
* To use another framework if required (e.g. apache), you can get
* all of the pieces of the Yoti signed request off the SignedRequest
* object e.g.
**/
URI uri = signedRequest.getUri();
String httpMethod = signedRequest.getMethod();
byte[] payloadData = signedRequest.getData();
Map<String, String> headers = signedRequest.getHeaders();
<?php
use Yoti\Http\Payload;
use Yoti\Http\RequestBuilder;
$payload = Payload::fromJsonData((object) [
'issuance_token' => $attributeIssuanceDetails->getToken(),
'name' => 'com.example.someAttribute',
]);
$request = (new RequestBuilder())
->withBaseUrl('https://api.yoti.com/api/v1/attribute-registry')
->withEndpoint("/attribute/revoke")
->withPemFilePath('/path/to/key.pem')
->withHeader('X-Yoti-Auth-Id', 'CLIENT_SDK_ID')
->withMethod('PUT')
->withPayload($payload)
->build();
$response = $request->execute();
// Note:
// - Use RequestBuilder::withPemFile() to provide a `\Yoti\Util\PemFile`
// - Use RequestBuilder::withPemString() to provide PEM string
import json
from yoti_python_sdk.http import SignedRequest
payload_data = {
"issuance_token": attribute_issuance_details.token,
"name": 'com.example.someAttribute',
}
payload_string = json.dumps(payload_data).encode()
signed_request = (
SignedRequest
.builder()
.with_pem_file("/path/to/key.pem")
.with_base_url("https://api.yoti.com/api/v1/attribute-registry")
.with_endpoint("/attribute/revoke")
.with_http_method("PUT")
.with_header("X-Yoti-Auth-Id", "CLIENT_SDK_ID")
.with_payload(payload_string)
.build()
)
response = signed_request.execute()
var dynamicScenarioBuilder = new DynamicScenarioBuilder();
var dynamicPolicyBuilder = new DynamicPolicyBuilder();
string json = JsonConvert.SerializeObject(new
{
issuance_token = _issuanceToken,
name = _thirdPartyAttributeName
});
byte[] httpContent = System.Text.Encoding.UTF8.GetBytes(json);
var signedRequest = new RequestBuilder()
.WithBaseUri(new Uri("https://api.yoti.com/api/v1/attribute-registry"))
.WithEndpoint("/attribute/revoke")
.WithHttpMethod(HttpMethod.Put)
.WithHeader("X-Yoti-Auth-Id", _clientSdkId)
.WithKeyPair(_keyPair)
.WithContent(httpContent)
.Build();
var result = signedRequest.Execute(_httpClient).Result;
type Payload struct {
Token string `json:"issuance_token"`
Name string `json:"name"`
}
body, err := json.Marshal(Payload{
Token: issuingAttributes.Token(),
Name: "com.example.someAttribute",
})
if err != nil {
panic(err)
}
headers := map[string][]string{
"X-Yoti-Auth-Id": {"CLIENT_SDK_ID"},
}
decodedKey, err := cryptoutil.ParseRSAKey(key)
if err != nil {
panic(err)
}
request, err := requests.SignedRequest{
Key: decodedKey,
HTTPMethod: http.MethodPut,
BaseURL: "https://api.yoti.com/api/v1/attribute-registry",
Endpoint: "/attribute/revoke",
Headers: headers,
Body: body,
}.Request()
if err != nil {
panic(err)
}
response, err := requests.Execute(&http.Client{}, request)
payload = {
issuance_token: attribute_issuance_details.token,
name: 'com.example.someAttribute'
}
request = Yoti::Request
.builder
.with_base_url('https://api.yoti.com/api/v1/attribute-registry')
.with_http_method('PUT')
.with_endpoint('attribute/revoke')
.with_payload(payload)
.with_header('X-Yoti-Auth-Id', Yoti.configuration.client_sdk_id)
.build
response = request.execute
Last updated on
Was this page helpful?
Next to read:
Location constraintGot a question? Contact us here.
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message