
# Forms
 
The Forms API allows you to create forms including the form fields needed for that form

## Forms_Properties
 
| Attributes         | Type     | Description                                                        
| -------------------| -------- | ------------------------------------------------------------------ 
| form_id            | integer  | Unique identifier for the form                                     
| form_name          | string   | Name of form                
| created_by         | integer  | holds user id by whome this form is created              
| created_at         | datetime | Timestamp of when the form was created  
| submit_button_label| string   | Submit button 
| Form_Fields        | string   | form fields available to crete a form  <a href="#form_fields">Form_Fields </a>



 ## Form_Fields
 
| Attributes    | Type     | Description                                                        
| --------------| -------- | ------------------------------------------------------------------ 
| field_id      | integer  | Unique identifier for the form field                                            
| form_id       | integer  | index key for form fields Unique identifier
| label         | string   | Address of the person or user                                      
| name          | string   | Name of this field                  
| type          | string   | text,email,password,number,tel,select,radio,checkbox,date,file,textarea,hidden
| placeholder   | string   | Name for field 
| required      | Enum     | specify that if this field is required true of false                             
| options       | string   | options available for this field                  
| pattern       | string   | provide pattern valiadtion for this field                              
| default_value | string   | default value for this field
| depend_on     | string   | field depend on                             
| accept        | string   | accept files img / video / document / zip 
| readonly      | Enum     | readonly true or false  
| order         | integer  | order number                        

 
## List all Forms

```shell
curl -X GET https://vedaay-api.mulika.in/forms
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
'{
    "status": "success",
    "message": "Forms retrieved successfully with fields",
    "code": 200,
    "pagination": {
        "current_page": 1,
        "per_page": 10,
        "total_records": 16,
        "total_pages": 2
    },
    "data": [
        {
            "form_id": "1",
            "form_name": "Contact Us Form",
            "created_by": "1",
            "created_at": "2026-03-09 14:38:42",
            "fields": [
                {
                    "field_id": "1",
                    "form_id": "1",
                    "label": "Full Name",
                    "name": "full_name",
                    "type": "text",
                    "placeholder": "Enter your full name",
                    "required": "true",
                    "options": null,
                    "pattern": "^[a-zA-Z ]+$",
                    "default_value": null,
                    "depend_on": null,
                    "accept": null,
                    "readonly": "false",
                    "order": "1"
                },
                {
                    "field_id": "2",
                    "form_id": "1",
                    "label": "Email Address",
                    "name": "emaill ",
                    "type": "email",
                    "placeholder": "your.email@example.com",
                    "required": "true",
                    "options": null,
                    "pattern": "^[^s@]+@[^s@]+.[^s@]+$",
                    "default_value": null,
                    "depend_on": null,
                    "accept": null,
                    "readonly": "true",
                     "order": "2"
                },
                {
                    "field_id": "3",
                    "form_id": "1",
                    "label": "Phone Number",
                    "name": "phone",
                    "type": "tel",
                    "placeholder": "+91-XXXXXXXXXX",
                    "required": "true",
                    "options": null,
                    "pattern": "^\\+?[1-9][0-9]{9,}$",
                    "default_value": null,
                    "depend_on": null,
                    "accept": null,
                    "readonly": "true",
                     "order": "3"
                },
                {
                    "field_id": "10",
                    "form_id": "1",
                    "label": "Message",
                    "name": "message",
                    "type": "textarea",
                    "placeholder": "Your message here...",
                    "required": "true",
                    "options": null,
                    "pattern": null,
                    "default_value": null,
                    "depend_on": null,
                    "accept": null,
                    "readonly": "true",
                    "order": "4"
                }
            ]
        }, 
        {
            "form_id": "5",
            "form_name": "Admission Form",
            "created_by": "4",
            "created_at": "2026-03-09 14:38:42",
            "fields": [
                {
                    "field_id": "8",
                    "form_id": "5",
                    "label": "Date of Birth",
                    "name": "dob",
                    "type": "date",
                    "placeholder": "YYYY-MM-DD",
                    "required": "true",
                    "options": null,
                    "pattern": null,
                    "default_value": null,
                    "depend_on": null,
                    "accept": null,
                    "readonly": "true",
                    "order": "1"
                },
                {
                    "field_id": "9",
                    "form_id": "5",
                    "label": "Gender",
                    "name": "gender",
                    "type": "select",
                    "placeholder": "Select gender",
                    "required": "false",
                    "options": "male,female,other",
                    "pattern": null,
                    "default_value": null,
                    "depend_on": null,
                    "accept": null,
                    "readonly": "true",
                    "order": "2"
                },
                {
                    "field_id": "21",
                    "form_id": "5",
                    "label": "name",
                    "name": "address",
                    "type": "text",
                    "placeholder": "Enter address",
                    "required": "true",
                    "options": "address",
                    "pattern": "^[a-zA-Z ]+$",
                    "default_value": "text",
                    "depend_on": "text",
                    "accept": "text",
                    "readonly": "true",
                    "order": "3"
                }
            ]
        }
    ]
}
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /forms
</span>  
 

1. GET /forms 
2. GET /forms?page=1&per_page=10
3. GET /forms?search=courses
4. GET /forms?exclude=2
5. GET /forms?include=4
6. GET /forms?order=asc
7. GET /forms?order=desc 

### Available parameters

| Parameters | Type     | Description                           
| ---------- | -------- | ----------------------------------- 
| page       | integer  | Current page of the collection. Default is 1.    
| per_page   | integer  | Maximum number of items to be returned in the result set. Default is 10.  
| search     | string   | Limit results to those matching a  string.                 
| exclude    | array    | Ensure the result set excludes specific  IDs.               
| include    | array    | Limit the result set to specific  IDs.
| order      | string   | Order sort attribute ascending or descending. Options: asc, desc. Default is desc 


## Get Single Form

```shell
curl -X GET https://vedaay-api.mulika.in/forms/2
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
 '{
    "status": "success",
    "message": "Form retrieved successfully with fields",
    "code": 200,
    "data": {
        "form_id": "8",
        "form_name": "calling form",
        "created_by": "107",
        "created_at": "2026-03-10 10:55:56",
        "fields": [
            {
                "field_id": "12",
                "form_id": "8",
                "label": "Email",
                "name": "email",
                "type": "email",
                "placeholder": "Enter Email",
                "required": "true",
                "options": "email",
                "pattern": "^[a-zA-Z ]+$",
                "default_value": "email",
                "depend_on": "email",
                "accept": "email",
                "readonly": "true"
            }
        ]
    }
}'
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #27cf3d; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">GET</span> /forms/{formsId}  
</span> 

