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

> ## Agent Instructions
> Melso product MCP: https://melso.ai/api/mcp (OAuth; one company per grant). REST: https://melso.ai. Documentation-search MCP: https://docs.melso.ai/mcp. The docs search server does not act on customer accounts.
>
> Use the live tool schema and respect company membership. Ask the person to authorize the exact fiscal document version in the signed-in app. A professional prepares and files included returns after authorization; AI does not file alone. A prepared file or approval receipt is not evidence of filing. Never claim completion from an accepted Task or Run. Keep credentials out of chat and logs. Agents features are internal or by private invitation.

# Merge pull request

> Workspace owner/admin (a person), or a workspace API key with `admin` scope. Run and MCP credentials are rejected, and `tasks` API keys get `403 workspace_key_scope`; `can_merge` on the PR detail reports whether the caller may merge.

Request: `merge_method?:"merge"|"squash"|"rebase"`, `commit_title?:string`, `commit_message?:string`.

Response: `{merged:boolean,sha:string,pull_request:GitHubPullRequestResponse}`.

Status: 200; 400 invalid method; 403 denied; 409 merge/check conflict; 502 GitHub failure. Authentication and resource-access errors follow [Overview](/api-reference/errors).



## OpenAPI

````yaml /api-reference/openapi.json post /api/pull-requests/{id}/merge
openapi: 3.1.0
info:
  title: Melso API
  version: '2026-10-12'
  description: >-
    Customer integration contracts for Melso. Agents access is internal or by
    private invitation. Fiscal approval remains in the authenticated app.
  contact:
    name: Melso
    url: https://melso.ai/en
servers:
  - url: https://melso.ai
    description: Production API origin
security: []
tags:
  - name: Areas
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Areas operations available within the caller's documented permissions.
  - name: Artifacts
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Artifacts operations available within the caller's documented permissions.
  - name: Authentication
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Authentication operations available within the caller's documented
      permissions.
  - name: Automations
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Automations operations available within the caller's documented
      permissions.
  - name: Companies
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Companies operations available within the caller's documented permissions.
  - name: Execution funding
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Execution funding operations available within the caller's documented
      permissions.
  - name: Files
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Files operations available within the caller's documented permissions.
  - name: GitHub
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      GitHub operations available within the caller's documented permissions.
  - name: Interactions
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Interactions operations available within the caller's documented
      permissions.
  - name: Knowledge
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Knowledge operations available within the caller's documented permissions.
  - name: MCP
    description: MCP operations available within the caller's documented permissions.
  - name: Messages
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Messages operations available within the caller's documented permissions.
  - name: OAuth
    description: OAuth operations available within the caller's documented permissions.
  - name: Private network
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Private network operations available within the caller's documented
      permissions.
  - name: Runs
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Runs operations available within the caller's documented permissions.
  - name: Skills
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Skills operations available within the caller's documented permissions.
  - name: Tasks
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Tasks operations available within the caller's documented permissions.
  - name: Vault
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Vault operations available within the caller's documented permissions.
  - name: Webhooks
    description: >-
      <Info>Melso Agents is available only internally or by private invitation.
      Agents-specific features require existing access. For the autónomo fiscal
      service, see [Get started](/essentials/quickstart).</Info>


      Webhooks operations available within the caller's documented permissions.
