---
title: "Connect a SUNARP account"
method: POST
path: "/pe/sunarp/connections/v1"
tags: ["Peru", "SUNARP"]
---

# Connect a SUNARP account

`POST /pe/sunarp/connections/v1`

## Request

- Base URL: `https://api.croma.run`
- URL: `https://api.croma.run/pe/sunarp/connections/v1`
- Auth: HTTP bearer

SUNARP answers only to a signed-in person: a Peruvian DNI, with the verification digit and issue date printed on the card. Each query runs as your organization's own connection, so register one before your first query. SUNARP allows each DNI five sign-ins a day; Croma keeps every session open as long as SUNARP allows, so five sign-ins cover many queries.

Croma checks the account with the source before saving it. Each account allows 5 sign-ins a day; queries rotate across your connections.

Credentials are encrypted as soon as they reach Croma, bound to your organization, and can only be opened by the isolated service that signs in to the source on your behalf. They are never returned by the API.

## Request body

- object
  - `document_number` string, required: The DNI of the person whose account this is: eight digits.
  - `check_digit` string, required: The verification digit printed after the DNI number on the card.
  - `issue_date` string, date, required: The issue date printed on the DNI card, `yyyy-mm-dd`.
  - `authorized` true, required: Confirms you are the account's owner or have the owner's authorization to use it.

## Response `201`

Connected

- object
  - `data` object
    - `id` string: The connection's id, `conn_…`.
    - `source` string
    - `status` 'active' | 'exhausted' | 'invalid': `exhausted` until its daily allowance resets; `invalid` when the source no longer accepts it.
    - `display_name` string, nullable: The account's name as the source shows it, masked.
    - `usage` object, nullable
      - `sign_ins_today` integer
      - `daily_limit` integer, nullable
      - `resets_at` string, date-time
    - `available_again_at` string, date-time, nullable
    - `created_at` string, date-time
    - `last_used_at` string, date-time, nullable

## Other responses

- `400`: Invalid request body
- `401`: Missing or invalid API key
- `409`: `connection_exists`: the account is already connected
- `422`: `connection_rejected`: the source did not accept the account, or `connection_limit_reached`
- `429`: `connections_exhausted`: the account has no sign-ins left today
- `503`: `connection_unverified`: the source could not check it right now

---

[API](https://skmtc.dev/usecroma/apis/croma-marketplace-api.md) · [All operations](https://skmtc.dev/usecroma/apis/croma-marketplace-api/llms.txt) · [OpenAPI document](https://skmtc.dev/usecroma/apis/croma-marketplace-api/revisions/df016cdb29d7?raw)