### Parameters

| Parameter | Type    | Description                    |
| --------- | ------- | -------------------------------|
| form_id   | integer | Unique identifier for the form |

 

 
## Create Form Field


```shell
curl -X POST https://vedaay-api.mulika.in/forms \
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d ' {
    "form_name": "Default Form",
    "submit_button_label": "submit",
    "form_fields": [
        {
            "label": "Name",
            "name": "name",
            "type": "text",
            "placeholder": "name",
            "required": "true",
            "options": " ",
            "pattern": "",
            "default_value": "name",
            "depend_on": "",
            "accept": "",
            "readonly": "false",
            "order":"1"
        },
        {
            "label": "Email",
            "name": "email",
            "type": "email",
            "placeholder": "email",
            "required": "true",
            "options": "",
            "pattern": "^[a-zA-Z ]+$",
            "default_value": "",
            "depend_on": "email",
            "accept": "",
            "readonly": "false",
            "order":"2"
        } ,
        {
            "label": "Phone",
            "name": "phone",
            "type": "number",
            "placeholder": "phone",
            "required": "true",
            "options": "",
            "pattern": "^[a-zA-Z ]+$",
            "default_value": "",
            "depend_on": "phone",
            "accept": "",
            "readonly": "false",
            "order":"3"
        } ,
        {
            "label": "Message",
            "name": "message",
            "type": "text",
            "placeholder": "message",
            "required": "true",
            "options": "",
            "pattern": "^[a-zA-Z ]+$",
            "default_value": "",
            "depend_on": "message",
            "accept": "",
            "readonly": "false",
            "order":"4"
        } 
    ]
}'

 ```
> Responce:

