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

# Preview a journey plan

> Compile a journey into a runnable plan and save it without running it, so you can read the stages and the preflight before anything reaches your partner.



## OpenAPI

````yaml /openapi/public-api.json post /testing/journeys/preview
openapi: 3.1.0
info:
  title: ChargerDojo public API
  version: 1.0.0
  description: >-
    Automate ChargerDojo with a cdojo_ API key: register partner endpoints, run
    conformance suites and charging journeys, and read the graded reports.
servers:
  - url: https://chargerdojo.com/api/v1
security:
  - apiKey: []
tags:
  - name: Connections
  - name: Testing
  - name: Reports
  - name: Usage
  - name: Journeys
paths:
  /testing/journeys/preview:
    post:
      tags:
        - Journeys
      summary: Preview a journey plan before running it
      description: >-
        Compile a journey into a runnable plan and save it without running it,
        so you can read the stages and the preflight before anything reaches
        your partner.
      operationId: journeys_post_journeys_preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JourneyManifest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JourneyPreview'
        '400':
          description: Malformed input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found, or owned by another account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    JourneyManifest:
      type: object
      required:
        - schemaVersion
        - journey
        - targetId
        - roleUnderTest
        - journeyPack
        - topology
        - ocpiVersion
        - clock
        - session
        - completion
        - seed
      additionalProperties: false
      properties:
        schemaVersion:
          type: integer
          enum:
            - 1
        journey:
          type: string
          enum:
            - first-successful-charge
            - rough-session
            - charger-reset
            - partner-connection
            - catalogue-trust
            - remote-start-stop
            - live-price-parking
            - reservation
            - cdr-desk
            - offline-catch-up
            - hub-routed-charge
            - book-arrive-charge
            - direct-terminal-payment
            - smart-charging-control
            - hub-connection-status
            - invalid-charging-data
            - custom
        targetId:
          type: string
          minLength: 1
          maxLength: 64
        roleUnderTest:
          type: string
          enum:
            - CPO
            - EMSP
            - PTP
            - OTHER
            - SCSP
        journeyPack:
          type: string
          enum:
            - core-charging
            - foundation
            - catalogue
            - commands
            - billing
            - recovery
            - hub
            - booking
            - direct-payment
            - charging-profiles
            - hub-client-info
            - negative
        topology:
          type: object
          additionalProperties: false
          properties:
            kind:
              type: string
              enum:
                - direct
                - hub
              default: direct
            profile:
              type: string
              enum:
                - core-ocpi
                - gireve-2.2.1
                - plugsurfing-roam-2.2.1
              default: core-ocpi
        ocpiVersion:
          type: string
          enum:
            - 2.1.1
            - '2.2'
            - 2.2.1
            - 2.3.0
        clock:
          type: object
          required:
            - mode
            - durationSeconds
          additionalProperties: false
          properties:
            mode:
              type: string
              enum:
                - real
                - accelerated
            durationSeconds:
              type: integer
              minimum: 60
              maximum: 172800
            accelerationFactor:
              type: integer
              minimum: 1
              maximum: 3600
        session:
          type: object
          required:
            - cadenceSeconds
            - strategy
            - updates
          additionalProperties: false
          properties:
            cadenceSeconds:
              type: integer
              minimum: 1
              maximum: 86400
            jitterSeconds:
              type: integer
              minimum: 0
              maximum: 3600
              default: 0
            strategy:
              type: string
              enum:
                - put-only
                - put-and-patch
            updates:
              type: array
              minItems: 1
              maxItems: 4
              items:
                type: string
                enum:
                  - kwh
                  - total_cost
                  - status
                  - charging_periods
        completion:
          type: object
          additionalProperties: false
          properties:
            cdrDelaySeconds:
              type: integer
              minimum: 0
              maximum: 172800
              default: 0
        seed:
          type: string
          minLength: 1
          maxLength: 128
    JourneyPreview:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
        data:
          type: object
          required:
            - planId
            - planHash
            - runAllowed
            - plan
          properties:
            planId:
              type: string
            planHash:
              type: string
            expiresInSeconds:
              type: integer
            runAllowed:
              type: boolean
            plan:
              type: object
              description: Compiled plan summary with stages and preflight.
        meta:
          type: object
          description: Paging, on the operations that return a list.
          properties:
            limit:
              type: integer
            skip:
              type: integer
            nextCursor:
              type: string
          additionalProperties: true
    Error:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
        status:
          type: string
          enum:
            - error
        code:
          type: string
        timestamp:
          type: string
          format: date-time
        capability:
          type: string
          enum:
            - external-endpoints
            - ci-handoff
            - saved-presets
            - load-testing
            - direct-payment
            - bookings
            - scheduled-runs
        limit:
          type: object
          required:
            - id
            - used
            - cap
          properties:
            id:
              type: string
              enum:
                - connections
                - run-concurrency
            used:
              type: integer
            cap:
              type: integer
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: A cdojo_... API key created in the app under Settings.

````