Amazon Cognito Identity Provider

2025/08/20 - Amazon Cognito Identity Provider - 5 new api methods

Changes  This release adds support for the new Terms APIs which allow displaying Terms of Use and Privacy Policy on the Managed Login user-registration page.

DeleteTerms (new) Link ¶

Deletes the terms documents with the requested ID from your app client.

See also: AWS API Documentation

Request Syntax

client.delete_terms(
    TermsId='string',
    UserPoolId='string'
)
type TermsId:

string

param TermsId:

[REQUIRED]

The ID of the terms documents that you want to delete.

type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the terms documents that you want to delete.

returns:

None

UpdateTerms (new) Link ¶

Modifies existing terms documents for the requested app client. When Terms and conditions and Privacy policy documents are configured, the app client displays links to them in the sign-up page of managed login for the app client.

You can provide URLs for terms documents in the languages that are supported by managed login localization. Amazon Cognito directs users to the terms documents for their current language, with fallback to default if no document exists for the language.

Each request accepts one type of terms document and a map of language-to-link for that document type. You must provide both types of terms documents in at least one language before Amazon Cognito displays your terms documents. Supply each type in separate requests.

For more information, see Terms documents.

See also: AWS API Documentation

Request Syntax

client.update_terms(
    TermsId='string',
    UserPoolId='string',
    TermsName='string',
    TermsSource='LINK',
    Enforcement='NONE',
    Links={
        'string': 'string'
    }
)
type TermsId:

string

param TermsId:

[REQUIRED]

The ID of the terms document that you want to update.

type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the terms that you want to update.

type TermsName:

string

param TermsName:

The new name that you want to apply to the requested terms documents.

type TermsSource:

string

param TermsSource:

This parameter is reserved for future use and currently accepts only one value.

type Enforcement:

string

param Enforcement:

This parameter is reserved for future use and currently accepts only one value.

type Links:

dict

param Links:

A map of URLs to languages. For each localized language that will view the requested TermsName, assign a URL. A selection of cognito:default displays for all languages that don't have a language-specific URL.

For example, "cognito:default": "https://terms.example.com", "cognito:spanish": "https://terms.example.com/es".

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Terms': {
        'TermsId': 'string',
        'UserPoolId': 'string',
        'ClientId': 'string',
        'TermsName': 'string',
        'TermsSource': 'LINK',
        'Enforcement': 'NONE',
        'Links': {
            'string': 'string'
        },
        'CreationDate': datetime(2015, 1, 1),
        'LastModifiedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Terms (dict) --

      A summary of the updates to your terms documents.

      • TermsId (string) --

        The ID of the terms documents.

      • UserPoolId (string) --

        The ID of the user pool that contains the terms documents.

      • ClientId (string) --

        The ID of the app client that the terms documents are assigned to.

      • TermsName (string) --

        The type and friendly name of the terms documents.

      • TermsSource (string) --

        This parameter is reserved for future use and currently accepts one value.

      • Enforcement (string) --

        This parameter is reserved for future use and currently accepts one value.

      • Links (dict) --

        A map of URLs to languages. For each localized language that will view the requested TermsName, assign a URL. A selection of cognito:default displays for all languages that don't have a language-specific URL.

        For example, "cognito:default": "https://terms.example.com", "cognito:spanish": "https://terms.example.com/es".

        • (string) --

          • (string) --

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

ListTerms (new) Link ¶

Returns details about all terms documents for the requested user pool.

See also: AWS API Documentation

Request Syntax

