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

# Send an OCPI command

> Send a single OCPI command through a registered connection you own and read back the raw HTTP status, OCPI status code and response body.



## OpenAPI

````yaml /openapi/public-api.json post /testing/command
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/command:
    post:
      tags:
        - Testing
      summary: Send one bounded OCPI command through an owned registered connection
      description: >-
        Send a single OCPI command through a registered connection you own and
        read back the raw HTTP status, OCPI status code and response body.
      operationId: command_send
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManualCommand'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResult'
        '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'
        '402':
          description: The plan does not include this capability
          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'
        '409':
          description: >-
            The connection is not ready to send a command, because its
            registration never finished
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unsupported configuration for this target
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Quota or rate limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    ManualCommand:
      type: object
      required:
        - connectionId
        - method
        - endpoint
      properties:
        connectionId:
          type: string
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
        endpoint:
          type: string
          description: Module-relative OCPI path, for example /commands/START_SESSION.
        body:
          description: Request body for write methods.
        expectedStatus:
          oneOf:
            - type: integer
            - type: array
              items:
                type: integer
          description: >-
            The status you expect, or every status the spec permits here. Omit
            it and any 2xx or 3xx passes.
    CommandResult:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
        data:
          type: object
          required:
            - passed
            - actualStatus
            - exchange
          properties:
            passed:
              type: boolean
              description: >-
                Whether the answer matched expectedStatus, or fell in 2xx/3xx
                when you named none. A transport failure reports status 0 and
                never passes.
            actualStatus:
              type: integer
            exchange:
              $ref: '#/components/schemas/Exchange'
        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
    Exchange:
      type: object
      required:
        - request
      description: >-
        The request sent and the response received. Credentials tokens are
        scrubbed where the exchange is captured, before it is stored.
      properties:
        request:
          type: object
          required:
            - method
            - url
            - headers
          properties:
            method:
              type: string
            url:
              type: string
            headers:
              type: object
              additionalProperties:
                type: string
            headersTruncated:
              type: boolean
            body: {}
            bodyTruncated:
              type: boolean
        response:
          type: object
          required:
            - status
          properties:
            status:
              type: integer
            headers:
              type: object
              additionalProperties:
                type: string
            headersTruncated:
              type: boolean
            body: {}
            bodyTruncated:
              type: boolean
        latencyMs:
          type: integer
        error:
          type: string
          description: >-
            Why no response came back, on a check that never got one. The field
            a transport failure is read through.
        errorTruncated:
          type: boolean
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: A cdojo_... API key created in the app under Settings.

````