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

# Get a link session

> One time through Link, opened with one of your client sessions. The SDK returns its id (`sessionId`)
when Link closes; read the outcome here before you rely on it (or poll it on a timer).




## OpenAPI

````yaml api-reference/sdk/sdk-v1.openapi.yaml GET /link-sessions/{link_session_id}
openapi: 3.1.0
info:
  title: Plugchoice SDK API
  version: '2026-10-07'
  summary: Connect EV chargers to Plugchoice from your own app.
  description: >
    The API of the Plugchoice SDK. Your server creates client sessions, which
    say who Link (the SDK's

    onboarding feature) acts for and what it may reach; it reads the link
    sessions Link opened with them, and

    the chargers and what each can do. The `/session` endpoints are used only by
    Link's hosted flow at

    `connect.plugchoice.com`.


    Errors are RFC 9457 problem details; times are RFC 3339 UTC; ids are UUIDs.


    **Versions** are dates. Pin one with the `Plugchoice-Version` request
    header; without it you get the newest.

    Every response says which version answered in the same header. An unknown
    version is

    `400 unknown-version`. The only version is `2026-10-07`.
  contact:
    name: Plugchoice
    url: https://developer.plugchoice.com/sdk
    email: support@plugchoice.com
servers:
  - url: https://api.plugchoice.com/sdk/v1
    description: Production
security: []
tags:
  - name: Client sessions
    description: >-
      Say who Link acts for, and what it may reach, for an hour. Integrations
      and Plugchoice users.
  - name: Link sessions
    description: >-
      Read the outcome of a link session, one time through Link. Integrations
      and Plugchoice users.
  - name: Chargers
    description: >-
      Read chargers and what they can do (`capabilities`). Integrations and
      Plugchoice users.
  - name: Session
    description: Link's hosted flow only. Opens and runs one link session.
paths:
  /link-sessions/{link_session_id}:
    get:
      tags:
        - Link sessions
      summary: Get a link session
      description: >
        One time through Link, opened with one of your client sessions. The SDK
        returns its id (`sessionId`)

        when Link closes; read the outcome here before you rely on it (or poll
        it on a timer).
      operationId: getLinkSession
      parameters:
        - $ref: '#/components/parameters/PlugchoiceVersion'
        - $ref: '#/components/parameters/LinkSessionId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkSession'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - integrationToken: []
        - userToken: []
