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

# Preview App route import



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/apps/{appId}/routes/import-preview
openapi: 3.1.0
info:
  title: The Prompting Company API
  version: 0.1.0
  description: >-
    Machine-readable contract for The Prompting Company organization-scoped API
    routes.
  contact:
    name: The Prompting Company
    url: https://promptingcompany.com/support
    email: support@promptingcompany.com
  license:
    name: Proprietary
    url: https://promptingcompany.com/terms
  termsOfService: https://promptingcompany.com/terms
servers:
  - url: https://app.promptingco.com
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: Visibility & Mentions
  - name: Knowledge
  - name: Content
  - name: Simulations
  - name: Apps & Publishing
paths:
  /api/v1/apps/{appId}/routes/import-preview:
    post:
      tags:
        - Apps & Publishing
      summary: Preview App route import
      operationId: postAppsAppIdRoutesImportPreview
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: appId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                routes:
                  type: array
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        minLength: 1
                        maxLength: 2048
                        pattern: ^\/?[^?#\s]*$
                      targetType:
                        type: string
                        enum:
                          - product_document
                        default: product_document
                      targetId:
                        type: string
                        minLength: 1
                    required:
                      - path
                      - targetId
                  minItems: 1
                  maxItems: 100
              required:
                - routes
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      appId:
                        type: string
                      valid:
                        type: boolean
                      createCount:
                        type: integer
                        minimum: 0
                      conflictCount:
                        type: integer
                        minimum: 0
                      skipCount:
                        type: integer
                        minimum: 0
                      routes:
                        type: array
                        items:
                          type: object
                          properties:
                            input:
                              type: object
                              properties:
                                path:
                                  type: string
                                  minLength: 1
                                  maxLength: 2048
                                  pattern: ^\/?[^?#\s]*$
                                targetType:
                                  type: string
                                  enum:
                                    - product_document
                                  default: product_document
                                targetId:
                                  type: string
                                  minLength: 1
                              required:
                                - path
                                - targetId
                            action:
                              type: string
                              enum:
                                - create
                                - conflict
                                - skip
                            issues:
                              type: array
                              items:
                                type: string
                                enum:
                                  - already_routed
                                  - duplicate_input_path
                                  - path_conflict
                                  - product_not_available
                                  - target_not_found
                            existingRoute:
                              type:
                                - object
                                - 'null'
                              properties:
                                id:
                                  type: string
                                path:
                                  type: string
                              required:
                                - id
                                - path
                            pathConflict:
                              type:
                                - object
                                - 'null'
                              properties:
                                id:
                                  type: string
                                path:
                                  type: string
                                targetType:
                                  type: string
                                targetId:
                                  type: string
                              required:
                                - id
                                - path
                                - targetType
                                - targetId
                            target:
                              type:
                                - object
                                - 'null'
                              properties:
                                id:
                                  type: string
                                title:
                                  type: string
                                filePath:
                                  type: string
                                sourceUrl:
                                  type: string
                                status:
                                  type: string
                                type:
                                  type: string
                                redirectToUrl:
                                  type:
                                    - string
                                    - 'null'
                                productId:
                                  type: string
                              required:
                                - id
                                - title
                                - filePath
                                - sourceUrl
                                - status
                                - type
                                - redirectToUrl
                                - productId
                            product:
                              type:
                                - object
                                - 'null'
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                slug:
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - id
                                - name
                                - slug
                          required:
                            - input
                            - action
                            - issues
                            - existingRoute
                            - pathConflict
                            - target
                            - product
                    required:
                      - appId
                      - valid
                      - createCount
                      - conflictCount
                      - skipCount
                      - routes
                required:
                  - ok
                  - data
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                  message:
                    type: string
                  details: {}
                required:
                  - ok
                  - code
                  - message
      security:
        - apiKeyAuth: []
        - bearerAuth: []
        - cookieAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Organization-scoped API key. Available scopes:

        - content:read: Read site pages, markdown content, and llms.txt files

        - content:write: Create, update, and delete site pages and content

        - prompts:read: Read prompts, topics, and prompt analysis results

        - prompts:write: Create, update, archive prompts

        - simulations:read: Read agent-simulation tasks, runs, environments, and
        analytics

        - simulations:write: Create and trigger simulation runs

        - logs:read: Read AI-traffic logs and request-level audit events

        - analytics:read: Read analytics aggregates (rankings, mentions,
        sources, SOV)

        - products:read: Read product metadata and competitor data

        - products:write: Update product settings and competitor lists
      x-scopes:
        content:read: Read site pages, markdown content, and llms.txt files
        content:write: Create, update, and delete site pages and content
        prompts:read: Read prompts, topics, and prompt analysis results
        prompts:write: Create, update, archive prompts
        simulations:read: Read agent-simulation tasks, runs, environments, and analytics
        simulations:write: Create and trigger simulation runs
        logs:read: Read AI-traffic logs and request-level audit events
        analytics:read: Read analytics aggregates (rankings, mentions, sources, SOV)
        products:read: Read product metadata and competitor data
        products:write: Update product settings and competitor lists
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer session or OAuth access token. Available OAuth scopes:

        - content:read: Read site pages, markdown content, and llms.txt files

        - content:write: Create, update, and delete site pages and content

        - prompts:read: Read prompts, topics, and prompt analysis results

        - prompts:write: Create, update, archive prompts

        - simulations:read: Read agent-simulation tasks, runs, environments, and
        analytics

        - simulations:write: Create and trigger simulation runs

        - logs:read: Read AI-traffic logs and request-level audit events

        - analytics:read: Read analytics aggregates (rankings, mentions,
        sources, SOV)

        - products:read: Read product metadata and competitor data

        - products:write: Update product settings and competitor lists
      x-scopes:
        content:read: Read site pages, markdown content, and llms.txt files
        content:write: Create, update, and delete site pages and content
        prompts:read: Read prompts, topics, and prompt analysis results
        prompts:write: Create, update, archive prompts
        simulations:read: Read agent-simulation tasks, runs, environments, and analytics
        simulations:write: Create and trigger simulation runs
        logs:read: Read AI-traffic logs and request-level audit events
        analytics:read: Read analytics aggregates (rankings, mentions, sources, SOV)
        products:read: Read product metadata and competitor data
        products:write: Update product settings and competitor lists
    cookieAuth:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: First-party browser session cookie.

````