> For the complete documentation index, see [llms.txt](https://guardian.hedera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guardian.hedera.com/docs/3.5.1/guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/prerequesite-steps.md).

# Prerequesite Steps

Prior to creating a policy there are a few steps that need to be done first. Please see below for the prerequisite steps:

### **New Standard Registry registration**

<mark style="color:green;">`POST`</mark> `/api/v1/accounts/register`

#### Request Body

| Name                                       | Type   | Description        |
| ------------------------------------------ | ------ | ------------------ |
| username<mark style="color:red;">\*</mark> | String | njkqur8x           |
| password<mark style="color:red;">\*</mark> | String | test               |
| role<mark style="color:red;">\*</mark>     | String | STANDARD\_REGISTRY |

{% tabs %}
{% tab title="201: Created Created" %}

```typescript
{
  username: string
  password: string
  password_confirmation: string
  role: string
}
```

{% endtab %}
{% endtabs %}

## **Authentication Process**

### **Login**

<mark style="color:green;">`POST`</mark> `/api/v1/accounts/login`

#### Request Body

| Name                                       | Type   | Description      |
| ------------------------------------------ | ------ | ---------------- |
| username<mark style="color:red;">\*</mark> | String | StandardRegistry |
| password<mark style="color:red;">\*</mark> | String | test             |

{% tabs %}
{% tab title="200: OK Successful Operation" %}

```javascript
"username": "StandardRegistry",
    "did": "did:hedera:testnet:5jDN1zBJPjjQhRDZ4MV3q5CFUVM99WvfJ3zMLLhLS2yk_0.0.7495695",
    "role": "STANDARD_REGISTRY",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.....",
    "weakPassword": false
```

{% endtab %}
{% endtabs %}

### **Access Token**

<mark style="color:green;">`POST`</mark> `/api/v1/accounts/access-token`

#### Request Body

| Name                                           | Type   | Description                                 |
| ---------------------------------------------- | ------ | ------------------------------------------- |
| refreshToken<mark style="color:red;">\*</mark> | String | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9....... |

{% tabs %}
{% tab title="200: OK Successful Operation" %}

```
{
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9......
}
```

{% endtab %}
{% endtabs %}

### Account Session

<mark style="color:blue;">`GET`</mark> `/api/v1/accounts/session`

#### Headers

| Name                 | Type   | Description                                |
| -------------------- | ------ | ------------------------------------------ |
| Authorization Bearer | String | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...... |

{% tabs %}
{% tab title="200: OK Successful Operation" %}

```
 "_id": "659e8127db770133c0d8fb26",
    "createDate": "2024-01-10T11:36:07.320Z",
    "updateDate": "2024-01-23T13:53:36.347Z",
    "username": "StandardRegistry",
    "password": "9f86d081884c7d659.....",
    "did": "did:hedera:testnet:5jDN1zBJPjjQhRDZ4MV3q5CFUVM99.....",
    "walletToken": "",
    "hederaAccountId": "0.0.749...",
    "role": "STANDARD_REGISTRY",
    "refreshToken": "a0dbe6f.....",
    "id": "659e8127db770133c..."
```

{% endtab %}
{% endtabs %}

## **Account Creations**

### **Hedera account creation**

<mark style="color:blue;">`GET`</mark> `/api/v1/demo/random-key`

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    
	"id":"0.0.29511776",
	"key":"302e020100300506032b6570042204200c8d2abbdd9aee64eed6e4891c276aa50248ab182c0cd7dfbec8506e5eaaaef8"

}
```

{% endtab %}
{% endtabs %}

### **Address book creation**

<mark style="color:orange;">`PUT`</mark> `/api/v1/profile`

#### Request Body

| Name                                               | Type   | Description                                                                                      |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------ |
| hederaAccountId<mark style="color:red;">\*</mark>  | String | 0.0.29511776                                                                                     |
| hederaAccountKey<mark style="color:red;">\*</mark> | String | 302e020100300506032b6570042204200c8d2abbdd9aee64eed6e4891c276aa50248ab182c0cd7dfbec8506e5eaaaef8 |
| name<mark style="color:red;">\*</mark>             | String | DD                                                                                               |
| type<mark style="color:red;">\*</mark>             | String | StandardRegistry                                                                                 |
| context<mark style="color:red;">\*</mark>          | String | <https://localhost/schema>                                                                       |
| aopnetname<mark style="color:red;">\*</mark>       | String | Test Identity SDK appnet                                                                         |
| didSrverURL<mark style="color:red;">\*</mark>      | URL    | <http://localhost:3000/api/v1>                                                                   |
| didTopicMemo<mark style="color:red;">\*</mark>     | String | Test Identity SDK appnet DID topic                                                               |
| vcTopicMemo<mark style="color:red;">\*</mark>      | String | Test Identity SDK appnet DID topic                                                               |

### **iRec schema creation**

<mark style="color:green;">`POST`</mark> `/api/v1/schemas`

#### Request Body

| Name                                          | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| uuid<mark style="color:red;">\*</mark>        | String | d018a6ce-71f0-4bc5-9380-6bae4d4bb5bb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| status<mark style="color:red;">\*</mark>      | String | DRAFT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| readonly<mark style="color:red;">\*</mark>    | String | False                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| name<mark style="color:red;">\*</mark>        | String | iRec                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| description<mark style="color:red;">\*</mark> | String | iRec Application Form                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| entity<mark style="color:red;">\*</mark>      | String | VC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| owner                                         | String |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| version                                       | String |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| document<mark style="color:red;">\*</mark>    | String | {"$id":"#d018a6ce-71f0-4bc5-9380-6bae4d4bb5bb","$comment":"{ \\"term\\": \\"d018a6ce-71f0-4bc5-9380-6bae4d4bb5bb\\", \\"@id\\": \\"<https://localhost/schema#d018a6ce-71f0-4bc5-9380-6bae4d4bb5bb\\\\>" }","title":"iRec","description":"iRec application form","type":"object","properties":{"@context":{"oneOf":\[{"type":"string"},{"type":"array","items":{"type":"string"}}],"readOnly":true},"type":{"oneOf":\[{"type":"string"},{"type":"array","items":{"type":"string"}}],"readOnly":true},"id":{"type":"string","readOnly":true},"field0":{"title":"Test field","description":"Test field","readOnly":false,"$comment":"{ \\"term\\": \\"field0\\", \\"@id\\": \\"<https://www.schema.org/text\\\\>" }","type":"string"},"field1":{"title":"Required field","description":"Required field","readOnly":false,"$comment":"{ \\"term\\": \\"field1\\", \\"@id\\": \\"<https://www.schema.org/text\\\\>" }","type":"string"},"field2":{"title":"Multiple field","description":"Multiple field","readOnly":false,"type":"array","items":{"type":"string"},"$comment":"{ \\"term\\": \\"field2\\", \\"@id\\": \\"<https://www.schema.org/text\\\\>" }"},"policyId":{"title":"policyId","description":"policyId","readOnly":true,"$comment":"{ \\"term\\": \\"policyId\\", \\"@id\\": \\"<https://www.schema.org/text\\\\>" }","type":"string"}},"required":\["@context","type","field1","policyId"],"additionalProperties":false} |

{% tabs %}
{% tab title="200: OK Successful Operation" %}

```javascript
{
    ...
	{
		"id":"61ee7ecd9c02660014fa662e",
		...
	}
}
```

{% endtab %}
{% endtabs %}

### **iRec schema publish**

<mark style="color:orange;">`PUT`</mark> `/api/v1/schemas/61ee7ecd9c02660014fa662e/publish`

#### Request Body

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| version<mark style="color:red;">\*</mark> | String | {"version":"1.0.0"} |

{% tabs %}
{% tab title="200: OK Ok" %}

{% endtab %}

{% tab title="403: Forbidden Forbidden" %}

{% endtab %}

{% tab title="404: Not Found Not Found" %}

{% endtab %}

{% tab title="422: Unprocessable Entity Unprocessable Entity" %}

```
Version already exists.
```

```
Schema is published.
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

