> ## Documentation Index
> Fetch the complete documentation index at: https://docs-saas.primeearn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get surveys

> Get the surveys available to one of your users. Creates the user on the first call.

Call this endpoint from your server whenever you need the survey list for a user. It returns the user hash `uh`, which you need for the [qualification endpoints](https://docs-saas.primeearn.com/partner-saas/qualification/start.md), and up to 50 surveys sorted by relevance.

## Query parameters

**app** `string` *required*

Your app hash.

**external\_user\_id** `string` *required*

Your ID for the user. The user is created on the first call.

**ip** `string` *required*

The user's IPv4 address. IPv6 is not supported. Surveys are matched to the user's country from this IP.

**output** `string` *required*

Always `API`.

**user\_agent** `string`

The user's browser user agent. Required unless you send `device`. Used to detect the device type.

**device** `string`

`desktop`, `mobile` or `tablet`. Required unless you send `user_agent`. When both are sent, `user_agent` wins.

**token** `string`

Your app API token. Required when secure API mode is on for your app.

**limit** `integer`

Maximum number of surveys to return. Up to `50`.

**min\_cpi** `number`

Only return surveys whose `publisher_payout` (USD) is at least this value.

**locale** `string`

The user's interface language, for example `en` or `de`. Up to 5 characters.

### Profile parameters

Send what you know about the user so they get better-matched surveys and fewer qualification questions. These values are saved when the user is new, or when no birth date is stored for them yet.

**birthday** `string`

Birth date as `YYYY-MM-DD`. `birthdate` is accepted as an alias.

**age** `integer`

Age, 1 to 120. Used only when no birth date is sent.

**gender** `string`

`male`, `female`, `m` or `f`.

**zip** `string`

Postal code.

## Response

**status** `string` *required*

`success`, or `error` for validation and rate-limit errors.

**uh** `string`

User hash. Use it as `Bearer {uh}` on the qualification endpoints.

**count** `integer`

Number of surveys returned.

**message** `string | null`

`null` when surveys were returned. Otherwise it says why the list is empty. See [Empty results](#empty-results).

**errors** `object`

Only on validation errors: field name to a list of messages.

**surveys** `object[]`

**survey properties**

**hash** `string`

Survey hash. Send it as `survey` to Start qualification.

**id** `integer`

Numeric survey ID.

**loi** `integer | null`

Estimated length of interview, in minutes.

**publisher\_payout** `number`

What you earn for a complete, in USD.

**user\_reward** `integer`

Reward to show the user, in your app's currency, bonuses included.

**user\_reward\_without\_bonus** `integer`

Same reward before bonuses.

**bonus** `number`

Bonus on this survey, in percent.

**conversion\_rate** `number`

Share of entrants who complete, 0 to 100.

**score** `number`

Ranking score. Surveys are already sorted by it.

**user\_rating\_avg** `number`

Average user rating, in steps of 0.5. `0` when there are not enough ratings.

**user\_rating\_count** `integer`

Number of user ratings.

**hot** `integer`

`1` for high-converting surveys, otherwise `0`.

**url** `string`

Survey entry link. Send the user here to qualify on the survey page instead of using the qualification API.

**order** `integer`

Position in the list, starting at 1.

> [!NOTE]
>
> Extra survey fields, such as `supplier_id` or `buyer_id`, can be turned on for your app. Ask your account manager.

## Empty results

When there are no surveys, `status` is still `success`, `count` is `0` and `message` says why:

| `message` | Meaning |
| - | - |
| `no_surveys` | No surveys match this user right now. Try again later. |
| `inactive_user` | The user is inactive, or your app or the user's country is disabled. |
| `disabled_app_or_country` | Your app or the requested country is disabled. |
| `disabled_source` | The traffic source is disabled for your app. |
| `unallowed_user_creation [N]` | A new user could not be created, for example because new users are disabled for your app or country. |
| `banned`, `on_hold`, `on_review` | The user's account is restricted. |
| `vpn_detected`, `location_error` | The user's IP is a VPN, or its location doesn't match. |
| `failed_to_upsert_user_profiling` | A profile parameter (`birthday`, `age` or `gender`) could not be saved. Check the values. |

## Errors

| HTTP | Body |
| - | - |
| `200` | Validation error: `{"status":"error","errors":{...}}` |
| `400` | Token or app errors. See [Authentication](https://docs-saas.primeearn.com/partner-saas/authentication.md#app-token). |
| `401` | `app`, `external_user_id`, `ip` or `output=API` missing. |
| `403` | IP not on your allowlist. |
| `422` | Invalid `ip`. |
| `429` | Rate limit exceeded: `{"status":"error","count":0,"surveys":[],"message":"too_many_requests"}` |

```bash cURL theme={null}
curl --request GET \
  --url 'https://partners.{your-domain}/api/surveys?app=8f2c1e4a-7b3d-4f6a-9c0e-1d2b3a4c5e6f&external_user_id=user-123&ip=203.0.113.5&output=API&device=mobile&token=YOUR_APP_TOKEN&limit=20'
```

```json Surveys theme={null}
{
  "status": "success",
  "uh": "0b6c1a3e-5d1f-4c1e-9d0a-2f3b4c5d6e7f",
  "count": 1,
  "message": null,
  "surveys": [
    {
      "id": 123456,
      "hash": "a4df4600-df48-4286-990d-fa68db595f44",
      "loi": 12,
      "publisher_payout": 1.25,
      "user_reward": 125,
      "user_reward_without_bonus": 125,
      "bonus": 0,
      "conversion_rate": 35,
      "score": 180,
      "user_rating_avg": 4.5,
      "user_rating_count": 42,
      "user_rating_ct": 42,
      "hot": 0,
      "url": "https://{surveys-host}/survey?app=8f2c1e4a-7b3d-4f6a-9c0e-1d2b3a4c5e6f&uh=0b6c1a3e-5d1f-4c1e-9d0a-2f3b4c5d6e7f&sh=a4df4600-df48-4286-990d-fa68db595f44",
      "order": 1
    }
  ]
}
```

```json No surveys theme={null}
{
  "status": "success",
  "uh": "0b6c1a3e-5d1f-4c1e-9d0a-2f3b4c5d6e7f",
  "count": 0,
  "surveys": [],
  "message": "no_surveys"
}
```

```json Validation error theme={null}
{
  "status": "error",
  "errors": {
    "user_agent": ["The user agent field is required when device is not present."]
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.