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

# Change a connection's address

> Move an owned connection to a new base URL when the partner host changes, keeping its tokens and history, then re-read their endpoints at the new address.



## OpenAPI

````yaml /openapi/public-api.json put /connections/{id}/address
openapi: 3.1.0
info:
  title: ChargerDojo public API
  version: 1.0.0
  description: >-
    Automate ChargerDojo with a cdojo_ API key: register partner connections,
    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:
  /connections/{id}/address:
    put:
      tags:
        - Connections
      summary: Change a connection's address
      description: >-
        Move an owned connection to a new base URL when the partner host
        changes, keeping its tokens and history, then re-read their endpoints at
        the new address.
      operationId: connections_change_address
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            Identifier from the path. Owner scoped: another owner's id answers
            404.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangeConnectionAddress'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
        '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'
        '409':
          description: Stale plan, idempotency conflict, or stale recovery version
          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'
        '502':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    ChangeConnectionAddress:
      type: object
      required:
        - partnerBaseUrl
      properties:
        partnerBaseUrl:
          type: string
          format: uri
          description: >-
            The base URL the partner's OCPI implementation is now reachable at.
            The connection keeps its tokens, its id and its run history, drops
            to pending, and is re-registered only if their endpoints answer at
            the new address.
    Connection:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/ConnectionView'
        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
    ConnectionView:
      type: object
      additionalProperties: true
      required:
        - _id
        - partnerBaseUrl
        - ourRole
        - theirRole
        - ocpiVersion
        - status
      properties:
        _id:
          type: string
        partnerBaseUrl:
          type: string
          format: uri
        ourRole:
          type: string
          enum:
            - CPO
            - EMSP
            - HUB
            - NAP
            - NSP
            - OTHER
            - SCSP
        theirRole:
          type: string
          enum:
            - CPO
            - EMSP
            - HUB
            - NAP
            - NSP
            - OTHER
            - SCSP
        ocpiVersion:
          type: string
          enum:
            - 2.1.1
            - '2.2'
            - 2.2.1
            - 2.3.0
        status:
          type: string
          enum:
            - pending
            - registered
            - failed
        kind:
          type: string
          enum:
            - external
            - sandbox
          description: >-
            sandbox is the built-in peer every account can run against; external
            is an endpoint you registered. Absent on connections created before
            the sandbox existed, which are external.
        lastError:
          type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: A cdojo_... API key created in the app under Settings.

````