---
title: "Report a failed repository adoption so the waiting browser can show the failure."
method: POST
path: "/api/v1/onboarding/repo/fail"
tags: ["onboarding"]
---

# Report a failed repository adoption so the waiting browser can show the failure.

`POST /api/v1/onboarding/repo/fail`

The CLI calls this endpoint when its local push fails. Only an exchanging session matching the authenticated API-key row id, workspace, and user is marked failed. Cookie sessions are rejected. Repeated reports, unmatched sessions, and sessions already completed are acknowledged without changing their state, so a completion that wins the race is preserved.

## Request body

- object
  - `sessionId` string, required — The session returned by the code exchange.

## Response `200`

Failure recorded, or no matching exchanging session remains; returns ok:true.

- object

## Other responses

- `400` — sessionId is not a UUID, or the JSON body is malformed.
- `401` — Missing, invalid, or expired credential.
- `403` — The caller is not an API key with write scope, or workspace access is denied.
- `429` — Rate limit exceeded.
- `500` — Failed to record repository adoption failure.

## Changes

- **2026-09-11** `f72c39208839` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/pathmode/apis/pathmode-api/changes/api/v1/onboarding/repo/fail/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/c014a089aa9c?raw)
