# Form Attribute

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/forms/5/attributes" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/forms/4/attributes/18" method="get" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}

## add form attribute

<mark style="color:green;">`POST`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/forms/4/attributes`

#### Request Body

| Name              | Type    | Description                                            |
| ----------------- | ------- | ------------------------------------------------------ |
| label             | String  | Form atributes label                                   |
| required          | String  | Set True make a form required and False for optional   |
| type              | String  | Attribute type                                         |
| input             | String  | form input type                                        |
| cardinality       | Integer |                                                        |
| priority          | Integer | Set priority value                                     |
| config            | String  |                                                        |
| response\_private | String  | Set True to make the response private and False to not |
| key               | String  | Form attributes key                                    |
| form\_stage\_id   | Integer | Form stager ID                                         |
| default           | String  |                                                        |
| instructions      | String  | Form instructions                                      |

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

```javascript
{
    "id": 53,
    "url": "http://localhost:8000/api/v3/form_attributes/53",
    "key": "557d9375-fe6d-4b21-9f7e-95528342bbe4",
    "label": "Test Field Level Locking 1",
    "instructions": null,
    "input": "text",
    "type": "text",
    "required": false,
    "default": null,
    "priority": 0,
    "options": [],
    "cardinality": 1,
    "config": null,
    "form_stage_id": 7,
    "response_private": true,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

## edit form attribute

<mark style="color:orange;">`PUT`</mark> `https://ushahididocs.api.ushahidi.io/api/v3/forms/4/attributes/18`

#### Request Body

| Name              | Type    | Description                                            |
| ----------------- | ------- | ------------------------------------------------------ |
| label             | String  | Form atributes label                                   |
| required          | String  | Set True make a form required and False for optional   |
| type              | String  | Attribute type                                         |
| input             | String  | form input type                                        |
| cardinality       | Integer |                                                        |
| priority          | Integer | Set priority value                                     |
| config            | String  |                                                        |
| response\_private | String  | Set True to make the response private and False to not |
| key               | String  | Form attributes key                                    |
| form\_stage\_id   | Integer | Form stager ID                                         |
| default           | String  |                                                        |
| instructions      | String  | Form instructions                                      |

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

```javascript
{
    "id": 53,
    "url": "http://localhost:8000/api/v3/form_attributes/53",
    "key": "557d9375-fe6d-4b21-9f7e-95528342bbe4",
    "label": "Test Field Level Locking 1",
    "instructions": null,
    "input": "text",
    "type": "text",
    "required": false,
    "default": null,
    "priority": 0,
    "options": [],
    "cardinality": 1,
    "config": null,
    "form_stage_id": 7,
    "response_private": true,
    "allowed_privileges": [
        "read",
        "create",
        "update",
        "delete",
        "search"
    ]
}
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/DFxnj85ZsASPYXzkPAko" path="/api/v3/forms/4/attributes/18" method="delete" %}
[UshahidiV3.json](https://content.gitbook.com/content/tXIYKGMTeHub5C8O9fER/blobs/TC8KXqdBoVrA1ZGmo9Kk/UshahidiV3.json)
{% endopenapi %}


---

# 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.ushahidi.com/v3-ushahidi-platform-rest-api-documentation/v3/forms/form-attribute.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.