client.list_terms(
    UserPoolId='string',
    MaxResults=123,
    NextToken='string'
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool where you want to list terms documents.

type MaxResults:

integer

param MaxResults:

The maximum number of terms documents that you want Amazon Cognito to return in the response.

type NextToken:

string

param NextToken:

This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.

rtype:

dict

returns:

Response Syntax

{
    'Terms': [
        {
            'TermsId': 'string',
            'TermsName': 'string',
            'Enforcement': 'NONE',
            'CreationDate': datetime(2015, 1, 1),
            'LastModifiedDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Terms (list) --

      A summary of the requested terms documents. Includes unique identifiers for later changes to the terms documents.

      • (dict) --

        The details of a set of terms documents. For more information, see Terms documents.

        • TermsId (string) --

          The ID of the requested terms documents.

        • TermsName (string) --

          The type and friendly name of the requested terms documents.

        • Enforcement (string) --

          This parameter is reserved for future use and currently accepts one value.

        • CreationDate (datetime) --

          The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

        • LastModifiedDate (datetime) --

          The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

    • NextToken (string) --

      This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.

DescribeTerms (new) Link ¶

Returns details for the requested terms documents ID. For more information, see Terms documents.

See also: AWS API Documentation

Request Syntax

client.describe_terms(
    TermsId='string',
    UserPoolId='string'
)
type TermsId:

string

param TermsId:

[REQUIRED]

The ID of the terms documents that you want to describe.

type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the terms documents that you want to describe.

rtype:

dict

returns:

Response Syntax

{
    'Terms': {
        'TermsId': 'string',
        'UserPoolId': 'string',
        'ClientId': 'string',
        'TermsName': 'string',
        'TermsSource': 'LINK',
        'Enforcement': 'NONE',
        'Links': {
            'string': 'string'
        },
        'CreationDate': datetime(2015, 1, 1),
        'LastModifiedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Terms (dict) --

      A summary of the requested terms documents. Includes a unique identifier for later changes to the terms documents.

      • TermsId (string) --

        The ID of the terms documents.

      • UserPoolId (string) --

        The ID of the user pool that contains the terms documents.

      • ClientId (string) --

        The ID of the app client that the terms documents are assigned to.

      • TermsName (string) --

        The type and friendly name of the terms documents.

      • TermsSource (string) --

        This parameter is reserved for future use and currently accepts one value.

      • Enforcement (string) --

        This parameter is reserved for future use and currently accepts one value.

      • Links (dict) --

        A map of URLs to languages. For each localized language that will view the requested TermsName, assign a URL. A selection of cognito:default displays for all languages that don't have a language-specific URL.

        For example, "cognito:default": "https://terms.example.com", "cognito:spanish": "https://terms.example.com/es".

        • (string) --

          • (string) --

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

CreateTerms (new) Link ¶

Creates terms documents for the requested app client. When Terms and conditions and Privacy policy documents are configured, the app client displays links to them in the sign-up page of managed login for the app client.

You can provide URLs for terms documents in the languages that are supported by managed login localization. Amazon Cognito directs users to the terms documents for their current language, with fallback to default if no document exists for the language.

Each request accepts one type of terms document and a map of language-to-link for that document type. You must provide both types of terms documents in at least one language before Amazon Cognito displays your terms documents. Supply each type in separate requests.

For more information, see Terms documents.

See also: AWS API Documentation

Request Syntax

client.create_terms(
    UserPoolId='string',
    ClientId='string',
    TermsName='string',
    TermsSource='LINK',
    Enforcement='NONE',
    Links={
        'string': 'string'
    }
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool where you want to create terms documents.

type ClientId:

string

param ClientId:

[REQUIRED]

The ID of the app client where you want to create terms documents. Must be an app client in the requested user pool.

type TermsName:

string

param TermsName:

[REQUIRED]

A friendly name for the document that you want to create in the current request. Must begin with terms-of-use or privacy-policy as identification of the document type. Provide URLs for both terms-of-use and privacy-policy in separate requests.

type TermsSource:

string

param TermsSource:

[REQUIRED]

This parameter is reserved for future use and currently accepts only one value.

type Enforcement:

string

param Enforcement:

[REQUIRED]

This parameter is reserved for future use and currently accepts only one value.

type Links:

dict

param Links:

A map of URLs to languages. For each localized language that will view the requested TermsName, assign a URL. A selection of cognito:default displays for all languages that don't have a language-specific URL.

For example, "cognito:default": "https://terms.example.com", "cognito:spanish": "https://terms.example.com/es".

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Terms': {
        'TermsId': 'string',
        'UserPoolId': 'string',
        'ClientId': 'string',
        'TermsName': 'string',
        'TermsSource': 'LINK',
        'Enforcement': 'NONE',
        'Links': {
            'string': 'string'
        },
        'CreationDate': datetime(2015, 1, 1),
        'LastModifiedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Terms (dict) --

      A summary of your terms documents. Includes a unique identifier for later changes to the terms documents.

      • TermsId (string) --

        The ID of the terms documents.

      • UserPoolId (string) --

        The ID of the user pool that contains the terms documents.

      • ClientId (string) --

        The ID of the app client that the terms documents are assigned to.

      • TermsName (string) --

        The type and friendly name of the terms documents.

      • TermsSource (string) --

        This parameter is reserved for future use and currently accepts one value.

      • Enforcement (string) --

        This parameter is reserved for future use and currently accepts one value.

      • Links (dict) --

        A map of URLs to languages. For each localized language that will view the requested TermsName, assign a URL. A selection of cognito:default displays for all languages that don't have a language-specific URL.

        For example, "cognito:default": "https://terms.example.com", "cognito:spanish": "https://terms.example.com/es".

        • (string) --

          • (string) --

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.