---
title: "Connect a vendor account, or replace the credential of the one with the same vendor and label [write]"
method: POST
path: "/external_accounts"
---

# Connect a vendor account, or replace the credential of the one with the same vendor and label \[write\]

`POST /external_accounts`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/external_accounts`
- Auth: HTTP bearer

The credential is write-only. Every task of the workspace waiting on this vendor's account (an open `connect_account` request) then continues. 422 `invalid_credential` when the vendor does not accept it; 503 `not_migrated` before the store exists. A vendor's own browser sign-in is not offered here.

## Request body

- object
  - `vendor` string, required: A vendor id from `vendors`
  - `label` string: Defaults to the vendor's name
  - `credential` union, required: One key, or the vendor's account settings as upper-case names with text values
    - string
    - object

## Response `201`

Created

- object
  - `external_account` object, required
    - `id` string, required
    - `kind` 'model_subscription' | 'vendor_account', required
    - `vendor` string, required
    - `vendor_name` string, required
    - `label` string, required
    - `status` 'active' | 'needs_reconnect' | 'exhausted', required
    - `plan` string, nullable, required: The plan the vendor reported, when it reports one
    - `agents` object[], required: The agents that have run on it
      - `id` string, required
      - `name` string, required
    - `last_used_at` string, date-time, nullable, required
    - `created_at` string, date-time, required

## Other responses

- `default`: Error — { error: { code, message, request_id } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/external_accounts/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
