---
title: Create Consent Request
slug: api-marketplace/d9m9-create-consent-request
description: Learn about Account Aggregator, a decentralized data sharing system for regulated entities to share user data. This document covers retrieving transactional data and future additions, along with API guidelines for requesting user consent through SMS. Expl
createdAt: 2022-10-14T04:13:59.000Z
---

## Introduction

Account Aggregator is a decentralized data-sharing system that allows regulated entities to share user data amongst each other through a consent-based user flow. Other variables will be added by the AA ecosystem in the future.

To retrieve the required financial details of the user, the API will respond with a&#x20;

## API Input Guidelines

Need to pass on the following information:

- A valid Mobile number
- A valid ConsentTemplateId
- A valid RedirectUrl
- A valid Identifiers object
  - Pan
  - Email
  - Dob
- A valid Webhook object
  - ConsentStatus
  - DataPush
  - FlowRunStatus&#x20;

::::Tabs
:::Tab{title="Single Consent Flow"}
```curl
curl --request POST \
  --url https://api-preproduction.signzy.app/api/v3/account-aggregator-switch/consent-request \
  --header 'Authorization: <token>' \
  --header 'Content-Type: application/json' \
  --data '{
	"mobileNumber" : "<mobile-number>",	
	"consentTemplateId" : "<consent-TemplateId>",
	"redirectUrl" : "<redirect-Url>",
	 "identifiers": { // this is optional
        "pan": "<pan>",
        "email": "<email>",
        "dob": "<Date-of-birth YYYY-MM-DD>"
    },
    "webhook": { // this is optional
        "consentStatus": "<consent-Status>",
        "dataPush": "<data-Push>",
        "flowRunStatus": "<flow-Run-Status>"
    }
}'
```
:::

:::Tab{title="Preproduction MultiConsent"}
```curl
curl --request POST \
  --url https://api-preproduction.signzy.app/api/v3/account-aggregator-switch/consent-request \
  --header 'Authorization: <token>' \
  --header 'Content-Type: application/json' \
  --data '{
	"mobileNumber" : "<mobile-number>",	
	"redirectUrl" : "<redirect-Url>",
	 "identifiers": {
        "pan": "<pan>",
        "email": "<email>",
        "dob": "<Date-of-birth YYYY-MM-DD>"
    },
    "multiConsentJourney": true, 
    "consents": [
        {
            "id": "id1",
            "webhook": {
                "dataPush": "https://webhook.site/b3e7b0ff-5887-4025-b74d-c83c2d1e6c74",
                "consentStatus": "https://webhook.site/b3e7b0ff-5887-4025-b74d-c83c2d1e6c74",
                "flowRunStatus": "https://webhook.site/b3e7b0ff-5887-4025-b74d-c83c2d1e6c74"
            },
            "autoFetch": true,
            "consentTemplateId": "a7eaddb6-b5b0-4871-ae40-84c0ac5c5139"
        },
        {
            "id": "id2",
            "webhook": {
                "dataPush": "https://webhook.site/b3e7b0ff-5887-4025-b74d-c83c2d1e6c74",
                "consentStatus": "https://webhook.site/b3e7b0ff-5887-4025-b74d-c83c2d1e6c74",
                "flowRunStatus": "https://webhook.site/b3e7b0ff-5887-4025-b74d-c83c2d1e6c74"
            },
            "autoFetch": false,
            "consentTemplateId": "961d6516-4712-4c57-a3a2-cdd1b7670edf"
        }
    ]

}'
```
:::

:::Tab{title="Production"}

:::
::::

### Input Parameters

