---
title: "Update Cognito external user source"
method: PUT
path: "/resources/user-sources/v1/external/cognito/{id}"
tags: ["User sources (pools)"]
---

# Update Cognito external user source

`PUT /resources/user-sources/v1/external/cognito/{id}`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/user-sources/v1/external/cognito/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/user-sources/v1/external/cognito/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

This route updates an external user source. A vendor token is required for this route.

## Path parameters

- `id` string, required

## Request body

- UpdateExternalCognitoUserSourceRequestDTO
  - `name` string: The user source name
  - `configuration` ExternalCognitoUserSourceConfig
    - `syncOnLogin` boolean, required: Whether to sync user profile attributes on each login
    - `isMigrated` boolean, required: Whether to migrate the users
    - `region` string, required: The aws region of the cognito user pool
    - `clientId` string, required: The cognito app client id
    - `userPoolId` string, required: The id of the cognito user pool
    - `accessKeyId` string, required: The access key of the aws account
    - `secretAccessKey` string, required: The secret of the aws account
    - `clientSecret` string: The cognito application client secret, required if the app client is configured with a client secret
    - `tenantConfig` union, required
      - UserSourceDynamicTenantConfig
        - `tenantIdFieldName` string, required: The attribute name of which the tenant id would be taken from
        - `tenantResolverType` 'dynamic', required
      - UserSourceStaticTenantConfig
        - `tenantId` string, required: The tenant id which all of the users would be added to
        - `tenantResolverType` 'static', required
      - UserSourceNewTenantConfig
        - `tenantResolverType` 'new', required
  - `index` number: The user source index
  - `description` string: The user source description

## Response `200`

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