components:
  parameters:
    PlugchoiceVersion:
      name: Plugchoice-Version
      in: header
      required: false
      description: >-
        The API version to answer with (`400 unknown-version` for one this API
        does not know). Every response carries the version that answered in the
        same header.
      schema:
        type: string
        enum:
          - '2026-10-07'
    LinkSessionId:
      name: link_session_id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    LinkSession:
      type: object
      description: One time through Link, opened with one of your client sessions.
      required:
        - id
        - started_by
        - action
        - device_type
        - status
        - charger_ids
        - devices
        - claims
        - created_at
        - expires_at
      properties:
        id:
          type: string
          format: uuid
        started_by:
          $ref: '#/components/schemas/StartedBy'
        external_user_id:
          oneOf:
            - $ref: '#/components/schemas/ExternalUserId'
            - type: 'null'
        site_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Null until the hosted flow has the address, when the client session
            didn't name a site.
        action:
          $ref: '#/components/schemas/Action'
        device_type:
          $ref: '#/components/schemas/DeviceType'
        charger_id:
          type:
            - string
            - 'null'
          format: uuid
          description: The charger a link session other than `add` is for.
        status:
          $ref: '#/components/schemas/LinkSessionStatus'
        charger_ids:
          type: array
          description: Chargers finished in this link session. Empty unless `completed`.
          items:
            type: string
            format: uuid
        devices:
          type: array
          description: The same chargers as devices, as the SDK returns them.
          items:
            $ref: '#/components/schemas/Device'
        claims:
          type: array
          description: >-
            Claims this link session started. They can still succeed after it
            ended; the charger then appears at `site_id`.
          items:
            $ref: '#/components/schemas/ClaimSummary'
        abandon_reason:
          $ref: '#/components/schemas/AbandonReason'
        error:
          description: Set when `abandon_reason` is `error`.
          oneOf:
            - $ref: '#/components/schemas/FlowError'
            - type: 'null'
        created_at:
          type: string
          format: date-time
        opened_at:
          type:
            - string
            - 'null'
          format: date-time
        ended_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type: string
          format: date-time
          description: The 6 h cap.
    StartedBy:
      type: string
      description: >-
        `integration` when an integration created the client session, `user`
        when a Plugchoice user did.
      enum:
        - user
        - integration
    ExternalUserId:
      type: string
      description: Your own id for one of your users.
      minLength: 1
      maxLength: 200
      pattern: ^[A-Za-z0-9._:@-]+$
    Action:
      type: string
      description: >
        What a link session does. `add` (the default) adds chargers; the others
        work on one charger: `network`

        (its network settings), `setup` (its electrical setup), `reconnect`
        (bring it back to Plugchoice). Open:

        any action the pattern allows is accepted, and the hosted flow decides
        what it means; for one it can't

        do, it shows what the charger can do.
      pattern: ^[a-z_]{1,32}$
      examples:
        - add
        - network
        - setup
        - reconnect
    DeviceType:
      type: string
      description: >-
        The kind of device. Only chargers for now; another type is `422
        unsupported-device-type`.
      enum:
        - charger
    LinkSessionStatus:
      type: string
      description: >
        A link session is `opened` when Link starts it, then `completed` |
        `abandoned` | `expired` (not finished

        within 6 h).
      enum:
        - opened
        - completed
        - abandoned
        - expired
    Device:
      type: object
      required:
        - type
        - id
      properties:
        type:
          $ref: '#/components/schemas/DeviceType'
        id:
          type: string
          format: uuid
    ClaimSummary:
      type: object
      required:
        - id
        - identity
        - status
      properties:
        id:
          type: string
          format: uuid
        identity:
          type: string
        status:
          $ref: '#/components/schemas/ClaimStatus'
        charger_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Set once the claim succeeded.
    AbandonReason:
      type:
        - string
        - 'null'
      enum:
        - cancelled
        - consent_declined
        - error
        - null
    FlowError:
      type: object
      required:
        - code
      properties:
        code:
          type: string
          description: >-
            Why the hosted flow ended with an error (for example
            `wifi_join_failed`, `charger_unreachable`). For your logs; new codes
            may be added.
        message:
          type: string
    Problem:
      type: object
      description: RFC 9457 problem details.
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
          format: uri
          description: >-
            Stable identifier,
            `https://developer.plugchoice.com/sdk/errors/{code}`.
          examples:
            - https://developer.plugchoice.com/sdk/errors/identity-taken
        title:
          type: string
          examples:
            - Identity already registered
        status:
          type: integer
        detail:
          type: string
        code:
          $ref: '#/components/schemas/ErrorCode'
        errors:
          type: object
          description: Only for `validation-failed`. Field path → messages.
          additionalProperties:
            type: array
            items:
              type: string
        site:
          $ref: '#/components/schemas/SiteSummary'
          description: Only for `charger-at-other-site`.
        claimable:
          type: boolean
          description: >-
            Only for `identity-taken`. Whether `POST /session/claims` can be
            tried.
        vendor_charger:
          type: object
          description: >-
            Only for problems connecting a Zaptec installation's chargers in the
            hosted flow. Which charger of the installation it is about.
          required:
            - id
            - serial
          properties:
            id:
              type: string
              description: The brand's id (`ZaptecCharger.id`).
            serial:
              type: string
    ClaimStatus:
      type: string
      description: >
        `pending` → `approved` (the owner agreed) | `proven` (plug-in passed) |
        `released` (dormant, the owner

        didn't answer in 7 days): the charger is now at the claimant's site. Or
        → `rejected` (the owner said

        no) | `expired` (7 days, not dormant) | `withdrawn` (the session was
        abandoned).
      enum:
        - pending
        - approved
        - proven
        - released
        - rejected
        - expired
        - withdrawn
    ErrorCode:
      type: string
      description: >-
        The last path segment of `type`, for switch statements. New codes may be
        added.
      enum:
        - unauthenticated
        - forbidden
        - not-found
        - validation-failed
        - rate-limited
        - unknown-version
        - unsupported-device-type
        - scope-required
        - client-session-expired
        - site-required
        - session-ended
        - consent-required
        - consent-not-needed
        - location-required
        - location-already-set
        - method-not-allowed
        - identity-taken
        - identity-busy
        - identity-not-taken
        - charger-at-other-site
        - pincode-invalid
        - claim-exists
        - claim-closed
        - charger-offline
        - plug-in-not-available
        - nothing-to-complete
        - vendor-sign-in-failed
        - vendor-sign-in-required
        - vendor-not-permitted
        - vendor-charger-offline
        - vendor-rate-limited
        - vendor-unavailable
        - vendor-error
        - bad-request
        - server-error
    SiteSummary:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
  responses:
    Unauthenticated:
      description: Missing, invalid or expired token (`unauthenticated`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    NotFound:
      description: No such resource for this caller or session (`not-found`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    integrationToken:
      type: oauth2
      description: >
        Your integration's client credentials (test or live). The token acts as
        your integration's team and

        lasts 1 hour; request a new one when it expires. Send `client_id`,
        `client_secret` and

        `grant_type=client_credentials`. No OAuth scopes are needed.
      flows:
        clientCredentials:
          tokenUrl: https://app.plugchoice.com/oauth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      description: >
        A Plugchoice user's OAuth access token or personal access token, acting
        for that user.

````

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