> ## 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.

# Get a tool's code

> Get the files of the code a tool your team built runs now, read only, with the tool's versions.

<Accordion title="Details">
  * Business accounts only.

  * files holds the live version's files: source team for the files its build wrote, pomerado for the files Pomerado added to run them.

  * Another account's tool, a catalog tool your team only added, or an archived tool is not found.

  * **Callers:** an API key, an MCP OAuth token or a Dashboard session.

  * **Permission:** `tools:read`.

  * **Effect:** Changes nothing.

  * **Errors:** [`business_account_required`](/errors#business_account_required), [`not_found`](/errors#not_found), and the [errors any request can get](/errors).
</Accordion>


## OpenAPI

````yaml /api-reference/openapi.json get /v1/code/{id}
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: connected_apps
    x-group: Connected apps
  - name: usage
    x-group: Usage
  - name: quota
    x-group: Quota
  - 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: webhooks
    x-group: Webhooks
  - name: runs
    x-group: Runs
  - name: builds
    x-group: Builds
  - name: jobs
    x-group: Jobs
  - name: files
    x-group: Files
  - name: team
    x-group: Team
paths:
  /v1/code/{id}:
    get:
      tags:
        - code
      summary: Get a tool's code
      description: >-
        Get the files of the code a tool your team built runs now, read only,
        with the tool's versions.
      operationId: code.get
      parameters:
        - name: id
          in: path
          required: true
          description: 'a tool ID: tool_ and 32 lowercase hex digits'
          schema:
            type: string
            examples:
              - tool_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190
      responses:
        '200':
          description: The tool's live code and versions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodeBundle'
        '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: business_account_required, forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: not_found
          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:
    CodeBundle:
      type: object
      required:
        - integration
        - tool
        - versions
        - files
      properties:
        integration:
          $ref: '#/components/schemas/CodeIntegration'
        tool:
          $ref: '#/components/schemas/CodeTool'
        versions:
          type: array
          items:
            $ref: '#/components/schemas/CodeVersion'
          description: The tool's versions, newest first, at most 100
        files:
          type: array
          items:
            $ref: '#/components/schemas/CodeFile'
          description: The live version's files, by path
      additionalProperties: false
    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
    CodeIntegration:
      type: object
      required:
        - id
        - name
        - site_url
        - visibility
        - tools
      properties:
        id:
          $ref: '#/components/schemas/integration_id'
        name:
          type: string
        site_url:
          anyOf:
            - type: string
            - type: 'null'
          description: The website's https origin, or null for an offline tool
        visibility:
          type: string
          enum:
            - public
            - private
          description: >-
            public: published on Pomerado for every account to find and use.
            private: only your team sees, uses and edits it
        tools:
          type: array
          items:
            $ref: '#/components/schemas/CodeTool'
          description: The tools your team created in it
      additionalProperties: false
    CodeTool:
      type: object
      required:
        - id
        - name
        - effect
        - live_version
      properties:
        id:
          $ref: '#/components/schemas/tool_id'
        name:
          type: string
        effect:
          type: string
          enum:
            - read
            - write
        live_version:
          type: object
          required:
            - number
            - published_at
            - change
            - requested_by
          properties:
            number:
              type: integer
              description: >-
                The version's number: 1 for the tool's first code, one more for
                each later version
            published_at:
              $ref: '#/components/schemas/Date'
            change:
              type: string
              enum:
                - build
                - repair
                - change
                - update
              description: >-
                What made this version: build (Pomerado built the tool), repair
                (Pomerado repaired it after a run failed), change (someone asked
                for a change) or update (Pomerado updated it)
            requested_by:
              anyOf:
                - $ref: '#/components/schemas/CodeMember'
                - type: 'null'
              description: >-
                The team member who started the build or asked for the change;
                null for a repair or an update, and for someone outside your
                team
          additionalProperties: false
          description: The version callers run now
      additionalProperties: false
    CodeVersion:
      type: object
      required:
        - number
        - published_at
        - change
        - requested_by
      properties:
        number:
          type: integer
          description: >-
            The version's number: 1 for the tool's first code, one more for each
            later version
        published_at:
          $ref: '#/components/schemas/Date'
        change:
          type: string
          enum:
            - build
            - repair
            - change
            - update
          description: >-
            What made this version: build (Pomerado built the tool), repair
            (Pomerado repaired it after a run failed), change (someone asked for
            a change) or update (Pomerado updated it)
        requested_by:
          anyOf:
            - $ref: '#/components/schemas/CodeMember'
            - type: 'null'
          description: >-
            The team member who started the build or asked for the change; null
            for a repair or an update, and for someone outside your team
      additionalProperties: false
    CodeFile:
      type: object
      required:
        - path
        - source
        - bytes
        - content
      properties:
        path:
          type: string
          description: The file's path, such as src/tool.mjs
        source:
          type: string
          enum:
            - team
            - pomerado
          description: >-
            team: written for your tool by its build. pomerado: added by
            Pomerado to run it, such as operation.mjs and the sign-in recipe
            auth-fill.json
        bytes:
          type: integer
          description: The file's size in bytes
        content:
          type: string
          description: The file's text
      additionalProperties: false
    integration_id:
      type: string
      description: 'an integration ID: int_ and 32 lowercase hex digits'
      examples:
        - int_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190
    tool_id:
      type: string
      description: 'a tool ID: tool_ and 32 lowercase hex digits'
      examples:
        - tool_0f8e2d1c4b3a49e8a7f6e5d4c3b2a190
    Date:
      type: string
      description: a string to be decoded into a Date
    CodeMember:
      type: object
      required:
        - user_id
        - name
        - email
      properties:
        user_id:
          type: string
          description: The member's user ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: The member's name, or null when they gave none
        email:
          type: string
          description: The member's sign-in email
      additionalProperties: false
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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