| **PARAMETER NAME**                 | **REQUIRED**/**OPTIONAL** | **DESCRIPTION**                                                                                                                                                                                           | **TYPE** |
| ---------------------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| mobileNumber                       | Required                  | Mobile number of the user                                                                                                                                                                                 | String   |
| consentTemplateId                  | Conditonally Required     | consentTemplateId (This is the identify if the user wants to fetch details onetime or periodic), if it is a multi consent journey then "consents" array will contain consentTemplateId and other details. | String   |
| redirectUrl                        | Optional                  | redirectUrl is the url where the user will be directed to after the consent is                                                                                                                            | String   |
| identifiers.pan                    | Optional                  | The pan Id of the user                                                                                                                                                                                    | String   |
| identifiers.email                  | Optional                  | The email of the user                                                                                                                                                                                     | String   |
| identifiers.dob                    | Optional                  | The date of birth of the user YYYY-MM-DD format                                                                                                                                                           | String   |
| webhook.consentStatus              | Optional                  | The webhook to post consentStatus id                                                                                                                                                                      |          |
| webhook.dataPush                   | Optional                  | The webhook to post the data                                                                                                                                                                              |          |
| webhook.flowRunStatus              | Optional                  | The webhook to flow Run status                                                                                                                                                                            |          |
| multiConsentJourney                | Optional                  | To be default as true/false,default is taken as false                                                                                                                                                     |          |
| consents                           | Conditionally Required    | If it is a multi-consent then needs to be passed. It will have the list of the all consents which will be running in the journey.                                                                         |          |
| consents.\[].id                    | Required                  |                                                                                                                                                                                                           |          |
| consents.\[].webhook.consentStatus | Optional                  | The webhook to post consentStatus id                                                                                                                                                                      |          |
| consents.\[].webhook.dataPush      | Optional                  | The webhook to post the data                                                                                                                                                                              |          |
| consents.\[].webhook.flowRunStatus | Optional                  | The webhook to flow Run status                                                                                                                                                                            |          |
| consents.\[].autoFetch             | Required                  | Flag to auto fetch data or not, if marked false then FI request API needs to be called to request data                                                                                                    |          |
| consents.\[].consentTemplateId     | Conditonally Required     | consentTemplateId (This is the identify if the user wants to fetch details onetime or periodic), if it is a multi consent journey then "consents" object is consent                                       |          |

### Sample Response

:::CodeblockTabs
Single Consent

```json
{
    "result": {
     "requestId": "<signzy-generated-reqId>",
     "internalId": "<internal->",
     "consentHandle": "<consentHandleId>",
     "redirectUrl": "<redirect-Url>"
    }
}
```

Multi consent

```none
{
    "result": {
        "requestId": "70437a44-311d-4f6a-bfd4-820228b53ad1",
        "internalId": "<internal->",
        "consentHandles": { //Optional
            "id2": {
                "consentHandle": "fdca9f59-98db-42ea-9767-0cfd18619ae9"
            },
            "id1": {
                "consentHandle": "69c1b333-e482-43e2-8446-5e7b9e9d715f"
            }
        },
        "redirectUrl": "<redirect URL>"
    }
}
```
:::

### Response Parameter

| **PARAMETER NAME**                      | **DESCRIPTION**                                                                                             | **TYPE** |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -------- |
| result                                  | This holds final result parameters of the response.                                                         |          |
| result.requestId                        | Unique Request Id generated for the user.                                                                   | String   |
| result.consentHandle                    | consent handle Id (used for tracking the consent approval status).                                          | String   |
| result.internalId                       | The Request Id given by the AA.                                                                             | String   |
| result.redirectUrl                      | Redirectional Url                                                                                           | String   |
| results.consentHandles.id               | Passed in the Input body corresponding to a consent for multi consent journeys                              | Object   |
| results.consentHandles.id.consentHandle | consent handle Id (used for tracking the consent approval status). Passed in case of Multi consent journeys | string   |

## Error Codes

| Error Code | Description                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------- |
| 400        | Bad Request: In case the request is not as per required schema or any other case               |
| 401        | Unauthorized: Authentication failed or user does not have permissions for requested operation. |
| 409        | Upstream Error/Conflict: Something wrong on AA's side.                                         |
| 500        | Internal Server Error: An error occurred on the server.                                        |

##

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

