# Consent API

This endpoint to check that user has taken opt-in or not.&#x20;

**URL:**&#x200B; <https://waapi.pepipost.com/api/v2/consent/>&#x20;

**Method:** POST

### Parameters:

| Parameter     | Description                                                | Data Type | Required |
| ------------- | ---------------------------------------------------------- | --------- | -------- |
| phone\_number | Provide the phone number which you have used while opt-in. | String    | Yes      |

### Request Body

```
{ 
    "phone_number":"919999999999", 
} 
```

### Responses

&#x20;**In case of Success :**

```
{ 
    "status": "success", 
    "data": { 
        "ip": "192.168.7.26", 
        "phone_number": "919999999999", 
        "optin_source": "6465466", 
        "user_agent": "Mozilla", 
        "created_date": "2019-04-22 15:36:01.0" 
    } 
} 
```

Status is success means optin added successfully.

**In case of failure:**

```
{ 
    "status": "failure", 
    "error": { 
        "message": "Optin details not found for 919999999999" 
    } 
} 
```

According to error, code and message will change.


---

# 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://wadocs.pepipost.com/sending-message/consent-api.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.
