---
title: "Update a data source"
method: PUT
path: "/v1/data_sources/{data_source_id}"
tags: ["data_sources"]
---

# Update a data source

`PUT /v1/data_sources/{data_source_id}`

Update a data source.

Args:
    data_source_id: The ID of the data source to update.
    params: The data source to update.

Returns:
    The updated data source.

## Path parameters

- `data_source_id` string, uuid, required — The ID of the data source to update

## Request body

- union — The data source to update
  - NotionDataSourceCreateOrUpdateParams — Parameters for creating or updating a Notion data source.
    - `type` 'notion' — The type of data source to create
    - `name` string, required — The name of the data source
    - `metadata` unknown
    - `auth_params` union — The authentication parameters of the data source. Notion supports OAuth2 and API key.
      - OAuth2CreateOrUpdateParams — Base class for OAuth2 create or update parameters.
        - `type` 'oauth2'
      - ApiKeyCreateOrUpdateParams — Base class for API key create or update parameters.
        - `type` 'api_key'
        - `api_key` string, required — The API key
  - LinearDataSourceCreateOrUpdateParams — Parameters for creating or updating a Linear data source.
    - `type` 'linear' — The type of data source to create
    - `name` string, required — The name of the data source
    - `metadata` unknown
    - `auth_params` OAuth2CreateOrUpdateParams — Base class for OAuth2 create or update parameters.
      - `type` 'oauth2'

## Response `200`

The updated data source

- DataSource — Service-level representation of a data source.
  - `id` string, required — The ID of the data source
  - `created_at` string, date-time, required — The creation time of the data source
  - `updated_at` string, date-time, required — The last update time of the data source
  - `type` 'notion' | 'linear', required
  - `name` string, required — The name of the data source
  - `metadata` unknown, required
  - `auth_params` union, required — Authentication parameters
    - DataSourceOAuth2Params — Authentication parameters for a OAuth data source.
      - `type` 'oauth2'
      - `created_at` string, date-time — The timestamp when the OAuth2 credentials were created
      - `scope` string, nullable — The OAuth2 scope
      - `access_token` string, nullable — The OAuth2 access token
      - `refresh_token` string, nullable — The OAuth2 refresh token
      - `token_type` string, nullable — The OAuth2 token type
      - `expires_on` string, date-time, nullable — The OAuth2 token expiration timestamp
      - `additional_params` object, nullable — Additional parameters for the OAuth2 flow
    - DataSourceApiKeyParams — Authentication parameters for a API key data source.
      - `type` 'api_key'
      - `api_key` string, required — The API key
  - `object` 'data_source' — The type of the object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mixedbread/apis/mxbai-omni.md) · [All operations](https://skmtc.net/mixedbread/apis/mxbai-omni/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixedbread/mxbai-omni/versions/2eece97b5ae5/schema)
