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

# List a charger's logs

> The OCPP calls between a charger you reach with `basic` access or more and its backoffices,
newest first: each request with its answer or error, who sent it, and which other backoffice
answered or sent it when Plugchoice relays the charger to one. Kept for a year. Below
`sensitive` access personal data in the payloads is masked and a call more than 14 days ago
shows its month only (`time_precision`); calls from before the charger changed hands are not
shown. A charger you do not reach is a 404; one you reach with less access is a 403.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json GET /chargers/{charger}/logs
openapi: 3.1.0
info:
  title: Plugchoice API
  description: >-
    Every request sends an access token as `Authorization: Bearer …`, unless an
    operation says otherwise.


    Errors are problems (RFC 9457, `application/problem+json`): `code` says what
    went wrong, and a failed validation lists the fields in `errors`.


    A list answers one page: `{"data": [...], "next_cursor": ...,
    "previous_cursor": ...}`. Pass a cursor back as `cursor` to get that page,
    and `limit` (1 to 100, default 25) for its size.


    Within v4, changes only add: new operations, new optional parameters, new
    fields and new enum values. Ignore fields you do not know, and accept enum
    values you do not know. Requests that send a field the operation does not
    know are refused, so a typo does not pass unnoticed.
  version: '4'
servers:
  - url: https://api.plugchoice.com/v4
security:
  - bearer: []
paths:
  /chargers/{charger}/logs:
    get:
      tags:
        - logs
      summary: A charger's logs
      description: >-
        The OCPP calls between a charger you reach with `basic` access or more
        and its backoffices,

        newest first: each request with its answer or error, who sent it, and
        which other backoffice

        answered or sent it when Plugchoice relays the charger to one. Kept for
        a year. Below

        `sensitive` access personal data in the payloads is masked and a call
        more than 14 days ago

        shows its month only (`time_precision`); calls from before the charger
        changed hands are not

        shown. A charger you do not reach is a 404; one you reach with less
        access is a 403.
      operationId: list_charger_logs
      parameters:
        - name: charger
          in: path
          description: The charger's id
          required: true
          schema:
            type: string
            format: uuid
        - name: limit
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/Limit'
        - name: cursor
          in: query
          description: >-
            A place in the list, from `next_cursor` or `previous_cursor`. Pass
            it back as given.
          required: false
          schema:
            type: string
        - name: after
          in: query
          description: >-
            Only calls made at or after this time (RFC 3339, such as
            `2026-11-23T10:00:00Z`). Below

            `sensitive` access a time more than 14 days ago counts from the
            start of its month, as

            those calls show their month only.
          required: false
          schema:
            type: string
            format: date-time
        - name: before
          in: query
          description: >-
            Only calls made before this time (RFC 3339). Below `sensitive`
            access a time more than 14

            days ago counts to the end of its month.
          required: false
          schema:
            type: string
            format: date-time
        - name: action
          in: query
          description: >-
            Only calls of this action, as OCPP names it: `action=Authorize`.
            Repeat it for several, up

            to 20: `action=StartTransaction&action=StopTransaction`.
          required: false
          schema:
            type: array
            items:
              type: string
              description: >-
                An OCPP action, as OCPP names it: `Authorize`,
                `StatusNotification`, `RemoteStartTransaction`.
              maxLength: 64
              minLength: 1
        - name: direction
          in: query
          description: Only calls in this direction.
          required: false
          schema:
            $ref: '#/components/schemas/LogDirection'
      responses:
        '200':
          description: A page of the charger's calls
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_ChargerLog'
        default:
          description: >-
            A problem (RFC 9457). `code` says which; the field errors come with
            `validation-failed`.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - bearer:
            - chargers:read
