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

# Create Pull Request

> Create a new pull request from one branch into another.

Yertle's merge model is **fast-forward only** — the source branch must
be a strict descendant of the target for the PR to be mergeable. You
can still open a PR that can't currently fast-forward; the UI will
surface the conflict and the author can rebase before merging.

Set `is_draft=true` for a work-in-progress PR that cannot be merged
until promoted to ready. The PR number is auto-assigned per node and
returned in the response.



## OpenAPI

````yaml post /orgs/{org_id}/nodes/{node_id}/pull-requests
openapi: 3.1.0
info:
  title: Flow API
  description: Content-addressing backend with Git-like versioning
  version: 1.0.0
servers:
  - url: https://api.yertle.com
    description: Production
security: []
paths:
  /orgs/{org_id}/nodes/{node_id}/pull-requests:
    post:
      tags:
        - pull-requests
      summary: Create Pull Request
      description: |-
        Create a new pull request from one branch into another.

        Yertle's merge model is **fast-forward only** — the source branch must
        be a strict descendant of the target for the PR to be mergeable. You
        can still open a PR that can't currently fast-forward; the UI will
        surface the conflict and the author can rebase before merging.

        Set `is_draft=true` for a work-in-progress PR that cannot be merged
        until promoted to ready. The PR number is auto-assigned per node and
        returned in the response.
      operationId: create_pull_request_orgs__org_id__nodes__node_id__pull_requests_post
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            title: Org Id
        - name: node_id
          in: path
          required: true
          schema:
            type: string
            title: Node Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePRRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePRResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreatePRRequest:
      properties:
        source_branch:
          type: string
          title: Source Branch
          description: Source branch name
        target_branch:
          type: string
          title: Target Branch
          description: Target branch name
          default: main
        title:
          type: string
          maxLength: 255
          minLength: 1
          title: Title
          description: PR title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: PR description
        is_draft:
          type: boolean
          title: Is Draft
          description: Whether PR is draft
          default: false
      type: object
      required:
        - source_branch
        - title
      title: CreatePRRequest
      description: Request model for creating a pull request.
    CreatePRResponse:
      properties:
        pr:
          $ref: '#/components/schemas/PullRequestResponse'
          description: Created pull request
      type: object
      required:
        - pr
      title: CreatePRResponse
      description: Response for creating a pull request.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PullRequestResponse:
      properties:
        id:
          type: string
          title: Id
          description: PR unique identifier
        node_id:
          type: string
          title: Node Id
          description: Node this PR belongs to
        number:
          type: integer
          title: Number
          description: PR number
        title:
          type: string
          title: Title
          description: PR title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: PR description
        source_branch:
          type: string
          title: Source Branch
          description: Source branch name
        target_branch:
          type: string
          title: Target Branch
          description: Target branch name
        source_commit:
          type: string
          title: Source Commit
          description: Source commit ID
        target_commit:
          type: string
          title: Target Commit
          description: Target commit ID
        status:
          type: string
          title: Status
          description: PR status (open, merged, closed)
        is_draft:
          type: boolean
          title: Is Draft
          description: Whether PR is draft
        author:
          type: string
          title: Author
          description: PR author
        author_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Email
          description: Author email address
        merged_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Merged By
          description: Who merged the PR
        merged_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Merged By Email
          description: Merger email address
        closed_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Closed By
          description: Who closed the PR
        closed_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Closed By Email
          description: Closer email address
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When PR was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When PR was last updated
        merged_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Merged At
          description: When PR was merged
        closed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Closed At
          description: When PR was closed
        can_merge:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Can Merge
          description: Whether PR can be merged now
        merge_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Merge Reason
          description: Reason if cannot merge
        commits_ahead:
          anyOf:
            - type: integer
            - type: 'null'
          title: Commits Ahead
          description: Commits ahead of target branch
      type: object
      required:
        - id
        - node_id
        - number
        - title
        - source_branch
        - target_branch
        - source_commit
        - target_commit
        - status
        - is_draft
        - author
        - created_at
        - updated_at
      title: PullRequestResponse
      description: Response model for pull request data.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````