Save Lead / Contact Metadata
Save Lead / Contact Metadata
# Save Lead / Contact Metadata
Records incoming lead or inquiry contact information (phone number or email) and tags whether the person is an interested User (rider), Rider (driver), or Admin. Prevents duplicate contact submissions.
---
### Endpoint Overview
- **Method:** `POST`
- **Route:** `/api/v1/meta/create`
- **Authentication:** `None (Public)`
- **Content-Type:** `application/json`
---
### Request Headers
| Header | Type | Required | Description |
| --- | --- | --- | --- |
| `Content-Type` | `string` | **Yes** | Must be `application/json` |
---
### Request Body Schema
| Field | Data Type | Required | Default | Allowed Values / Constraints | Description |
| --- | --- | --- | --- | --- | --- |
| `person_is` | `enum` | **Yes** | — | `"USER""RIDER""ADMIN"` | Role or category of the contacting individual |
| `contact` | `string` | **Yes** | — | Min length 1 | Phone number or email address |
#### Example Request Body
``` json
{
"person_is": "RIDER",
"contact": "+919876543210"
}
```
---
### Response Body Schema (`200 OK`)
| Field | Data Type | Description |
| --- | --- | --- |
| `message` | `string` | Confirmation message (`"Data Saved"`) |
---
### Response Examples
#### 1\. `200 OK` — Data Saved Successfully
``` json
{
"message": "Data Saved"
}
```
#### 2\. `400 Bad Request` — Contact Already Exists
Returned when the contact has already been registered in the database:
``` json
{
"message": "Contact already exist"
}
```
#### 3\. `400 Bad Request` — Validation Error (Invalid Enum or Missing Fields)
``` json
{
"success": false,
"message": "Validation failed: person_is: Invalid enum value",
"errors": [
{
"field": "person_is",
"message": "Invalid enum value. Expected 'USER' | 'RIDER' | 'ADMIN'"
}
]
}
```
#### 4\. `500 Internal Server Error`
``` json
{
"error": "Failed to process request"
}
```
---
### Status Codes Reference
| HTTP Status Code | Condition |
| --- | --- |
| **`200 OK`** | Contact metadata saved successfully. |
| **`400 Bad Request`** | Input validation failure or contact already exists in database. |
| **`500 Internal Server Error`** | Server or database query error. |
Authentication
AuthorizationBearer
Bearer authentication of the form Bearer <token>, where token is your auth token.