---
title: "Sync Github"
method: POST
path: "/apps/{app_id}/github/sync"
---

# Sync Github

`POST /apps/{app_id}/github/sync`

## Request

- Base URL: `https://api.xhostd.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xhostd.com/apps/{app_id}/github/sync`
- Auth: none declared

Fetch the GitHub remote now, and answer the status this sync left.

The response is the row's static fields overlaid with THIS request's
outcome, never a re-read of the outcome columns: a concurrent sync
can write them in between. A busy repo and a frozen app answer
503 from :func:`run_mirror_sync`, which then writes no row and this
route journals nothing.

## Path parameters

- `app_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Response `200`

Successful Response

- StatusResponse
  - `connected` boolean, required
  - `remote_url` string, nullable
  - `public_key` string, nullable
  - `connected_at` string, date-time, nullable
  - `last_synced_at` string, date-time, nullable
  - `last_sync_status` string, nullable
  - `last_sync_error` string, nullable
  - `last_sync_refs` object, nullable
  - `default_branch` string, nullable
  - `notify_url` string, nullable
  - `last_ping_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

---

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