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

# Read mini-app source and edit access

> Read a mini-app’s source and check whether the acting user can edit it before preparing changes. Viewing an app does not grant editing access.

The response includes `can_edit`. Check that it is `true` before preparing changes.
For an access check, use `?include_source=false` to skip downloading the source
archive; the response keeps the same fields with `source: ""`. Omitting this
parameter preserves the full-source response.
Editing requires workspace app edit permission. An empty editor list allows
everyone with that permission. A nonempty list restricts editing to selected
people and the owner, including for admins. Bare API keys receive `can_edit: false`.

An identified user must be able to open the app to read its source. Users with app
read or write permission can inspect the latest version; users who can only open
a shared app receive its published source. Reading source does not grant editing
access. Every save checks edit access again, so an earlier check does not preserve
access after an editor is removed.

See [Mini-app editing access](https://docs.open.cx/build-agents/mini-apps.md) for invitations and ownership.


## OpenAPI

````yaml get /mini-apps/{id}/source
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /mini-apps/{id}/source:
    get:
      summary: Get a mini app's latest source and edit access
      operationId: getMiniAppSource
      parameters:
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
          in: query
          name: include_source
          required: false
          description: >-
            Set to false to check access without downloading source. Defaults to
            true; source is empty when excluded.
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MiniAppSourceResponseDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    MiniAppSourceResponseDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/MiniAppSourceResponseDto'
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        name:
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
        source:
          type: string
        can_edit:
          type: boolean
          description: >-
            Whether the acting user has app edit permission and satisfies the
            editor settings. An empty list permits everyone with that
            permission; a nonempty list permits selected people and the owner.
      required:
        - id
        - name
        - description
        - source
        - can_edit
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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