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

# Update a source

> Changes the source's name, settings, credentials, or tunnel. Send only the fields that change. New settings are tested before they are saved, and running pipelines that use the source are restarted.



## OpenAPI

````yaml /cdc-openapi.yaml patch /sources/{id}
openapi: 3.0.3
info:
  title: Integrate.io ELT & CDC REST API
  description: >
    The Integrate.io ELT & CDC REST API lets you manage sources, destinations,
    and pipelines from

    outside the dashboard. Pipelines are described by a declarative definition
    document (YAML or

    JSON), so the same configuration can be version-controlled, reviewed, and
    reapplied across

    environments.


    ## Base URL

    All endpoints live under `/api/public/v1`.


    ## Authentication

    Requests are authenticated with a bearer API key:

    ```

    Authorization: Bearer fdk_<your-key>

    ```

    Every Integrate.io API key is prefixed with `fdk_`. The full key value is
    shown only once at

    creation time. Store it in a secret manager. If a key is lost or leaked,
    revoke it and create a

    new one.


    **Create a key:** in the dashboard, go to **Settings > API Keys**, click
    **Create API key**, give

    it a name (for example `terraform-prod`), and choose its access. Copy the
    value from the

    confirmation dialog; it is not shown again. Only account admins can create
    or revoke keys.


    **Access:** a **Read only** key can make `GET` requests, validate
    definitions, test connections,

    and read source schemas. A **Read and write** key can also create, change,
    start, stop, and

    archive. A request the key's access doesn't cover returns `403`.


    **Revoke a key:** from **Settings > API Keys**, open the action menu next to
    a key and choose

    **Revoke**. Revoked keys stop authenticating immediately and cannot be
    reactivated.


    ## Typical workflow

    1. Find the connector you need with `GET /connector-types`, and the settings
    it takes with
       `GET /connector-types/{type}`.
    2. Create a source and a destination with `POST /sources` and `POST
    /destinations`. Each is
       tested before it is saved.
    3. Read the source's tables with `POST /sources/{id}/schema`.

    4. Create a pipeline with `POST /pipelines`, then start it with `POST
    /pipelines/{id}/start`.

    5. Follow it with `GET /pipelines/{id}/status` and `GET
    /pipelines/{id}/events`.


    ## Pipeline definition document

    Create, replace, and validate requests take a declarative definition
    document. For the full

    schema, supported transformation types, and examples, see

    [Pipeline definition import and
    export](/cdc/pipeline-definition-import-export#pipeline-definition-document).


    ## Pagination

    List endpoints take `page` (starting at 1) and `page_size` (default 50,
    maximum 100), and return

    a `pagination` object with `page`, `page_size`, `total`, and `total_pages`.


    ## Rate limits

    Each key can make 300 requests per minute, and each account 600. Calls that
    reach out to a

    source or destination (creating, updating, or testing a connection, reading
    a source schema,

    and starting, stopping, or archiving a pipeline) are limited further, to 20
    per minute per key

    and 40 per account. Every response carries `X-RateLimit-Limit`,
    `X-RateLimit-Remaining`, and

    `X-RateLimit-Reset`. Over the limit, the API returns `429` with a
    `Retry-After` header giving the

    seconds to wait.


    ## Errors

    Error responses have a human-readable `detail` and a stable,
    machine-readable `code`:

    ```json

    {"detail": "Resource does not exist", "code": "not_found"}

    ```

    Branch on `code`, not `detail`, which may be reworded. Common codes:
    `bad_request`,

    `unauthorized`, `forbidden`, `not_found`, `conflict`, `invalid_request` (the
    body has the wrong

    shape; `detail` lists each problem), `request_too_large` (the body is over 5
    MB),

    `rate_limited`, and `connection_test_failed` (the checks are under `test`).
    Unknown IDs and IDs

    that belong to another account both return `404`.
  version: '1.0'
  contact:
    name: Integrate.io Support
    url: https://www.integrate.io
servers:
  - url: https://{host}/api/public/v1
    variables:
      host:
        default: console.flydata.app
        description: >-
          API host. Confirm with the Integrate.io team; the API may instead be
          served from a dedicated host such as api.flydata.app. The public API
          lives under the /api/public/v1 base path.
security:
  - bearerAuth: []
tags:
  - name: Connector Types
    description: >-
      The source and destination types you can create, and the settings each
      takes.
  - name: Sources
    description: Create, test, and manage the sources pipelines read from.
  - name: Destinations
    description: Create, test, and manage the destinations pipelines write to.
  - name: Pipelines
    description: Manage ELT & CDC pipelines, their definitions, and their activity.
paths:
  /sources/{id}:
    parameters:
      - $ref: '#/components/parameters/ConnectionId'
    patch:
      tags:
        - Sources
      summary: Update a source
      description: >-
        Changes the source's name, settings, credentials, or tunnel. Send only
        the fields that change. New settings are tested before they are saved,
        and running pipelines that use the source are restarted.
      operationId: updateSource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectionUpdate'
      responses:
        '200':
          description: The updated source.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Connection'
        '400':
          $ref: '#/components/responses/ConnectionTestFailed'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  parameters:
    ConnectionId:
      name: id
      in: path
      required: true
      description: Source or destination ID.
      schema:
        type: integer
  schemas:
    ConnectionUpdate:
      type: object
      additionalProperties: false
      description: All fields are optional. Fields left out keep their saved values.
      properties:
        name:
          type: string
        tunnel_id:
          type: integer
          nullable: true
          description: Set to `null` to remove the tunnel.
        config:
          type: object
          description: >-
            Settings to change, merged into the saved settings. Leave out
            secrets that should not change rather than sending them empty.
          additionalProperties: true
    Connection:
      type: object
      description: A source or destination. Credentials are never returned.
      properties:
        id:
          type: integer
        identifier:
          type: string
        name:
          type: string
        type:
          type: string
          example: postgres
        variant:
          type: string
          example: default
        status:
          type: string
          enum:
            - active
            - errored
            - archived
        tunnel_id:
          type: integer
          description: SSH tunnel used to reach the connection, if any.
        config:
          type: object
          description: Non-secret settings, such as host, port, and database.
          additionalProperties: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - detail
        - code
      properties:
        detail:
          description: Human-readable message. For `invalid_request`, a list of problems.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        code:
          type: string
          description: Stable, machine-readable error code.
          example: not_found
    ConnectionTest:
      type: object
      properties:
        success:
          type: boolean
        checks:
          type: array
          items:
            $ref: '#/components/schemas/ConnectionCheck'
        message:
          type: string
          description: Set when the test failed before any check ran.
    ConnectionCheck:
      type: object
      properties:
        name:
          type: string
          example: Connect to database
        passed:
          type: boolean
        required:
          type: boolean
          description: >-
            A failed required check fails the test, unless it is `transient` or
            `overridden`.
        message:
          type: string
        transient:
          type: boolean
          description: >-
            The check failed for a temporary reason, such as the service being
            briefly unavailable. It doesn't fail the test; retrying usually
            passes.
        overridden:
          type: boolean
          description: >-
            The check failed but Integrate.io support has relaxed it for this
            account.
        error:
          type: object
          properties:
            code:
              type: integer
              description: The provider's HTTP status, when the check made a request.
            message:
              type: string
              description: The provider's reason for the failure.
  responses:
    ConnectionTestFailed:
      description: >-
        The connection test failed and nothing was saved. `code` is
        `connection_test_failed` and the checks are under `test`.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  test:
                    $ref: '#/components/schemas/ConnectionTest'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource does not exist, or it belongs to another account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        The resource is in a state that doesn't allow this, for example it is
        archived or still used by a pipeline.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer API key, prefixed with fdk_.

````

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