Skip to main content
POST
/
{org}
/
{repo}
/
bookmarks
/
merge
Merge bookmarks
curl --request POST \
  --url https://api.mesa.dev/v1/{org}/{repo}/bookmarks/merge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target": "<string>",
  "source": "<string>",
  "delete_source": false,
  "allow_conflicted": false,
  "message": "<string>",
  "resolutions": []
}
'
{
  "is_conflicted": true,
  "commit_oid": "<string>",
  "change_id": "<string>",
  "target": "<string>",
  "source": "<string>",
  "source_deleted": true
}

Documentation Index

Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

org
string
required

Organization slug

Minimum string length: 1
repo
string
required

Repository name

Minimum string length: 1

Body

application/json
target
string
required

The bookmark being merged into. Usually main. This bookmark is updated to the resulting merge point.

Minimum string length: 1
source
string
required

The bookmark that has changes to merge into target.

Minimum string length: 1
delete_source
boolean
default:false

Whether to delete the source bookmark after a successful merge

allow_conflicted
boolean
default:false

When true, a merge that produces textual conflicts is accepted and the target bookmark is moved to a conflicted merge commit. When false (default), the merge is rejected server-side with MERGE_CONFLICT and nothing is persisted.

message
string

Description for the resulting merge change. Omit to use the generated merge description; empty string is allowed and means no description.

resolutions
object[]

Caller-supplied conflict resolutions, applied before conflict detection. Each resolution targets one path — either the full file (content) or a set of per-hunk replacements (hunks). A resolution set that covers every otherwise-conflicting path lets an initially-rejected merge succeed on retry without setting allow_conflicted.

A single caller-supplied resolution. Whole-file variants carry content OR take (not both); per-hunk variants carry hunks. Whole-file replaces the merged content at path. Per-hunk requires all hunks for the path to be resolved.

Response

Merge result

merge_type
enum<string>
required

The type of merge that was performed. no_op when target and source point to the same commit; merge_commit otherwise — every divergent merge creates an explicit merge commit (JJ model).

Available options:
merge_commit,
no_op
is_conflicted
boolean
required
commit_oid
string
required

The commit OID the target bookmark now points to

Pattern: ^[0-9a-f]{40}$
change_id
string
required

The JJ change ID the target bookmark points to after the merge.

Pattern: ^[zyxwvutsrqponmlk]{32}$
target
string
required

The target bookmark that was merged into

source
string
required

The source bookmark that was merged from

source_deleted
boolean
required

Whether the source bookmark was deleted after merge