---
title: "Start an agent-initiated repository connection. Returns a short user code for a person to approve in the browser and a device secret the agent uses to collect the approval."
method: POST
path: "/api/v1/onboarding/repo/connect/start"
tags: ["onboarding"]
---

# Start an agent-initiated repository connection. Returns a short user code for a person to approve in the browser and a device secret the agent uses to collect the approval.

`POST /api/v1/onboarding/repo/connect/start`

No credential is required and no repository name or spec content is sent. A person opens verificationUrl, signs in, checks that the page shows the same userCode, chooses the workspace and Product, and approves. The request expires after 15 minutes. The device secret is returned once and stored only as a hash; keep it on the requesting machine. A caller may send an existing pm_live_ Bearer key: it is recorded for reuse, and reused only if it belongs to the approving person and the workspace they choose. An invalid key does not fail the start. Responses set Cache-Control: no-store.

## Request body

- object
  - `client` string, required — The requesting client. Only "mcp-server" is accepted.
  - `clientVersion` string, required — The client's semantic version, for example "1.36.0".

## Response `200`

Request created; returns the user code, the device secret, the approval link, and its expiry.

- object

## Other responses

- `400` — The client or clientVersion is missing or not accepted.
- `429` — Per-IP start limit exceeded, or CAPACITY_REACHED when too many requests are waiting.
- `503` — The request could not be created or no free user code was found.

## Changes

- **2026-09-27** `0f4a7b92b504` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/pathmode/apis/pathmode-api/changes/api/v1/onboarding/repo/connect/start/post.md)

---

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