```json
   '{
    "status": "success",
    "message": "Form and fields created successfully.",
    "code": 200,
    "data": {
        "form_id": "96",
        "form_name": "Default Form",
        "created_by": "294",
        "created_at": "2026-04-24 16:31:14",
        "submit_button_label": "submit",
        "fields": [
            {
                "field_id": "368",
                "form_id": "96",
                "label": "Name",
                "name": "name",
                "type": "text",
                "placeholder": "name",
                "required": "true",
                "options": " ",
                "pattern": "",
                "default_value": "name",
                "depend_on": "",
                "accept": "",
                "readonly": "false",
                "order": "1"
            },
            {
                "field_id": "369",
                "form_id": "96",
                "label": "Email",
                "name": "email",
                "type": "email",
                "placeholder": "email",
                "required": "true",
                "options": "",
                "pattern": "^[a-zA-Z ]+$",
                "default_value": "",
                "depend_on": "email",
                "accept": "",
                "readonly": "false",
                "order": "2"
            },
            {
                "field_id": "370",
                "form_id": "96",
                "label": "Phone",
                "name": "phone",
                "type": "number",
                "placeholder": "phone",
                "required": "true",
                "options": "",
                "pattern": "^[a-zA-Z ]+$",
                "default_value": "",
                "depend_on": "phone",
                "accept": "",
                "readonly": "false",
                "order": "3"
            },
            {
                "field_id": "371",
                "form_id": "96",
                "label": "Message",
                "name": "message",
                "type": "text",
                "placeholder": "message",
                "required": "true",
                "options": "",
                "pattern": "^[a-zA-Z ]+$",
                "default_value": "",
                "depend_on": "message",
                "accept": "",
                "readonly": "false",
                "order": "4"
            }
        ]
    }
}'
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #08c0b7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">POST</span> /forms
</span> 

 
 

## Update Form Fields

```shell
curl -X PUT https://vedaay-api.mulika.in/forms/24
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
-d '{
    "form_name": "caller form",
    "submit_button_label": "submit",
    "form_fields": [
        {
            "label": "addres",
            "name": "addres",
            "type": "text",
            "placeholder": "Enter addres",
            "required": "true",
            "options": "addres",
            "pattern": "^[a-zA-Z ]+$",
            "default_value": "text",
            "depend_on": "text",
            "accept": "text",
            "readonly": "true",
            "order": "1"
        },
        {
            "label": "phone",
            "name": "phone",
            "type": "number",
            "placeholder": "Enter phone",
            "required": "true",
            "options": "phone",
            "pattern": "^[a-zA-Z ]+$",
            "default_value": "text",
            "depend_on": "text",
            "accept": "text",
            "readonly": "true",
            "order": "2"
        }
    ]
}'

```
> Responce:

```json
   '{
    "status": "success",
    "message": "Form 'caller form' (ID: 24) updated successfully with 2 fields",
    "code": 200,
    "data": {
        "form_id": "24",
        "form_name": "caller form",
        "created_by": "107",
        "created_at": "2026-03-12 14:58:21",
        "submit_button_label": "submit",
        "fields": [
            {
                "field_id": "40",
                "form_id": "24",
                "label": "addres",
                "name": "addres",
                "type": "text",
                "placeholder": "Enter addres",
                "required": "true",
                "options": "addres",
                "pattern": "^[a-zA-Z ]+$",
                "default_value": "text",
                "depend_on": "text",
                "accept": "text",
                "readonly": "true",
                "order": "1"
            },
            {
                "field_id": "41",
                "form_id": "24",
                "label": "phone",
                "name": "phone",
                "type": "number",
                "placeholder": "Enter phone",
                "required": "true",
                "options": "phone",
                "pattern": "^[a-zA-Z ]+$",
                "default_value": "text",
                "depend_on": "text",
                "accept": "text",
                "readonly": "true",
                "order": "2"
            }
        ]
    }
}'
    
  
```

<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #08c0b7; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">PUT</span> /forms/{form_id} 
</span> 
 
### Parameters

| Parameter | Type    | Description                          |
| --------- | ------- | -------------------------------------|
| form_id   | integer | Unique identifier for the form       | 
 
## Delete form

```shell
curl -X DELETE https://vedaay-api.mulika.in/forms/5
-H "Content-Type: application/json" \
-H Authorization: Bearer eyJ0eXAiOiJKNiJ9.B7Y3J9FWtgjby4P8-LX_Vkeob6CE
```
> Responce:

```json
'{
    "status": "success",
    "message": "form and all associated data deleted successfully.",
    "code": 200,
    "data": {
        "form_id": "5",
        "form_name": "Admission Form"
    }
}'
```
<span style="background: #000; color: white; padding: 10px 10px; border-radius: 4px;  width: 100%;display: block;">
<span  style="background: #c91c05; color: white; padding: 8px 24px; border-radius: 2px; font-weight: bold; ">DELETE</span>/forms/{form_id} 
</span>
  