---
title: "PATCH /api/user-source/{user_source_id}/"
method: PATCH
path: "/api/user-source/{user_source_id}/"
tags: ["User sources"]
---

# PATCH /api/user-source/{user_source_id}/

`PATCH /api/user-source/{user_source_id}/`

Updates an existing user_source.

## Path parameters

- `user_source_id` integer, required

## Headers

- `ClientSessionId` string, uuid

## Request body

- PatchedUserSourceUpdateUserSource — A serializer to update a user source.
  - `name` string
  - `integration_id` integer — The related integration id.
  - `auth_providers` AppAuthProviderBaseAppAuthProvider[] — Auth providers related to this user source.
    - union
      - LocalBaserowPasswordAppAuthProviderBaseAppAuthProvider — This serializer allow to set the type of an app_auth_provider and the app_auth_provider id before which we want to insert the new app_auth_provider.
        - `type` 'local_baserow_password' | 'saml' | 'openid_connect', required — * `local_baserow_password` - local_baserow_password * `saml` - saml * `openid_connect` - openid_connect
        - `user_source_id` integer, required
        - `domain` string, nullable — The email domain registered with this provider.
        - `password_field_id` integer, nullable — The id of the field to use as password for the user account.
      - SamlAppAuthProviderModelBaseAppAuthProvider — This serializer allow to set the type of an app_auth_provider and the app_auth_provider id before which we want to insert the new app_auth_provider.
        - `type` 'local_baserow_password' | 'saml' | 'openid_connect', required — * `local_baserow_password` - local_baserow_password * `saml` - saml * `openid_connect` - openid_connect
        - `user_source_id` integer, required
        - `domain` string, nullable — The email domain registered with this provider.
        - `metadata` string, required — The SAML metadata XML provided by the IdP.
        - `is_verified` boolean, required — Whether or not a user sign in correctly with this SAML provider.
        - `email_attr_key` string — The key in the SAML response that contains the email address of the user.
        - `first_name_attr_key` string — The key in the SAML response that contains the first name of the user.
        - `last_name_attr_key` string — The key in the SAML response that contains the last name of the user. If this is not set, the first name attr will be used as full name.
      - OpenIdConnectAppAuthProviderModelBaseAppAuthProvider — This serializer allow to set the type of an app_auth_provider and the app_auth_provider id before which we want to insert the new app_auth_provider.
        - `type` 'local_baserow_password' | 'saml' | 'openid_connect', required — * `local_baserow_password` - local_baserow_password * `saml` - saml * `openid_connect` - openid_connect
        - `user_source_id` integer, required
        - `domain` string, nullable — The email domain registered with this provider.
        - `name` string, required
        - `base_url` string, required — The provider base url.
        - `client_id` string, required — App ID, or consumer key
        - `secret` string, required — API secret, client secret, or consumer secret
        - `use_id_token` boolean — Whether to use the id_token instead of user_info endpoint to get user data
        - `email_attr_key` string — The name of the claim that contains the email address of the user.
        - `first_name_attr_key` string — The key in the OIDC response that contains the first name of the user.
        - `last_name_attr_key` string — The key in the OIDC response that contains the last name of the user. If empty in response, first name will be used.
  - `table_id` integer, nullable — The id of the Baserow table we want the data for.
  - `email_field_id` integer, nullable — The id of the field to use as email for the user account.
  - `name_field_id` integer, nullable — The id of the field that contains the user name.
  - `role_field_id` integer, nullable — The id of the field that contains the user role.

## Response `200`

- UserSourceUserSource — Basic user_source serializer mostly for returned values.
  - `id` integer, required
  - `uid` string, required — Unique id for this user source.
  - `application_id` integer, required
  - `integration_id` integer, nullable, required — The Integration used to establish the connection with the service.
  - `type` string, required — The type of the user_source.
  - `name` string, required
  - `order` string, decimal, required — Lowest first.
  - `auth_providers` AppAuthProviderAppAuthProvider[] — Auth providers related to this user source.
    - union
      - LocalBaserowPasswordAppAuthProviderAppAuthProvider — Basic app_auth_provider serializer mostly for returned values.
        - `type` string, required — The type of the app_auth_provider.
        - `id` integer, required
        - `domain` string, nullable — The email domain registered with this provider.
        - `password_field_id` integer, nullable — The id of the field to use as password for the user account.
      - SamlAppAuthProviderModelAppAuthProvider — Basic app_auth_provider serializer mostly for returned values.
        - `type` string, required — The type of the app_auth_provider.
        - `id` integer, required
        - `domain` string, nullable — The email domain registered with this provider.
        - `metadata` string, required — The SAML metadata XML provided by the IdP.
        - `is_verified` boolean, required — Whether or not a user sign in correctly with this SAML provider.
        - `email_attr_key` string — The key in the SAML response that contains the email address of the user.
        - `first_name_attr_key` string — The key in the SAML response that contains the first name of the user.
        - `last_name_attr_key` string — The key in the SAML response that contains the last name of the user. If this is not set, the first name attr will be used as full name.
      - OpenIdConnectAppAuthProviderModelAppAuthProvider — Basic app_auth_provider serializer mostly for returned values.
        - `type` string, required — The type of the app_auth_provider.
        - `id` integer, required
        - `domain` string, nullable — The email domain registered with this provider.
        - `name` string, required
        - `base_url` string, required — The provider base url.
        - `client_id` string, required — App ID, or consumer key
        - `secret` string, required — API secret, client secret, or consumer secret
        - `use_id_token` boolean — Whether to use the id_token instead of user_info endpoint to get user data
        - `email_attr_key` string — The name of the claim that contains the email address of the user.
        - `first_name_attr_key` string — The key in the OIDC response that contains the first name of the user.
        - `last_name_attr_key` string — The key in the OIDC response that contains the last name of the user. If empty in response, first name will be used.
  - `user_count` integer, required — The total number of users in the user source.
  - `user_count_updated_at` string, date-time, required — When the last user count took place.
  - `table_id` integer, nullable — The id of the Baserow table we want the data for.
  - `email_field_id` integer, nullable — The id of the field to use as email for the user account.
  - `name_field_id` integer, nullable — The id of the field that contains the user name.
  - `role_field_id` integer, nullable — The id of the field that contains the user role.

## Other responses

- `400`
- `404`

---

[API](https://skmtc.net/baserow/apis/baserow-api-spec.md) · [All operations](https://skmtc.net/baserow/apis/baserow-api-spec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/baserow/baserow-api-spec/versions/0c490e5b0c7f/schema)