components:
  schemas:
    Limit:
      type: integer
      description: How many results one page holds.
      default: 25
      maximum: 100
      minimum: 1
    LogDirection:
      type: string
      description: >-
        Who sent a call: the charger, to its backoffice, or a backoffice to the
        charger.
      enum:
        - from_charger
        - to_charger
    Page_ChargerLog:
      type: object
      description: One page of a list.
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            description: 'One OCPP call of a charger: a request and how it was answered.'
            required:
              - at
              - time_precision
              - action
              - request
            properties:
              action:
                type: string
                description: >-
                  The OCPP action, as it was sent (also one this API does not
                  know).
              at:
                type: string
                format: date-time
                description: >-
                  When the call was made. Below `sensitive` access a call more
                  than 14 days ago shows the

                  first of its month (`time_precision`).
              direction:
                oneOf:
                  - $ref: '#/components/schemas/LogDirection'
                    description: >-
                      Who sent the call; null for a direction this API does not
                      know.
                  - type: 'null'
              duration_ms:
                type:
                  - integer
                  - 'null'
                format: int32
                description: >-
                  How long the answer took, in milliseconds; null for a call
                  logged before 2026-08-31.
              error:
                oneOf:
                  - $ref: '#/components/schemas/CallError'
                    description: >-
                      The error it was answered with; null unless `status` is
                      `error`.
                  - type: 'null'
              id:
                type:
                  - string
                  - 'null'
                format: uuid
                description: >-
                  The call's id, the same in every entry that names this call;
                  null for a call logged before

                  2026-08-31, which has none, and for one you see by its month
                  only (its id would tell its

                  time).
              ocpp_version:
                oneOf:
                  - $ref: '#/components/schemas/OcppVersion'
                    description: >-
                      The OCPP version the call was made in, which decides the
                      payloads' shape.
                  - type: 'null'
              operator:
                oneOf:
                  - $ref: '#/components/schemas/Operator'
                    description: >-
                      The other backoffice involved, for a charger whose calls
                      Plugchoice relays to one: the one

                      that answered a call from the charger, or that sent a call
                      to it. Null when Plugchoice did

                      (also when Plugchoice answered for a backoffice that was
                      away).
                  - type: 'null'
              request:
                type: object
                description: >-
                  The call's payload, as OCPP defines it for `action` and
                  `ocpp_version`. Below `sensitive`

                  access personal data and secrets in it are masked: a card id
                  shows its last three

                  characters, what ties a session to a car or a contract and a
                  configured secret show

                  `••••`, and a URL loses its credentials and query.
              response:
                type:
                  - object
                  - 'null'
                description: >-
                  The answer's payload, masked as `request` is; null unless
                  `status` is `answered`.
              status:
                oneOf:
                  - $ref: '#/components/schemas/CallStatus'
                    description: >-
                      How the call ended; null for an end this API does not
                      know.
                  - type: 'null'
              time_precision:
                $ref: '#/components/schemas/TimePrecision'
                description: How exact `at`, and the times in the payloads, are.
        next_cursor:
          type:
            - string
            - 'null'
          description: The cursor of the page after this one; null on the last page.
        previous_cursor:
          type:
            - string
            - 'null'
          description: The cursor of the page before this one; null on the first page.
    Problem:
      type: object
      description: An error response body (RFC 9457).
      required:
        - type
        - title
        - status
        - code
      properties:
        code:
          type: string
          description: 'The kind of problem, for code to act on: the last part of `type`.'
        detail:
          type: string
          description: >-
            What went wrong with this request, when there is more to say than
            the title.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          description: 'With `validation-failed`: the fields that broke a rule.'
        status:
          type: integer
          format: int32
          description: The HTTP status code.
          minimum: 0
        title:
          type: string
          description: A short summary of the kind of problem.
        type:
          type: string
          description: The page that explains this kind of problem.
    CallError:
      type: object
      description: An OCPP error answer (a CALLERROR).
      required:
        - details
      properties:
        code:
          type:
            - string
            - 'null'
          description: >-
            Its code, as the charger's OCPP version spells it (`NotImplemented`,
            `FormationViolation`,

            `FormatViolation`, …); null for a call logged before 2026-08-31.
        details:
          type: object
          description: Its details, masked as `request` is; `{}` when it sent none.
    OcppVersion:
      type: string
      description: The OCPP version a charger speaks.
      enum:
        - '1.6'
        - 2.0.1
        - '2.1'
    Operator:
      type: object
      description: >-
        Another backoffice (a CPO's or eMSP's OCPP server) a charger's calls are
        relayed to.
      required:
        - host
      properties:
        host:
          type: string
          description: 'The host of its OCPP server: `ocpp.example.com`.'
        name:
          type:
            - string
            - 'null'
          description: >-
            Its name, as Plugchoice knows the backoffice; null for a host it
            does not know.
    CallStatus:
      type: string
      description: How a call ended.
      enum:
        - answered
        - error
        - timed_out
    TimePrecision:
      type: string
      description: How exact a resource's times are.
      enum:
        - exact
        - month
    FieldError:
      type: object
      description: One field that broke a rule.
      required:
        - field
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            The rule it broke, for code to act on: `missing-field`,
            `unknown-field`, `invalid-type`,

            `invalid`, or `taken` (a value that must be unique, such as a card's
            id at a location,

            and is not).
        field:
          type: string
          description: >-
            Where the field is in the request, such as `name` or
            `connectors[0].max_current`.
        message:
          type: string
          description: What is wrong, in English.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        An access token from `accounts.plugchoice.com`, for a personal API
        token, a person signed in through an app, or an OAuth client.

````

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