> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serval.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rebase Branch

> Pull current parent changes into a branch. Clean rebases apply when existing permission, approval, and CI checks allow it. Conflicts return a review link and up to 100 overwritten resources for manual review. Each call stages current parent changes through the same flow as Pull latest in the workspace. Use GetReview to follow the returned review's status.

## Authentication and permissions

> **Token requirements:** **User-based token (OAuth)**.
>
> Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.

| Credential | Access requirements |
| - | - |
| Organization-scoped API key | Unsupported |
| Workspace-scoped API key | Unsupported |
| User-based token (OAuth) | Supported, subject to permissions |

Permissions joined by **+** are all required; **or** separates alternatives. Full-access keys still cannot call endpoints marked unsupported. Workspace keys must allow every workspace checked by the request. OAuth access depends on the user’s roles and resource access.

* **User: branch rebase:** Requires branch-copy permission on the actual parent workspace and staging permission on the branch. Clean rebases also require permission to apply configuration on the branch and must pass its approval, CI, and freshness checks. Conflicts return a review for manual application. API keys are not supported.


## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml post /v2/branches/{branch_team_id}:rebase
openapi: 3.1.0
info:
  title: Serval Public API
  description: Serval Public API
  contact:
    name: Serval
    url: https://serval.com
    email: support@serval.com
  license:
    name: Serval License
    url: https://serval.com/license
  version: 2.0.0
servers:
  - url: https://public.api.serval.com
security:
  - BearerAuth: []
tags:
  - name: Access Membership API
  - name: Access Policy API
  - name: Access Policy Approval Procedure API
  - name: Access Profile API
  - name: Access Relationship API
  - name: Access Request API
  - name: Agent API
  - name: Alerts API
  - name: Analytics API
  - name: App Instance API
  - name: App Resource API
  - name: App Resource Role API
  - name: Approval Delegation API
  - name: Approval Procedure API
  - name: Approval Request API
  - name: Assignment Rules API
  - name: Audit Log API
  - name: Billing API
  - name: Browser API
  - name: Campaign API
  - name: Change Blackout API
  - name: Change Model API
  - name: Connected Channels API
  - name: Custom Field API
  - name: Custom Role API
  - name: Custom Service API
  - name: Dashboards API
  - name: Email Intake API
  - name: Entity API
  - name: Entity Field Mapping API
  - name: Entity Ingestion Config API
  - name: Entity Type API
  - name: Folder API
  - name: Forms
  - name: Forms API
  - name: Group API
  - name: Guidance API
  - name: Help Agent API
  - name: Improvement Request API
  - name: Journey API
  - name: Knowledge API
  - name: Knowledge Base API
  - name: One-Time Window API
  - name: Package API
  - name: Platform Migration API
  - name: Project API
  - name: Report API
  - name: Review API
  - name: Role Sync API
  - name: Roles API
  - name: SLA API
  - name: Schedule API
  - name: Skills API
  - name: Tag API
  - name: Ticket API
  - name: Ticket Import API
  - name: Ticket Type API
  - name: Topic API
  - name: User API
  - name: User Relationship API
  - name: Widgets API
  - name: Worker API
  - name: Workflow API
  - name: Workflow Approval Procedure API
  - name: Workflow Run API
  - name: Workspace API
  - name: Workspace Group API
  - name: Workspace SDLC Settings API
  - name: Workspace User API
