# Create A Property Of An Entity

## Create a property in already existing entity

<mark style="color:green;">`POST`</mark> `/api/v1/{entity-type}/{id}/{entity-property}`

#### Path Parameters

| Name                                              | Type   | Description                                                  |
| ------------------------------------------------- | ------ | ------------------------------------------------------------ |
| entity-type<mark style="color:red;">\*</mark>     | String | Type of entity to update                                     |
| id<mark style="color:red;">\*</mark>              | String | id of the entity to update                                   |
| entity-property<mark style="color:red;">\*</mark> | String | entity Property which to be added in already existing entity |

#### Headers

| Name                                           | Type   | Description                                                                                 |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------- |
| authorization                                  | String | Set to `Bearer {access-token}` if roles in Schema is not anonymous. Else token can be empty |
| content-type<mark style="color:red;">\*</mark> | String | Set to `application/json`                                                                   |

#### Request Body

| Name                                  | Type   | Description            |
| ------------------------------------- | ------ | ---------------------- |
| ...<mark style="color:red;">\*</mark> | Object | Property to be updated |

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

```json
{
    "id": "sunbird-rc.registry.update",
    "ver": "1.0",
    "ets": 1669113170690,
    "params": {
        "resmsgid": "",
        "msgid": "85057df5-d4d6-4e7b-8bb1-a774f689e9c8",
        "err": "",
        "status": "SUCCESSFUL",
        "errmsg": ""
    },
    "responseCode": "OK"
}
```

{% endtab %}
{% endtabs %}

## Usage

### cURL

```
curl --location \
	--request 'POST' \
	--header 'content-type: application/json' \
	--header 'authorization: bearer {access-token}' \
	--data-raw '{
		"city": "Ahmedabad"
	}' \
	'{registry-url}/api/v1/{entity-type}/{id}/{entity-property}'
```

### HTTPie

```
printf '{
		"city": "Ahmedabad"
	}' | http POST \
	'{registry-url}/api/v1/{entity-type}/{id}/{entity-property}' \
	'content-type: application/json' \
	'authorization: Bearer {access-token}'
```

> `{registry-url}` is usually [http://localhost:{port}](https://docs.sunbirdrc.dev/api-reference/registry/http:/localhost:{port}). The port can be found under the `registry` section in the `docker-compose.yml` file and is usually `8081`.


---

# Agent Instructions: 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://docs.sunbirdrc.dev/api-reference/registry/create-a-property-of-an-entity.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.
