Create Credential Type (managed)
POST {{apiPath}}/v1/environments/{{envId}}/credentialTypes
Use the POST {{apiPath}}/v1/environments/{{envId}}/credentialTypes operation to create a new type of credential for issuance. A credential type corresponds to the Card type presented by the compatible wallet app.
In this request, management.mode is MANAGED. Such credential types are only issued by Create a User Credential or Update a User Credential API requests. An expiration object cannot be used to set the date when the credential will expire. Instead, you must use Create a User Credential or Update a User Credential to set expiresAt to a specific date in ISO 8601 YYYY-MM-DDTHH:MM:SS.sssZ format (milliseconds optional) on the user’s credential.
Prerequisites
-
Refer to Credential Types for important overview information.
Request Model
Refer to Credential Types data model for full property descriptions.
| Property | Type | Required |
|---|---|---|
|
String |
Required |
|
String |
Optional |
|
String |
Optional |
|
Object |
Optional |
|
Object |
Required/Optional |
|
Integer |
Required |
|
String |
Required |
|
String |
Required/Optional |
|
String |
Required/Optional |
|
DateTime |
Required/Optional |
|
String |
Required |
|
String |
Optional |
|
String |
Optional |
|
Object |
Required |
|
Object |
Optional |
|
String |
Required |
|
Boolean |
Optional |
|
Object |
Optional |
|
Boolean |
Required |
|
String |
Required |
|
String |
Required |
|
String |
Optional |
metadata object data model
| Property | Type | Required |
|---|---|---|
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
|
Object[] |
Optional |
|
String |
Required/Optional |
|
String |
Optional |
|
String |
Required |
|
Boolean |
Required |
|
Boolean |
Optional |
|
String |
Required |
|
String |
Required |
|
String[] |
Required/Optional |
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
|
String |
Optional |
Body
raw ( application/json )
{
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"openid4VCI": {
"enabled": true,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": true
},
{
"dataFieldName": "User ID",
"showFieldName": true
}
]
}
}
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff '{{apiPath}}/v1/environments/{{envId}}/credentialTypes' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data '{
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"openid4VCI": {
"enabled": true,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": true
},
{
"dataFieldName": "User ID",
"showFieldName": true
}
]
}
}'
var options = new RestClientOptions("{{apiPath}}/v1/environments/{{envId}}/credentialTypes")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@" ""title"": ""Card Developers""," + "\n" +
@" ""description"": ""Card Developers Employee Credentials""," + "\n" +
@" ""management"": {" + "\n" +
@" ""mode"": ""MANAGED""" + "\n" +
@" }," + "\n" +
@" ""cardType"": ""Card Developers""," + "\n" +
@" ""metadata"": {" + "\n" +
@" ""name"": ""Card Developers Employee Credentials""," + "\n" +
@" ""description"": ""Card Developers Employee Credentials""," + "\n" +
@" ""textColor"": ""#000000""," + "\n" +
@" ""cardColor"": ""#FFFFFF""," + "\n" +
@" ""backgroundImage"": ""data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==""," + "\n" +
@" ""logoImage"": """"," + "\n" +
@" ""bgOpacityPercent"": 20," + "\n" +
@" ""fields"": [" + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> Name""," + "\n" +
@" ""title"": ""Name""," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""name.formatted""," + "\n" +
@" ""required"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> Address""," + "\n" +
@" ""title"": ""Address""," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""address""," + "\n" +
@" ""required"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Directory Attribute -> ID""," + "\n" +
@" ""title"": ""User ID""," + "\n" +
@" ""type"": ""Directory Attribute""," + "\n" +
@" ""attribute"": ""id""," + "\n" +
@" ""required"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""id"": ""Alphanumeric Text -> Clearance""," + "\n" +
@" ""title"": ""Clearance""," + "\n" +
@" ""type"": ""Alphanumeric Text""," + "\n" +
@" ""value"": ""None""," + "\n" +
@" ""required"": true" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""version"": 1" + "\n" +
@" }," + "\n" +
@" ""onDelete"": {" + "\n" +
@" ""revokeIssuedCredentials"": true" + "\n" +
@" }," + "\n" +
@" ""openid4VCI"": {" + "\n" +
@" ""enabled"": true," + "\n" +
@" ""scope"": ""p1:provision:credentials""" + "\n" +
@" }," + "\n" +
@" ""visualizationTemplateData"": {" + "\n" +
@" ""displayFields"": [" + "\n" +
@" {" + "\n" +
@" ""dataFieldName"": ""Name""," + "\n" +
@" ""showFieldName"": true" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""dataFieldName"": ""User ID""," + "\n" +
@" ""showFieldName"": true" + "\n" +
@" }" + "\n" +
@" ]" + "\n" +
@" }" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{apiPath}}/v1/environments/{{envId}}/credentialTypes"
method := "POST"
payload := strings.NewReader(`{
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"openid4VCI": {
"enabled": true,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": true
},
{
"dataFieldName": "User ID",
"showFieldName": true
}
]
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer {{accessToken}}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /v1/environments/{{envId}}/credentialTypes HTTP/1.1
Host: {{apiPath}}
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"openid4VCI": {
"enabled": true,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": true
},
{
"dataFieldName": "User ID",
"showFieldName": true
}
]
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"title\": \"Card Developers\",\n \"description\": \"Card Developers Employee Credentials\",\n \"management\": {\n \"mode\": \"MANAGED\"\n },\n \"cardType\": \"Card Developers\",\n \"metadata\": {\n \"name\": \"Card Developers Employee Credentials\",\n \"description\": \"Card Developers Employee Credentials\",\n \"textColor\": \"#000000\",\n \"cardColor\": \"#FFFFFF\",\n \"backgroundImage\": \"data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==\",\n \"logoImage\": \"\",\n \"bgOpacityPercent\": 20,\n \"fields\": [\n {\n \"id\": \"Directory Attribute -> Name\",\n \"title\": \"Name\",\n \"type\": \"Directory Attribute\",\n \"attribute\": \"name.formatted\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> Address\",\n \"title\": \"Address\",\n \"type\": \"Directory Attribute\",\n \"attribute\": \"address\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> ID\",\n \"title\": \"User ID\",\n \"type\": \"Directory Attribute\",\n \"attribute\": \"id\",\n \"required\": true\n },\n {\n \"id\": \"Alphanumeric Text -> Clearance\",\n \"title\": \"Clearance\",\n \"type\": \"Alphanumeric Text\",\n \"value\": \"None\",\n \"required\": true\n }\n ],\n \"version\": 1\n },\n \"onDelete\": {\n \"revokeIssuedCredentials\": true\n },\n \"openid4VCI\": {\n \"enabled\": true,\n \"scope\": \"p1:provision:credentials\"\n },\n \"visualizationTemplateData\": {\n \"displayFields\": [\n {\n \"dataFieldName\": \"Name\",\n \"showFieldName\": true\n },\n {\n \"dataFieldName\": \"User ID\",\n \"showFieldName\": true\n }\n ]\n }\n}");
Request request = new Request.Builder()
.url("{{apiPath}}/v1/environments/{{envId}}/credentialTypes")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {{accessToken}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/v1/environments/{{envId}}/credentialTypes",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {{accessToken}}"
},
"data": JSON.stringify({
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"openid4VCI": {
"enabled": true,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": true
},
{
"dataFieldName": "User ID",
"showFieldName": true
}
]
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'POST',
'url': '{{apiPath}}/v1/environments/{{envId}}/credentialTypes',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
},
body: JSON.stringify({
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"openid4VCI": {
"enabled": true,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": true
},
{
"dataFieldName": "User ID",
"showFieldName": true
}
]
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "{{apiPath}}/v1/environments/{{envId}}/credentialTypes"
payload = json.dumps({
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": True
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": True
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": True
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": True
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": True
},
"openid4VCI": {
"enabled": True,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": True
},
{
"dataFieldName": "User ID",
"showFieldName": True
}
]
}
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/v1/environments/{{envId}}/credentialTypes');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n "title": "Card Developers",\n "description": "Card Developers Employee Credentials",\n "management": {\n "mode": "MANAGED"\n },\n "cardType": "Card Developers",\n "metadata": {\n "name": "Card Developers Employee Credentials",\n "description": "Card Developers Employee Credentials",\n "textColor": "#000000",\n "cardColor": "#FFFFFF",\n "backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",\n "logoImage": "",\n "bgOpacityPercent": 20,\n "fields": [\n {\n "id": "Directory Attribute -> Name",\n "title": "Name",\n "type": "Directory Attribute",\n "attribute": "name.formatted",\n "required": true\n },\n {\n "id": "Directory Attribute -> Address",\n "title": "Address",\n "type": "Directory Attribute",\n "attribute": "address",\n "required": true\n },\n {\n "id": "Directory Attribute -> ID",\n "title": "User ID",\n "type": "Directory Attribute",\n "attribute": "id",\n "required": true\n },\n {\n "id": "Alphanumeric Text -> Clearance",\n "title": "Clearance",\n "type": "Alphanumeric Text",\n "value": "None",\n "required": true\n }\n ],\n "version": 1\n },\n "onDelete": {\n "revokeIssuedCredentials": true\n },\n "openid4VCI": {\n "enabled": true,\n "scope": "p1:provision:credentials"\n },\n "visualizationTemplateData": {\n "displayFields": [\n {\n "dataFieldName": "Name",\n "showFieldName": true\n },\n {\n "dataFieldName": "User ID",\n "showFieldName": true\n }\n ]\n }\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "json"
require "net/http"
url = URI("{{apiPath}}/v1/environments/{{envId}}/credentialTypes")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"management": {
"mode": "MANAGED"
},
"cardType": "Card Developers",
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "\#000000",
"cardColor": "\#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"openid4VCI": {
"enabled": true,
"scope": "p1:provision:credentials"
},
"visualizationTemplateData": {
"displayFields": [
{
"dataFieldName": "Name",
"showFieldName": true
},
{
"dataFieldName": "User ID",
"showFieldName": true
}
]
}
})
response = http.request(request)
puts response.read_body
let parameters = "{\n \"title\": \"Card Developers\",\n \"description\": \"Card Developers Employee Credentials\",\n \"management\": {\n \"mode\": \"MANAGED\"\n },\n \"cardType\": \"Card Developers\",\n \"metadata\": {\n \"name\": \"Card Developers Employee Credentials\",\n \"description\": \"Card Developers Employee Credentials\",\n \"textColor\": \"#000000\",\n \"cardColor\": \"#FFFFFF\",\n \"backgroundImage\": \"data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==\",\n \"logoImage\": \"\",\n \"bgOpacityPercent\": 20,\n \"fields\": [\n {\n \"id\": \"Directory Attribute -> Name\",\n \"title\": \"Name\",\n \"type\": \"Directory Attribute\",\n \"attribute\": \"name.formatted\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> Address\",\n \"title\": \"Address\",\n \"type\": \"Directory Attribute\",\n \"attribute\": \"address\",\n \"required\": true\n },\n {\n \"id\": \"Directory Attribute -> ID\",\n \"title\": \"User ID\",\n \"type\": \"Directory Attribute\",\n \"attribute\": \"id\",\n \"required\": true\n },\n {\n \"id\": \"Alphanumeric Text -> Clearance\",\n \"title\": \"Clearance\",\n \"type\": \"Alphanumeric Text\",\n \"value\": \"None\",\n \"required\": true\n }\n ],\n \"version\": 1\n },\n \"onDelete\": {\n \"revokeIssuedCredentials\": true\n },\n \"openid4VCI\": {\n \"enabled\": true,\n \"scope\": \"p1:provision:credentials\"\n },\n \"visualizationTemplateData\": {\n \"displayFields\": [\n {\n \"dataFieldName\": \"Name\",\n \"showFieldName\": true\n },\n {\n \"dataFieldName\": \"User ID\",\n \"showFieldName\": true\n }\n ]\n }\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{apiPath}}/v1/environments/{{envId}}/credentialTypes")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
201 Created
{
"_links": {
"self": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/credentialTypes/8923a0ea-c3f8-4ff2-b47c-658657b27100"
},
"environment": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"credentialIssuerProfile": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/credentialIssuerProfile"
},
"version": {
"href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/credentialTypes/8923a0ea-c3f8-4ff2-b47c-658657b27100/versions/961a133b-1226-43bf-a754-2ba2c786d6f8"
}
},
"id": "8923a0ea-c3f8-4ff2-b47c-658657b27100",
"createdAt": "2026-06-09T16:32:01.752406909Z",
"updatedAt": "2026-06-09T16:32:01.752406909Z",
"environment": {
"id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
},
"issuer": {
"id": "43b3e256-8bcd-4eae-bbd8-48471bb1014e"
},
"management": {
"mode": "MANAGED"
},
"title": "Card Developers",
"description": "Card Developers Employee Credentials",
"cardType": "Card Developers",
"uri": "https://api.pingone.com/v1/distributedid/credentialTypes/8923a0ea-c3f8-4ff2-b47c-658657b27100",
"version": {
"number": 1,
"uri": "https://api.pingone.com/v1/distributedid/credentialTypes/8923a0ea-c3f8-4ff2-b47c-658657b27100/v1",
"id": "961a133b-1226-43bf-a754-2ba2c786d6f8"
},
"metadata": {
"name": "Card Developers Employee Credentials",
"description": "Card Developers Employee Credentials",
"textColor": "#000000",
"cardColor": "#FFFFFF",
"backgroundImage": "data:image/jpeg;base64,R0lGODlhIAAgAPEAAAAAAAAAM8wzMwAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgABACwAAAAAIAAgAAACc4yPqcvtD6OcNIiLsxZg7o91EgiKShYA6sq27Ymm7swumsHRLgfHOXuZ8RKkn6YVHBU3pscRUIRGntDSxSJoZICfzoZBLWFjvRBJdLMtQ4d0edkkE9dJDz1bQXzyNiK/1/bXRoaRd2d4SHGHJ0gi+Ai5UAAAOw==",
"logoImage": "",
"bgOpacityPercent": 20,
"fields": [
{
"id": "Directory Attribute -> Name",
"title": "Name",
"isVisible": false,
"type": "Directory Attribute",
"attribute": "name.formatted",
"required": true
},
{
"id": "Directory Attribute -> Address",
"title": "Address",
"isVisible": false,
"type": "Directory Attribute",
"attribute": "address",
"required": true
},
{
"id": "Directory Attribute -> ID",
"title": "User ID",
"isVisible": false,
"type": "Directory Attribute",
"attribute": "id",
"required": true
},
{
"id": "Alphanumeric Text -> Clearance",
"title": "Clearance",
"isVisible": false,
"type": "Alphanumeric Text",
"value": "None",
"required": true
}
],
"version": 1
},
"onDelete": {
"revokeIssuedCredentials": true
},
"visualizationTemplateData": {
"displayFields": [
{
"showFieldName": true,
"dataFieldName": "Name"
},
{
"showFieldName": true,
"dataFieldName": "User ID"
}
]
},
"systemProvided": false,
"openid4VCI": {
"enabled": false,
"scope": "p1:provision:credentials"
}
}