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

# Edit connection metadata (deprecated)

> Edit custom metadata for the connection or connections (only overrides specified properties, not the entire metadata). If updating multiple connections pass in an array of connection ids instead of a string. This endpoint is deprecated, use the /connections/metadata endpoint instead.

<Info>
  Requires an API key with the `environment:connections:update` scope. [Learn more about API key scopes](/reference/backend/http-api/api-keys#scopes).
</Info>

## Update *connection metadata*

Nango uses the request body as the new metadata (it must be a JSON object). Note that this overrides specified properties, not the entire metadata. The connection\_id must be passed in the body as well. Note that the connection\_id can be a single string or an array of strings.

## Fetching *connection metadata*

To read the existing metadata of a *connection*, simply fetch the connection. Your custom metadata is included as part of the returned connection object.


## OpenAPI

````yaml PATCH /connection/metadata
openapi: 3.1.0
info:
  title: Nango API
  description: Nango API specs used to authorize & sync data with external APIs.
  version: 1.0.0
servers:
  - url: https://api.nango.dev
    description: Production server
  - url: http://localhost:3003
    description: Local server
security:
  - bearerAuth: []
externalDocs:
  url: https://nango.dev/docs/reference/backend/http-api/authentication
paths:
  /connection/metadata:
    patch:
      summary: Edit connection metadata (deprecated)
      description: >-
        Edit custom metadata for the connection or connections (only overrides
        specified properties, not the entire metadata). If updating multiple
        connections pass in an array of connection ids instead of a string. This
        endpoint is deprecated, use the /connections/metadata endpoint instead.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - metadata
                - connection_id
                - provider_config_key
              properties:
                connection_id:
                  oneOf:
                    - type: string
                      example: connection-123
                      description: >-
                        The connection ID used to update the metadata on.
                        Accepts an array of connection ids as well
                    - type: array
                      items:
                        type: string
                        example: connection-123
                      description: >-
                        The connection IDs used to update the metadata on. If
                        one connection id is invalid in the array the entire
                        operation is aborted with no changes made.
                provider_config_key:
                  type: string
                  description: >-
                    The integration ID used to create the connection (aka Unique
                    Key).
                metadata:
                  type: object
      responses:
        '200':
          description: Successfully updated the metadata for the connections
          content:
            application/json:
              schema:
                type: object
                properties:
                  connection_id:
                    oneOf:
                      - type: string
                        example: connection-123
                        description: >-
                          The connection ID used to update the metadata on.
                          Returns an array of connection ids if an array is
                          passed in.
                      - type: array
                        items:
                          type: string
                          example: connection-123
                        description: >-
                          The connection IDs used to update the metadata on. If
                          one connection id is invalid in the array the entire
                          operation is aborted with no changes made.
                  provider_config_key:
                    type: string
                    description: >-
                      The integration ID used to create the connection (aka
                      Unique Key).
                  metadata:
                    type: object
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StdError'
  schemas:
    StdError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - code
          properties:
            code:
              type: string
            message:
              type: string
            errors:
              type: array
              items:
                type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: The secret key from your Nango environment.

````