# Creating a Credential Type

## Background

A credential holds one or multiple claims. A claim can be a name or an email address. If the claim is wrapped by a digital signature of a trustworthy issuer the user can provider a list of claims to some service provider to identify and authenticate for some service.

For example can a credential type contain the fields *Name* and *Email Address*. This credential type can then be used to create verifiable credentials for user who use the credentials for password-less logins. In the login process the user shows the credential to the service provider who checks the data, checks the issuer and the issuer's signature, and finally grants access to the service because data is valid and the issuer can be trusted.&#x20;

In API calls the credential type is referred by its ID. So, to create a verifiable credential the client application of the issuer sends a data record that contains the credential ID (\`templateid\`) to refer to the respective credential type, and the data fields containing the actual data to the API to request a creation of the respective verifiable credential:&#x20;

```json
{
  templateid: 18,
  data: {
    name: "Rheik van Eyck",
    email: "rveyck@example.com"
  }
}
```

## Creating a Claim Type

Login into the sideos administration console. If you don't have already an account, sign up with sideos (see [](https://doc.sideos.io/sideos-api-documentation/sign-up-and-get-started "mention")).

<figure><img src="https://1845885721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbCooZXcPwZpoBiEXpWdN%2Fuploads%2FYIko13jrPZvIFgsvGof5%2FScreen%20Shot%202024-02-23%20at%2018.58.57%20PM.png?alt=media&#x26;token=b0951992-c0a4-4bac-a3b7-7acd91ee0437" alt=""><figcaption></figcaption></figure>

In the navigation bar go to *Claims* and click on *Add new claim.*

If a claim fitting the requirements is not available in the list, click on *create new claim* in the description above the table.

Complete the form by naming the new credential type in the field **Name.** Chose a **Type** from existing types you probably already defined. In our case the type email is probably not available, so we select *Other* from the bottom of the selection list.

Give the new type a name, e.g. *name*.&#x20;

Select the **Context** for the new type. The options include DataFeedItem, Boolean, Number, and Image. For the name type which represents a string, the DataFeedItem is the right option.&#x20;

Optional you can provide a description in the **Description** text box.

<figure><img src="https://1845885721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbCooZXcPwZpoBiEXpWdN%2Fuploads%2FWMW8jbmOVUJXQztMLN8C%2FScreen%20Shot%202024-02-23%20at%2019.08.55%20PM.png?alt=media&#x26;token=8a3d6c4c-b2f1-4e69-ad5b-1e2a9b32e798" alt=""><figcaption><p>Creating a new claim type</p></figcaption></figure>

Save the claim by clicking on the *Save* button.&#x20;

To create another claim type for the **email claim**, repeat the steps to create the email claim type. &#x20;

Once we have the claim types for the name and email for our example we can create a credential type.

## Creating a Credential Type

A credential type combines one or more claim type to build an identity context. A company badge for an employee for example may contain the name of the employee, the employee id number, the department, the role, the user id, contact data, emergency contacts, and permission sets as claims.&#x20;

In the navigation bar go to *Credentials* and click on *Create template.* There may be already credentials in a company repository available. You can check by clinking on the button *Pick from repository.*&#x20;

Lets assume you want to create a new credential type, so go ahead and click on the button C*reate template*.

Complete the form by choosing an existing or entering a new type in the field **Credential type.**&#x20;

Give the new type a name, e.g. *User* in the field **Name**.&#x20;

Add claim types to the credential type by selecting proofs in the selection field **Claim 1**. In our example we would select the **Name** claim type. Then we add another claim type by clicking on the (+) button and select the **Email** claim type as **Claim 2.**&#x20;

Optional you can provide a description in the **Description** text box.

<figure><img src="https://1845885721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbCooZXcPwZpoBiEXpWdN%2Fuploads%2F8waQo6plSQBHsJGA77Ht%2FScreen%20Shot%202024-02-23%20at%2019.25.56%20PM.png?alt=media&#x26;token=a7576ddb-9d65-437f-9b7b-0a76c058c708" alt=""><figcaption><p>Creating a new credential type</p></figcaption></figure>

You can save the new credential type as draft by clicking on the button *Save as draft* or save as completed by clicking on the button *Save as complete*.&#x20;

Back in the list of defined credentials note the **ID** of your new credential type. In the Screenshot below the *User* credential type has ID 18.&#x20;

<figure><img src="https://1845885721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbCooZXcPwZpoBiEXpWdN%2Fuploads%2FMUnAToNyGvFoqxHnlxKJ%2FScreen%20Shot%202024-02-23%20at%2019.29.20%20PM.png?alt=media&#x26;token=aedb3f70-3c99-40fd-b723-758bcfaae7e4" alt=""><figcaption><p>List of available credential type in the account.</p></figcaption></figure>
