---
title: "Connect Account"
method: POST
path: "/api/v1/accounts"
tags: ["accounts"]
---

# Connect Account

`POST /api/v1/accounts`

## Request

- Base URL: `https://api.nudgelink.co` (the document declares no server; this is the origin it was published from)
- URL: `https://api.nudgelink.co/api/v1/accounts`
- Auth: HTTP bearer

Connect a LinkedIn account via the manual-paste fallback flow.

Most customers go through the one-click hosted-auth flow (``start-connect``
above + the Unipile webhook). This endpoint is the escape hatch for:
  - Tim manually attaching an account he created in the Unipile dashboard
  - Pilot customers debugging issues where the hosted-auth webhook
    didn't fire
  - Internal automated tests

Flow:
  1. Reject duplicates: if a row with the same external_account_id already
     exists for this client, return 409 (avoids accidentally creating
     double-billing rows on retry).
  2. Probe Unipile with check_account_health. We allow ``warming`` /
     ``requires_action`` / unknown statuses through (just create the row
     in ``warming`` state — the P1.3 poller will reconcile). Only an
     actual network/auth error blocks creation.
  3. Always release the per-call adapter so we never leak the httpx
     connection pool — every call to ``get_linkedin_adapter()`` returns
     a fresh instance, so aclose() is mandatory.

## Request body

- ConnectLinkedInRequest
  - `label` string
  - `external_account_id` string, required
  - `profile_url` string
  - `timezone` string, nullable

## Response `201`

Successful Response

- LinkedInAccountOut
  - `id` string, uuid, required
  - `label` string, required
  - `external_account_id` string, nullable, required
  - `profile_url` string, nullable, required
  - `status` 'active' | 'warming' | 'paused_by_client' | 'paused_by_system' | 'requires_action' | 'banned', required
  - `warmup_week` integer, required
  - `daily_limits` object, nullable, required
  - `daily_invite_cap` integer, required
  - `timezone` string
  - `invite_pace` string
  - `send_hour_start` integer
  - `send_hour_end` integer
  - `send_days` integer[]
  - `last_action_at` string, date-time, nullable, required
  - `ban_count` integer, required
  - `created_at` string, date-time, required
  - `is_premium` boolean, nullable
  - `premium_kind` string, nullable

## Other responses

- `422`: Validation Error

---

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