{% endtab %}
{% endtabs %}

### **Token creation**

<mark style="color:green;">`POST`</mark> `/api/v1/tokens`

#### Request Body

| Name                                            | Type    | Description |
| ----------------------------------------------- | ------- | ----------- |
| tokenName<mark style="color:red;">\*</mark>     | String  | iRec        |
| tokenSymbol<mark style="color:red;">\*</mark>   | String  | iRec        |
| tokenType<mark style="color:red;">\*</mark>     | String  | fungible    |
| decimals<mark style="color:red;">\*</mark>      | String  | 2           |
| initialsupply<mark style="color:red;">\*</mark> | String  | 0           |
| enableAdmin                                     | Boolean | true        |
| changeSupply                                    | Boolean | true        |
| enableFreeze                                    | Boolean | true        |
| enableKYC                                       | Boolean | true        |
| enableWipe                                      | Boolean | true        |

{% tabs %}
{% tab title="201: Created Created" %}

```javascript
{
    
		"id":"61ee817b9c02660014fa662f",
		"tokenId":"0.0.29511821",
		...
	
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Unprocessable Entity" %}

```
User not registered
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guardian.hedera.com/docs/3.5.1/guardian/standard-registry/policies/policy-creation/creating-a-policy-using-apis/prerequesite-steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