paths:
  /v2/branches/{branch_team_id}:rebase:
    post:
      tags:
        - Review API
      summary: Rebase Branch
      description: >-
        Pull current parent changes into a branch. Clean rebases apply when
        existing permission, approval, and CI checks allow it. Conflicts return
        a review link and up to 100 overwritten resources for manual review.
        Each call stages current parent changes through the same flow as Pull
        latest in the workspace. Use GetReview to follow the returned review's
        status.
      operationId: svrelay.publicv2.PublicAPIServiceV2.RebaseBranch
      parameters:
        - name: branch_team_id
          in: path
          required: true
          schema:
            type: string
            title: branch_team_id
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/svmeta.publicapi.RebaseBranchResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    svmeta.publicapi.RebaseBranchResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/svmeta.publicapi.RebaseBranchResult'
          title: data
          x-stainless-terraform-configurability: optional
      title: RebaseBranchResponse
      additionalProperties: false
    svmeta.publicapi.RebaseBranchResult:
      type: object
      properties:
        outcome:
          $ref: '#/components/schemas/svmeta.publicapi.RebaseBranchOutcome'
          title: outcome
          x-stainless-terraform-configurability: optional
        reviewId:
          type: string
          title: review_id
          description: Absent for UP_TO_DATE. Use GetReview to follow a saved rebase.
          x-stainless-terraform-configurability: optional
        reviewUrl:
          type: string
          title: review_url
          x-stainless-terraform-configurability: optional
        overwrittenResources:
          type: array
          items:
            $ref: '#/components/schemas/serval.configuration.v1.ResourceReference'
          title: overwritten_resources
          description: First 100 conflicts. The review page shows the complete list.
          x-stainless-terraform-configurability: optional
        conflictCount:
          type:
            - integer
            - string
          title: conflict_count
          format: int64
          x-stainless-terraform-configurability: optional
        configDiagnostics:
          $ref: >-
            #/components/schemas/serval.configuration.v1.ConfigurationDiagnosticReport
          title: config_diagnostics
          x-stainless-terraform-configurability: optional
      title: RebaseBranchResult
      additionalProperties: false
    svmeta.publicapi.RebaseBranchOutcome:
      type: string
      title: RebaseBranchOutcome
      enum:
        - REBASE_BRANCH_OUTCOME_UNSPECIFIED
        - REBASE_BRANCH_OUTCOME_UP_TO_DATE
        - REBASE_BRANCH_OUTCOME_REVIEW_REQUIRED
        - REBASE_BRANCH_OUTCOME_APPLYING
        - REBASE_BRANCH_OUTCOME_APPLIED
        - REBASE_BRANCH_OUTCOME_FAILED
        - REBASE_BRANCH_OUTCOME_WITHDRAWN
        - REBASE_BRANCH_OUTCOME_REJECTED
    serval.configuration.v1.ResourceReference:
      type: object
      properties:
        kind:
          type: string
          title: kind
          x-stainless-terraform-configurability: optional
        resourceId:
          type: string
          title: resource_id
          x-stainless-terraform-configurability: optional
        scopedId:
          type: string
          title: scoped_id
          x-stainless-terraform-configurability: optional
        name:
          type: string
          title: name
          x-stainless-terraform-configurability: optional
        fieldPath:
          type: string
          title: field_path
          x-stainless-terraform-configurability: optional
      title: ResourceReference
      additionalProperties: false
    serval.configuration.v1.ConfigurationDiagnosticReport:
      type: object
      properties:
        diagnostics:
          type: array
          items:
            $ref: >-
              #/components/schemas/serval.configuration.v1.ConfigurationDiagnostic
          title: diagnostics
          x-stainless-terraform-configurability: optional
        validationCompleteness:
          $ref: '#/components/schemas/serval.configuration.v1.ValidationCompleteness'
          title: validation_completeness
          x-stainless-terraform-configurability: optional
        supportReference:
          type: string
          title: support_reference
          x-stainless-terraform-configurability: optional
      title: ConfigurationDiagnosticReport
      additionalProperties: false
    serval.configuration.v1.ConfigurationDiagnostic:
      type: object
      properties:
        reason:
          type: string
          title: reason
          x-stainless-terraform-configurability: optional
        message:
          type: string
          title: message
          description: >-
            Keep the complete user-safe explanation for clients without guidance
            support.
          x-stainless-terraform-configurability: optional
        phase:
          $ref: '#/components/schemas/serval.configuration.v1.Phase'
          title: phase
          x-stainless-terraform-configurability: optional
        resource:
          $ref: '#/components/schemas/serval.configuration.v1.ResourceReference'
          title: resource
          x-stainless-terraform-configurability: optional
        guidance:
          $ref: >-
            #/components/schemas/serval.configuration.v1.ConfigurationDiagnosticGuidance
          title: guidance
          x-stainless-terraform-configurability: optional
      title: ConfigurationDiagnostic
      additionalProperties: false
    serval.configuration.v1.ValidationCompleteness:
      type: string
      title: ValidationCompleteness
      enum:
        - VALIDATION_COMPLETENESS_UNSPECIFIED
        - VALIDATION_COMPLETENESS_COMPLETE
        - VALIDATION_COMPLETENESS_PARTIAL
        - VALIDATION_COMPLETENESS_UNAVAILABLE
    serval.configuration.v1.Phase:
      type: string
      title: Phase
      enum:
        - PHASE_UNSPECIFIED
        - PHASE_SERIALIZE
        - PHASE_PLAN
        - PHASE_VALIDATE
        - PHASE_STAGE
        - PHASE_REVIEW
        - PHASE_APPLY
        - PHASE_FINALIZE
        - PHASE_SETUP
    serval.configuration.v1.ConfigurationDiagnosticGuidance:
      type: object
      properties:
        summary:
          type: string
          title: summary
          description: >-
            Both fields contain intentionally user-safe text; raw errors stay in
            logs.
          x-stainless-terraform-configurability: optional
        recovery:
          type: string
          title: recovery
          x-stainless-terraform-configurability: optional
      title: ConfigurationDiagnosticGuidance
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.