---
title: "Update a Source"
method: PUT
path: "/data_sources/{source_id}"
tags: ["Sources"]
---

# Update a Source

`PUT /data_sources/{source_id}`

## Request

- Base URL: `https://dataops.nexla.io/nexla-api`
- URL: `https://dataops.nexla.io/nexla-api/data_sources/{source_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/nexla/apis/nexla-rest-api/docs/data_sources/:source_id/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates a data source in the authenticated user's account. 

Depending on the type of source you want to update (`source_type`), properties like `source_config` and `data_credentials_id` will require appropriate configuration.

> Note: This method does not perform partial updating of `source_config`. The entire `source_config` object will be updated if this is added to the payload.

## Path parameters

- `source_id` integer, required

## Request body

- DataSource
  - `name` string
  - `description` string
  - `data_credentials_id` integer: __Credential ID__: Nexla data credential that contains all authentication information for this source. Note that this is not applicable for `file_upload`, `nexla_rest` and `email` sources but is required for all other connectors.
  - `stream_config` object: Field only used for ELT Vendor Endpoints
  - `source_type` string: __Connector Type__: Connector codename.
  - `code_container_id` integer: ID of code container to attach to this source.
  - `code_container` object: Code Container details that will be created and attached to this source. Note: you can't pass both `code_container` and `code_container_id` together, code_container_id will take priority.
    - `code` union
      - string
      - object
      - unknown[]
        - unknown
    - `name` string
    - `description` string
    - `resource_type` 'source' | 'source_custom'
    - `code_type` 'jolt_standard' | 'jolt_custom' | 'python' | 'python3' | 'javascript' | 'flink_sql' | 'spark_sql'
    - `code_encoding` 'none' | 'base64'
    - `code_config` object
    - `custom_config` object
    - `repo_type` 'embedded' | 'github'
    - `repo_config` object

## Response `200`

Success

- object
  - `id` integer
  - `owner` Owner
    - `id` integer
    - `full_name` string
    - `email` string, email
  - `org` Org
    - `id` integer
    - `name` string
    - `email_domain` string
    - `email` unknown
    - `client_identifier` unknown
  - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
  - `name` string
  - `description` unknown
  - `status` string
  - `data_sets` object[]
    - `version` integer
    - `id` integer
    - `owner_id` integer
    - `org_id` integer
    - `name` string
    - `description` string
    - `updated_at` string, date-time
    - `created_at` string, date-time
  - `ingest_method` string
  - `source_format` string
  - `source_config` object: The source configuration properties that were set as `source_config` in the payload-to-source create/update API calls.
  - `poll_schedule` unknown
  - `managed` boolean
  - `code_container_id` unknown
  - `source_type` string
  - `connector_type` string
  - `connector` object
    - `id` integer
    - `type` string
    - `connection_type` string
    - `name` string
    - `description` string
    - `nexset_api_compatible` boolean
  - `api_keys` unknown[]
    - unknown
  - `auto_generated` boolean
  - `data_credentials` object
    - `id` integer
    - `name` string
    - `description` string
    - `owner` Owner
      - `id` integer
      - `full_name` string
      - `email` string, email
    - `org` Org
      - `id` integer
      - `name` string
      - `email_domain` string
      - `email` unknown
      - `client_identifier` unknown
    - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
    - `credentials_version` string
    - `managed` boolean
    - `credentials_type` string
    - `connector` object
      - `id` integer
      - `type` string
      - `connection_type` string
      - `name` string
      - `description` string
      - `nexset_api_compatible` boolean
    - `api_keys` unknown[]
      - unknown
    - `credentials_non_secure_data` object
    - `verified_status` string
    - `verified_at` string, date-time
    - `copied_from_id` unknown
    - `updated_at` string, date-time
    - `created_at` string, date-time
    - `tags` unknown[]
      - unknown
  - `run_ids` object[]
    - `id` integer
    - `created_at` string, date-time
  - `copied_from_id` unknown
  - `updated_at` string, date-time
  - `created_at` string, date-time
  - `tags` unknown[]
    - unknown
  - `flow_type` string
  - `ingestion_mode` string

## Other responses

- `400`: Unauthorized

---

[API](https://skmtc.dev/nexla/apis/nexla-rest-api.md) - [All operations](https://skmtc.dev/nexla/apis/nexla-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nexla/apis/nexla-rest-api/revisions/ef02be92fe7b?raw)
