> For the complete documentation index, see [llms.txt](https://docs.guardianservice.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.guardianservice.app/technical-information/users/standard-registry-users-schemas-and-policies/policies/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 prerequesite 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" %}

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

{% endtab %}
{% endtabs %}

### **Login**

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

#### Request Body

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

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

````javascript
```typescript
{
  username: string
  did: any
  role: string
  accessToken: string
}
```
````

{% endtab %}
{% endtabs %}

### **Hedera account creation**

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

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

```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="500: Internal Server Error Internal Server Error" %}

{% endtab %}

{% tab title="422: Unprocessable Entity Unprocessable Entity" %}
Version already exists.
{% 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" %}

```
{
    
		"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, and the optional `goal` query parameter:

```
GET https://docs.guardianservice.app/technical-information/users/standard-registry-users-schemas-and-policies/policies/creating-a-policy-using-apis/prerequesite-steps.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
