Get branch sync status

Changed on

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Returns how far an active branch is behind main, whether updating it from main is expected to conflict, and whether an update is running. Check it before you call Update branch from main, and poll it while an update runs.

An update that has been running for more than 15 minutes with nothing working on the branch counts as stuck. This endpoint rolls a stuck update back and returns the branch to idle, so it can be updated again.

This endpoint is limited to 120 requests per minute.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>

get/api/apps/{app_id}/branches/{branch_id}/sync-status

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/branches/{branch_id}/sync-status
  • Auth: HTTP bearer

Path parameters

branch_idstring required

ID of the branch, as returned by List branches.

app_idstring required

ID of the app the branch belongs to.

Response

How the branch stands against main.

new_main_message_countinteger required

How many chat messages people sent on main since the branch was created or last updated from main.

main_code_changedboolean required

true when main's code changed since the branch was created or last updated from main.

conflict_state'clear' | 'overlap' | 'unavailable' required

Whether updating the branch from main is expected to conflict. clear when main's code hasn't changed, so an update can't conflict. overlap when the update is expected to conflict, or while conflicts from an update are being resolved. unavailable when Base44 can't tell, including while an update runs. Once main's code has changed, it's never clear, even when the update would apply cleanly.

sync_state'idle' | 'updating' | 'resolving' | 'needs_input' required

idle when no update is running. updating while main's changes are being applied, resolving while the AI resolves conflicts, and needs_input when the AI needs an answer to finish resolving them. Answer it in the Base44 editor. Until the state is back to idle, the branch can't be merged or deleted.

blocked_reason'app_processing' | 'branch_processing' nullable required

Why Update branch from main would be refused right now: app_processing while the AI is working on main, and branch_processing while it's working on the branch. null when neither applies. An update is also refused while sync_state is resolving or needs_input.

Example response

{
  "new_main_message_count": 2,
  "main_code_changed": true,
  "conflict_state": "unavailable",
  "sync_state": "idle",
  "blocked_reason": "app_processing"
}

Changes