---
title: Email Scraper - Consent
slug: api-marketplace/email-scraper-consent
createdAt: 2024-04-25T10:22:43.006Z
---

## Introduction:

This endpoint provides a link where the user can grant consent for the application to access their Gmail account.

## Sample Curl:

:::CodeblockTabs
preproduction

```curl
curl --location --request POST 'https://api-preproduction.signzy.app/api/v3/email-search/consent' \
--header 'Authorization: <auth-token>' \
--data ''
```

production

```curl
curl --location --request POST 'https://api.signzy.app/api/v3/email-search/consent' \
--header 'Authorization: <auth-token>' \
--data ''
```
:::

## Sample Output:

```json
{
    "result": {
        "requestId": "1ce18125-7200-439e-bb2e-0d95dd66b52c",
        "url": "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly&state=1ce18125-7200-439e-bb2e-0d95dd66b52c&response_type=code&client_id=510491745373-484ns0gefm2787amtjd06p7l5foi23je.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fapi.signzy.app%2Fapi%2Fv3%2Finternals%2Femail-callback"
    }
}
```

## Output Parameters:

| Parameter        | Type          | Description                                                                                     |
| ---------------- | ------------- | ----------------------------------------------------------------------------------------------- |
| result           | Object        | Contains the output of the API                                                                  |
| result.requestId | String / UUID | Unquie ID associated with each request. It will be used to fetch the data once consent is given |
| result.url       | String / URL  | URL to provide the user's Gmail consent.                                                        |



## Status Codes:

:::CodeblockTabs
200 OK

```json
{
    "result": {
        "requestId": "1ce18125-7200-439e-bb2e-0d95dd66b52c",
        "url": "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.readonly&state=1ce18125-7200-439e-bb2e-0d95dd66b52c&response_type=code&client_id=510491745373-484ns0gefm2787amtjd06p7l5foi23je.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fapi.signzy.app%2Fapi%2Fv3%2Finternals%2Femail-callback"
    }
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

500

```json
{
    "error": {
        "name": "error",
        "message": "Internal Server Error",
        "status": 500,
        "reason": "ERROR",
        "type": "Internal Server Error",
        "statusCode": 500
    }
}
```
:::



