---
title: "Errors"
description: "Every error code the UserLoop API returns, with its HTTP status and what to do about it."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.userloop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

Every error from the UserLoop API is a JSON problem (RFC 9457), sent with `Content-Type: application/problem+json`. Its `code` says what went wrong; branch on `code`, not on `detail`, which is a sentence for people and can change. The `type` of each problem is a page that describes it, for example `https://app.userloop.io/api/v1/problems/not_found`.

## Codes

| Status | Code | Title | What to do |
| --- | --- | --- | --- |
| 400 | [`invalid_request`](#invalid_request) | Invalid request | A parameter or body field is missing, unknown or has a value the endpoint doesn't accept. `errors` lists each one with its path. |
| 400 | [`invalid_cursor`](#invalid_cursor) | Invalid cursor | Pass back next_cursor from the previous page unchanged, with the same query. |
| 400 | [`key_in_query`](#key_in_query) | API key in the address | Send the key in the Authorization header: `Authorization: Bearer ulk_…`. Revoke the key you sent and create a new one. |
| 401 | [`unauthenticated`](#unauthenticated) | Unauthenticated | Send `Authorization: Bearer ulk_…` with a key from the API keys page in the dashboard. |
| 401 | [`legacy_key`](#legacy_key) | Legacy API key | Keys that start ul_live_ or ul_test_ belong to the earlier UserLoop API, which keeps answering them at https://api.userloop.io with the X-API-Key header. This API takes keys that start ulk_, created on the API keys page in the dashboard. |
| 401 | [`key_revoked`](#key_revoked) | API key revoked | Create a new key. |
| 401 | [`key_expired`](#key_expired) | API key expired | Create a new key. |
| 401 | [`key_suspended`](#key_suspended) | API key suspended | The person who created the key is no longer a member of the organisation, so their keys stopped working. A current member can create a new key. |
| 402 | [`plan_required`](#plan_required) | Plan required | The organisation's plan doesn't include this. `required_plan` names the plan that does (null when no plan does) and `upgrade_url` is the dashboard's Billing page, where an org admin changes the plan. |
| 403 | [`insufficient_scope`](#insufficient_scope) | Insufficient scope | Create a key with the scope on the API keys page. |
| 403 | [`sending_not_approved`](#sending_not_approved) | Sending not approved | Request approval on the email account page. |
| 403 | [`sending_paused`](#sending_paused) | Sending paused | Email sending is paused while UserLoop reviews this account. Nothing was queued. The UserLoop dashboard shows the review and how to contact UserLoop. |
| 403 | [`forbidden`](#forbidden) | Forbidden | The role of the person who created the key doesn't allow this, for example an action only organisation admins can take. |
| 403 | [`contact_details_not_allowed`](#contact_details_not_allowed) | Contact details not allowed | Create a key with that option ticked. |
| 404 | [`not_found`](#not_found) | Not found | Nothing with that ID exists in this organisation. |
| 404 | [`route_not_found`](#route_not_found) | Route not found | No endpoint has this path. The OpenAPI document at /openapi.json lists every endpoint. |
| 405 | [`method_not_allowed`](#method_not_allowed) | Method not allowed | The endpoint exists but not with this method. The Allow header lists the methods it takes. |
| 409 | [`conflict`](#conflict) | Conflict | The request conflicts with the current state, for example the survey changed since it was read, is live, a question's type is locked after publishing, or the organisation already holds as many as it may, such as 20 webhook endpoints (`convex_code` says which; LIMIT_REACHED for the last), or an export or report whose file isn't ready to download (`detail` gives its status). |
| 409 | [`not_linked`](#not_linked) | Not linked | The organisation has no response store yet. |
| 409 | [`idempotency_in_progress`](#idempotency_in_progress) | Request in progress | Retry after the Retry-After interval to get its result. |
| 413 | [`payload_too_large`](#payload_too_large) | Payload too large | Request bodies are at most 1 MB. |
| 415 | [`unsupported_media_type`](#unsupported_media_type) | Unsupported media type | Request bodies must be JSON, sent with `Content-Type: application/json`. |
| 422 | [`idempotency_key_reused`](#idempotency_key_reused) | Idempotency key reused | Use a new key for a new request. |
| 429 | [`rate_limited`](#rate_limited) | Rate limited | Wait for the Retry-After interval; the limit is about 120 requests a minute per key, and some actions have a lower one of their own, which `detail` names (a webhook endpoint takes 5 test events a minute). |
| 500 | [`internal`](#internal) | Internal error | Retry later; quote the request ID (UserLoop-Request-Id) to support. |
| 503 | [`unavailable`](#unavailable) | Unavailable | Retry after the Retry-After interval. |

## The problem body

An RFC 9457 problem: every error of the API.

| Field | Type | Always | Description |
| --- | --- | --- | --- |
| `type` | string (uri) | Yes | \<base\>/problems/\<code\>: describes the problem type. |
| `title` | string | Yes |  |
| `status` | integer | Yes |  |
| `detail` | string | Yes | What went wrong, in a sentence for people. |
| `instance` | string | Yes | The request ID (UserLoop-Request-Id). |
| `code` | string | Yes | Stable machine-readable code. One of `invalid_request`, `invalid_cursor`, `key_in_query`, `unauthenticated`, `legacy_key`, `key_revoked`, `key_expired`, `key_suspended`, `plan_required`, `insufficient_scope`, `sending_not_approved`, `sending_paused`, `forbidden`, `contact_details_not_allowed`, `not_found`, `route_not_found`, `method_not_allowed`, `conflict`, `not_linked`, `idempotency_in_progress`, `payload_too_large`, `unsupported_media_type`, `idempotency_key_reused`, `rate_limited`, `internal`, `unavailable`. |
| `errors` | array of object | No | invalid_request: each bad parameter or field. |
| `errors[].path` | string | Yes |  |
| `errors[].message` | string | Yes |  |
| `required_scope` | string | No | insufficient_scope: the scope the endpoint needs. One of `surveys:read`, `surveys:write`, `responses:read`, `responses:write`, `reports:write`, `account:read`, `account:write`. |
| `reason` | string | No | conflict: the underlying reason (conflict, survey_live, type_locked, limit_reached …). |
| `required_plan` | string or null | No | plan_required: the plan that includes this (null when no plan does or it isn't known). One of `free`, `unlimited`, `plus`. |
| `upgrade_url` | string (uri) | No | plan_required: the dashboard's Billing page with that plan picked, where an org admin changes the plan. |
| `retry_after` | integer | No | Seconds to wait before retrying (also the Retry-After header). |

Every response, error or not, has a `UserLoop-Request-Id` header: the request's ID (req_…); quote it to support.

## invalid_request

**400 Invalid request**

A parameter or body field is missing, unknown or has a value the endpoint doesn't accept. `errors` lists each one with its path.

The body also has `errors`.

## invalid_cursor

**400 Invalid cursor**

The cursor isn't one this endpoint gave out for these filters. Pass back next_cursor from the previous page unchanged, with the same query.

## key_in_query

**400 API key in the address**

API keys are never read from the query string, where they end up in logs. Send the key in the Authorization header: `Authorization: Bearer ulk_…`. Revoke the key you sent and create a new one.

## unauthenticated

**401 Unauthenticated**

The request has no API key, or the key isn't one UserLoop knows. Send `Authorization: Bearer ulk_…` with a key from the API keys page in the dashboard.

Headers: `WWW-Authenticate: Bearer realm="UserLoop API", error="invalid_token"`.

## legacy_key

**401 Legacy API key**

Keys that start ul_live_ or ul_test_ belong to the earlier UserLoop API, which keeps answering them at https://api.userloop.io with the X-API-Key header. This API takes keys that start ulk_, created on the API keys page in the dashboard.

Headers: `WWW-Authenticate: Bearer realm="UserLoop API", error="invalid_token"`.

## key_revoked

**401 API key revoked**

The key was revoked on the API keys page. Create a new key.

Headers: `WWW-Authenticate: Bearer realm="UserLoop API", error="invalid_token"`.

## key_expired

**401 API key expired**

The key reached the expiry date chosen when it was created. Create a new key.

Headers: `WWW-Authenticate: Bearer realm="UserLoop API", error="invalid_token"`.

## key_suspended

**401 API key suspended**

The person who created the key is no longer a member of the organisation, so their keys stopped working. A current member can create a new key.

Headers: `WWW-Authenticate: Bearer realm="UserLoop API", error="invalid_token"`.

## plan_required

**402 Plan required**

The organisation's plan doesn't include this. `required_plan` names the plan that does (null when no plan does) and `upgrade_url` is the dashboard's Billing page, where an org admin changes the plan.

The body also has `required_plan` and `upgrade_url`.

## insufficient_scope

**403 Insufficient scope**

The key doesn't have the scope this endpoint needs (`required_scope`), or the role of the person who created it no longer allows it. Create a key with the scope on the API keys page.

The body also has `required_scope`.

## sending_not_approved

**403 Sending not approved**

API sending requires bulk sending approval. Request approval on the email account page.

## sending_paused

**403 Sending paused**

Email sending is paused while UserLoop reviews this account. Nothing was queued. The UserLoop dashboard shows the review and how to contact UserLoop.

## forbidden

**403 Forbidden**

The role of the person who created the key doesn't allow this, for example an action only organisation admins can take.

## contact_details_not_allowed

**403 Contact details not allowed**

The request asked for customers' contact details (include_contact_details=true, customer_details), or for a file that holds them (an export with the customer columns, a PDF report made with customer details), but the key was created without access to customers' contact details. Create a key with that option ticked.

## not_found

**404 Not found**

Nothing with that ID exists in this organisation.

## route_not_found

**404 Route not found**

No endpoint has this path. The OpenAPI document at /openapi.json lists every endpoint.

## method_not_allowed

**405 Method not allowed**

The endpoint exists but not with this method. The Allow header lists the methods it takes.

Headers: `Allow` (the methods the endpoint takes).

## conflict

**409 Conflict**

The request conflicts with the current state, for example the survey changed since it was read, is live, a question's type is locked after publishing, or the organisation already holds as many as it may, such as 20 webhook endpoints (`convex_code` says which; LIMIT_REACHED for the last), or an export or report whose file isn't ready to download (`detail` gives its status).

The body also has `reason`.

## not_linked

**409 Not linked**

The organisation has no response store yet.

## idempotency_in_progress

**409 Request in progress**

A request with the same Idempotency-Key is still running. Retry after the Retry-After interval to get its result.

Headers: `Retry-After: 1`.

## payload_too_large

**413 Payload too large**

Request bodies are at most 1 MB.

## unsupported_media_type

**415 Unsupported media type**

Request bodies must be JSON, sent with `Content-Type: application/json`.

## idempotency_key_reused

**422 Idempotency key reused**

The Idempotency-Key was already used in the last 24 hours with a different request. Use a new key for a new request.

## rate_limited

**429 Rate limited**

Too many requests with this key, or too many of one action in a short time. Wait for the Retry-After interval; the limit is about 120 requests a minute per key, and some actions have a lower one of their own, which `detail` names (a webhook endpoint takes 5 test events a minute).

Headers: `Retry-After: 60`.

## internal

**500 Internal error**

Something went wrong on UserLoop's side. Retry later; quote the request ID (UserLoop-Request-Id) to support.

## unavailable

**503 Unavailable**

A service UserLoop depends on can't be reached right now. Retry after the Retry-After interval.

Headers: `Retry-After: 30`.

Source: https://docs.userloop.io/developers/api/errors/index.mdx