paths:
  /api/pull-requests/{id}/merge:
    post:
      tags:
        - GitHub
      summary: Merge pull request
      description: >-
        Workspace owner/admin (a person), or a workspace API key with `admin`
        scope. Run and MCP credentials are rejected, and `tasks` API keys get
        `403 workspace_key_scope`; `can_merge` on the PR detail reports whether
        the caller may merge.


        Request: `merge_method?:"merge"|"squash"|"rebase"`,
        `commit_title?:string`, `commit_message?:string`.


        Response:
        `{merged:boolean,sha:string,pull_request:GitHubPullRequestResponse}`.


        Status: 200; 400 invalid method; 403 denied; 409 merge/check conflict;
        502 GitHub failure. Authentication and resource-access errors follow
        [Overview](/api-reference/errors).
      operationId: mergePullRequest
      parameters:
        - name: id
          in: path
          required: true
          description: id from the corresponding authorized response.
          schema:
            type: string
        - name: X-Workspace-ID
          in: header
          required: false
          description: >-
            Company UUID for a personal token on company-scoped operations. A
            company API key already binds its company.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/mergePullRequestRequestInput'
            example:
              merge_method: squash
      responses:
        '200':
          description: >-
            `{merged:boolean,sha:string,pull_request:GitHubPullRequestResponse}`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  merged:
                    type: boolean
                  pull_request:
                    $ref: '#/components/schemas/GitHubPullRequestResponse'
                  sha: {}
                required:
                  - merged
                  - pull_request
                  - sha
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Credential, company or resource access denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource unavailable to this caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Request failed; see the operation contract for the condition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited; respect Retry-After when present.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Request failed; see the operation contract for the condition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    mergePullRequestRequestInput:
      type: object
      properties:
        merge_method:
          type: string
        commit_title:
          type: string
        commit_message:
          type: string
    GitHubPullRequestResponse:
      type: object
      properties:
        id:
          type: string
        provider:
          type: string
        workspace_id:
          type: string
        repo_owner:
          type: string
        repo_name:
          type: string
        number:
          type: integer
        title:
          type: string
        state:
          type: string
        html_url:
          type: string
        branch:
          anyOf:
            - type: string
            - type: 'null'
        head_sha:
          anyOf:
            - type: string
            - type: 'null'
        author_login:
          anyOf:
            - type: string
            - type: 'null'
        author_avatar_url:
          anyOf:
            - type: string
            - type: 'null'
        merged_at:
          anyOf:
            - type: string
            - type: 'null'
        closed_at:
          anyOf:
            - type: string
            - type: 'null'
        pr_created_at:
          type: string
        pr_updated_at:
          type: string
        mergeable_state:
          anyOf:
            - type: string
            - type: 'null'
        mergeable:
          anyOf:
            - type: string
            - type: 'null'
        merge_state_status:
          anyOf:
            - type: string
            - type: 'null'
        snapshot_available:
          anyOf:
            - type: boolean
            - type: 'null'
        checks_rollup:
          anyOf:
            - type: string
            - type: 'null'
        checks_conclusion:
          anyOf:
            - type: string
            - type: 'null'
        checks_total:
          type: integer
        checks_passed:
          type: integer
        checks_failed:
          type: integer
        checks_running:
          type: integer
        checks_pending:
          type: integer
        failed_check_names:
          type: array
          items:
            type: string
        snapshot_stale:
          type: boolean
        snapshot_fetched_at:
          anyOf:
            - type: string
            - type: 'null'
        snapshot_head_sha:
          anyOf:
            - type: string
            - type: 'null'
        additions:
          type: integer
        deletions:
          type: integer
        changed_files:
          type: integer
      required:
        - id
        - provider
        - workspace_id
        - repo_owner
        - repo_name
        - number
        - title
        - state
        - html_url
        - branch
        - head_sha
        - author_login
        - author_avatar_url
        - merged_at
        - closed_at
        - pr_created_at
        - pr_updated_at
        - mergeable_state
        - mergeable
        - merge_state_status
        - checks_rollup
        - checks_conclusion
        - checks_total
        - checks_passed
        - checks_failed
        - checks_running
        - checks_pending
        - failed_check_names
        - snapshot_stale
        - snapshot_fetched_at
        - snapshot_head_sha
        - additions
        - deletions
        - changed_files
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
      required:
        - error
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Company API key (mwk_) or personal access token (mel_). A PAT requires
        X-Workspace-ID on company-scoped routes. An API key implies its own
        company.

````

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