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

# Push, pull or merge a tool between environments

> Moves a tool's version from one of your team's environments into another, either way.

> [accordion] Details
>
> * mode replace makes the target serve the source's version: a push, or a pull. Pulling production's is a reset, so the target follows production again.
>
> * mode merge applies the source's changes onto the target's newest version, such as a production repair into staging.
>
> * Each warning answers acknowledgment\_required, with nothing written, until you accept it with force or acknowledge. Send dry\_run first to see them.
>
> * A breaking or unchecked version never changes a public tool for everyone: it lands in production as your team's private copy, or a new tool with lands\_as new\_tool.
>
> * Only an Owner or Admin signed in to the Dashboard puts code Pomerado didn't check into production. With production protected, only Owners and Admins push, merge or roll back into it.
>
> * A version that lands as a new tool takes a copy of its tool's own site sign-in, if it has one, which the new tool signs in with.
>
> * An API key limited to environments moves a version only into an environment it may be used in, from any of your team's environments. An environment's MCP URL moves one only into its own environment, from any.
>
> * **Callers:** an API key, an MCP OAuth token or a Dashboard session.
>
> * **Permission:** `tools:build`.
>
> * **Effect:** Creates or changes something.
>
> * **Errors:** [`acknowledgment_required`](https://docs.pomerado.ai/errors#acknowledgment_required), [`target_moved`](https://docs.pomerado.ai/errors#target_moved), [`production_protected`](https://docs.pomerado.ai/errors#production_protected), [`not_found`](https://docs.pomerado.ai/errors#not_found), [`environment_not_found`](https://docs.pomerado.ai/errors#environment_not_found), [`environments_unavailable`](https://docs.pomerado.ai/errors#environments_unavailable), [`merge_base_unknown`](https://docs.pomerado.ai/errors#merge_base_unknown), [`merge_too_large`](https://docs.pomerado.ai/errors#merge_too_large), [`tool_name_taken`](https://docs.pomerado.ai/errors#tool_name_taken), and the [errors any request can get](https://docs.pomerado.ai/errors.md).


## OpenAPI

````yaml /api-reference/openapi.json post /v1/tools/{tool_id}/promote
openapi: 3.1.0
info:
  title: Pomerado API
  version: '1'
  description: >-
    Run and build website tools, follow their jobs, and manage logins, API keys
    and webhooks. Authenticate with a Pomerado API key (pom_…), an MCP OAuth
    token or a Dashboard session as a Bearer token.
servers:
  - url: https://api.pomerado.ai
security: []
tags:
  - name: account
    x-group: Account
  - name: api_keys
    x-group: API keys
  - name: environments
    x-group: Environments
  - name: connected_apps
    x-group: Connected apps
  - name: usage
    x-group: Usage
  - name: quota
    x-group: Quota
  - name: spend_controls
    x-group: Spend controls
  - name: usage_alerts
    x-group: Usage alerts
  - name: usage_summary
    x-group: Usage summary
  - name: billing
    x-group: Billing
  - name: integrations
    x-group: Integrations
  - name: connect
    x-group: Connect
  - name: code
    x-group: Code
  - name: logins
    x-group: Saved logins
  - name: two_factor
    x-group: 2FA
  - name: login_access
    x-group: Login access
  - name: tools
    x-group: Tools
  - name: shapes
    x-group: Shapes
  - name: webhooks
    x-group: Webhooks
  - name: payer_profiles
    x-group: Payer profiles
  - name: payer_addresses
    x-group: Payer addresses
  - name: payment_methods
    x-group: Payment methods
  - name: runs
    x-group: Runs
  - name: builds
    x-group: Builds
  - name: jobs
    x-group: Jobs
  - name: suggestions
    x-group: Suggestions
  - name: audit
    x-group: Audit
  - name: files
    x-group: Files
  - name: team
    x-group: Team
  - name: sso
    x-group: Single sign-on
  - name: issue_reports
    x-group: Problem reports
paths:
  /v1/tools/{tool_id}/promote:
    post:
      tags:
        - environments
      summary: Push, pull or merge a tool between environments
      description: >-
        Moves a tool's version from one of your team's environments into
        another, either way.
      operationId: environments.promote
      parameters:
        - name: tool_id
          in: path
          required: true
          description: 'a tool ID: tool_ and 32 lowercase hex digits'
          schema:
            type: string
            examples:
              - tool_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
                - mode
              properties:
                from:
                  type: string
                  description: >-
                    a string matching the pattern
                    ^[a-z](?:[a-z0-9-]{0,30}[a-z0-9])?$
                  pattern: ^[a-z](?:[a-z0-9-]{0,30}[a-z0-9])?$
                to:
                  type: string
                  description: >-
                    a string matching the pattern
                    ^[a-z](?:[a-z0-9-]{0,30}[a-z0-9])?$
                  pattern: ^[a-z](?:[a-z0-9-]{0,30}[a-z0-9])?$
                mode:
                  type: string
                  enum:
                    - replace
                    - merge
                  description: >-
                    replace: the target serves the source's version. merge: the
                    source's changes go onto the target's newest version
                lands_as:
                  type: string
                  enum:
                    - private_copy
                    - new_tool
                  description: >-
                    Where a breaking or unchecked version of a public tool
                    lands; private_copy unless new_tool
                new_tool_name:
                  type: string
                  description: a string at most 80 character(s) long
                  minLength: 1
                  maxLength: 80
                dry_run:
                  type: boolean
                  description: >-
                    Preview: the warnings and the files that would change,
                    writing nothing
                force:
                  type: boolean
                  description: Accept every warning this call finds
                acknowledge:
                  type: array
                  items:
                    type: string
                    enum:
                      - inputs_change
                      - public_tool_fork
                      - target_changed
                      - target_ahead
                      - no_login_in_environment
                      - unchecked_code
                      - merge_conflicts
                  description: Accept only these warnings
                if_target_version:
                  type: integer
                  description: The target's version you saw; another refuses target_moved
                  minimum: 1
                  maximum: 1000000
              additionalProperties: false
      responses:
        '200':
          description: What it did, or would do
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Promotion'
        '400':
          description: invalid_request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: unauthorized, reauthentication_required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            production_protected, forbidden, environment_not_allowed,
            environments_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: not_found, environment_not_found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            acknowledgment_required, target_moved, merge_base_unknown,
            merge_too_large, tool_name_taken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: request_too_large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: server_busy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: internal_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: temporarily_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    Promotion:
      anyOf:
        - type: object
          required:
            - status
            - tool_id
            - environment
            - version
            - promoted_from
            - mode
            - warnings_accepted
          properties:
            status:
              type: string
              enum:
                - published
            tool_id:
              $ref: '#/components/schemas/tool_id'
            environment:
              type: string
            version:
              type: number
            promoted_from:
              type: object
              required:
                - environment
                - version
              properties:
                environment:
                  type: string
                version:
                  type: number
              additionalProperties: false
            mode:
              type: string
              enum:
                - replace
                - merge
              description: >-
                replace: the target serves the source's version. merge: the
                source's changes go onto the target's newest version
            lands_as:
              type: string
              enum:
                - public_update
                - private_copy
                - new_tool
            merged:
              type: object
              required:
                - files
                - conflicts_taken_from_source
              properties:
                files:
                  type: number
                conflicts_taken_from_source:
                  type: array
                  items:
                    type: string
              additionalProperties: false
            warnings_accepted:
              type: array
              items:
                type: string
                enum:
                  - inputs_change
                  - public_tool_fork
                  - target_changed
                  - target_ahead
                  - no_login_in_environment
                  - unchecked_code
                  - merge_conflicts
          additionalProperties: false
        - type: object
          required:
            - status
            - tool_id
            - environment
            - follows
          properties:
            status:
              type: string
              enum:
                - reset
            tool_id:
              $ref: '#/components/schemas/tool_id'
            environment:
              type: string
            follows:
              type: string
              enum:
                - production
          additionalProperties: false
        - type: object
          required:
            - status
            - tool_id
            - environment
          properties:
            status:
              type: string
              enum:
                - unchanged
            tool_id:
              $ref: '#/components/schemas/tool_id'
            environment:
              type: string
          additionalProperties: false
        - type: object
          required:
            - status
            - tool_id
            - warnings
            - files
          properties:
            status:
              type: string
              enum:
                - preview
            tool_id:
              $ref: '#/components/schemas/tool_id'
            warnings:
              type: array
              items:
                $ref: '#/components/schemas/EnvironmentWarning'
            files:
              type: object
              required:
                - changed
                - conflicts
              properties:
                changed:
                  type: array
                  items:
                    type: string
                conflicts:
                  type: array
                  items:
                    type: string
              additionalProperties: false
          additionalProperties: false
      description: >-
        published: the target serves a new version. reset: it follows production
        again. unchanged: it already served it. preview: what a dry_run found
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - retryable
            - docs_url
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            docs_url:
              type: string
            details:
              type: object
              required: []
              properties: {}
              additionalProperties:
                $id: /schemas/unknown
          additionalProperties: false
      additionalProperties: false
    tool_id:
      type: string
      description: 'a tool ID: tool_ and 32 lowercase hex digits'
      examples:
        - tool_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190
    EnvironmentWarning:
      type: object
      required:
        - code
        - message
        - details
      properties:
        code:
          type: string
          enum:
            - inputs_change
            - public_tool_fork
            - target_changed
            - target_ahead
            - no_login_in_environment
            - unchecked_code
            - merge_conflicts
        message:
          type: string
        details:
          type: object
          required: []
          properties: {}
          additionalProperties:
            $id: /schemas/unknown
      additionalProperties: false
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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