Resolve a pull request or branch
Find the changeset a URL, or a repository with a PR or branch, names
GET /api/v1/changesets/resolve
Give url, or repository with pr or branch. A branch name that matches both a hosted branch and your own local branch, or a repository in several workspaces, is ambiguous: the problem lists the candidates.
Example request
Link to this section# Set your token and resource IDs first.
API_BASE_URL="https://app.theseus.dev/api/v1"
curl --fail-with-body --request GET \
-H "Authorization: Bearer ${THESEUS_API_TOKEN:?}" \
--get \
--data-urlencode "repository=example/project" \
--data-urlencode "pr=42" \
"${API_BASE_URL}/changesets/resolve"Parameters
Link to this section| Name | In | Type | Description |
|---|---|---|---|
url | query | string | A Theseus changeset URL, or a GitHub pull request or branch URL Maximum length |
repository | query | string | A rep_ ID or owner/name, with pr or branchMaximum length |
pr | query | integer | Greater than |
branch | query | string | A hosted branch, or your own local branch of that name Minimum length |
workspace | query | string | A workspace ID or slug, when the repository is in several Maximum length |
Responses
Link to this sectionThe one changeset the request names
Response fields
Content type application/json
idstring requiredExample
set_01K6Z3M4N5P6Q7R8S9T0V1W2X3pathstring requiredThe readable path, which the web app shows after the workspace host
Example
acme/widgets/pr/71kindstring requiredA pull request, a hosted branch, or your own local branch
One of
pr,branch,localnumberinteger or null requiredThe pull request number
refstring or null requiredThe branch name, for a hosted or local branch; null for a PR
ownerstring or null requiredA local branch's owner's GitHub login; null otherwise
titlestring requiredurlstring (uri) requiredThe changeset in the web app
workspaceobject requiredworkspace fields
idstring requiredslugstring required
repositoryRepository requiredrepository fields
idstring requiredExample
rep_01K6Z3M4N5P6Q7R8S9T0V1W2X3github_idinteger requiredfull_namestring requiredExample
acme/widgets
latest_guideobject or null requiredThe newest ready guide, which the web app shows by default
latest_guide fields
idstring requiredExample
ver_01K6Z3M4N5P6Q7R8S9T0V1W2X3head_shastring requiredcreated_atstring required
newest_runobject or null requiredThe newest run generating a guide, which may still be going
newest_run fields
idstring or null requiredNull for guides older than runs
statusstring requiredNew statuses may be added; tolerate one you do not know
One of
queued,running,succeeded,failederrorstring or null requiredguide_idstring requiredThe guide the run generates
pull_requestobject or null requiredpull_request fields
numberinteger requiredhead_shastring or null requiredNull until Theseus has seen it
head_branchstring or null requiredThe observed PR head branch
statestring or null requiredOne of
open,closed,merged,null
behind_headboolean or null requiredWhether the pull request's head has moved past the latest ready guide; null when either is unknown
Example responses
Link to this sectionResolved pull request
Illustrative response · selected fields
{
"id": "set_EXAMPLE",
"path": "example/project/pr/42",
"kind": "pr",
"title": "Keep notifications enabled after reconnecting",
"url": "https://example-team.theseus.dev/example/project/pr/42",
"latest_guide": {
"id": "ver_EXAMPLE",
"head_sha": "0123456789abcdef0123456789abcdef01234567",
"created_at": "2026-10-08T12:00:00Z"
},
"newest_run": {
"id": "run_EXAMPLE",
"status": "succeeded",
"error": null,
"guide_id": "ver_EXAMPLE"
},
"behind_head": false
}Errors
Link to this section400 · The request is not valid
401 · A valid bearer token is required
403 · The credential's scopes do not allow this
404 · Not found
409 · The request matches more than one resource
426 · Upgrade the CLI: run theseus update
429 · Too many requests
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
503 · Theseus is unavailable; retry the same request
Headers
Retry-AfterintegerSeconds to wait before the next request, when known
Error response fields
Content type application/problem+json
typestring (uri) requiredIdentifies the problem type; branch on
codeinsteadtitlestring requiredstatusinteger requireddetailstringcodestring requiredWhy the request failed. New codes may be added: treat an unknown one by its status
One of
invalid_request,unauthenticated,not_in_plan,insufficient_scope,admission_required,not_found,ambiguous,conflict,rate_limited,internal_error,unavailable,search_authorization_pending,search_unavailable,cli_upgrade_requiredrequest_idstring requiredQuote this when reporting the problem
errorsarray of FieldErrorWith
invalid_request: what is wrong with each fielderrors fields
pathstring requiredWhere in the request, as dotted segments
messagestring required
required_scopestringWith
insufficient_scope: the scope the operation needsnextstringRecovery action, such as theseus update
candidatesarray of CandidateWith
ambiguous: what the request could mean; ask whichcandidates fields
idstring requiredpathstring requiredkindstring requiredtitlestring requiredurlstring (uri) required