CognitoIdentityProvider / Client / create_terms
create_terms¶
- CognitoIdentityProvider.Client.create_terms(**kwargs)¶
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.
Note
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
See also: AWS API Documentation
Request Syntax
response = client.create_terms( UserPoolId='string', ClientId='string', TermsName='string', TermsSource='LINK', Enforcement='NONE', Links={ 'string': 'string' } )
- Parameters:
UserPoolId (string) –
[REQUIRED]
The ID of the user pool where you want to create terms documents.
ClientId (string) –
[REQUIRED]
The ID of the app client where you want to create terms documents. Must be an app client in the requested user pool.
TermsName (string) –
[REQUIRED]
A friendly name for the document that you want to create in the current request. Must begin with
terms-of-use
orprivacy-policy
as identification of the document type. Provide URLs for bothterms-of-use
andprivacy-policy
in separate requests.TermsSource (string) –
[REQUIRED]
This parameter is reserved for future use and currently accepts only one value.
Enforcement (string) –
[REQUIRED]
This parameter is reserved for future use and currently accepts only 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 ofcognito: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) –
- Return type:
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 ofcognito: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.
Exceptions
CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException
CognitoIdentityProvider.Client.exceptions.ConcurrentModificationException
CognitoIdentityProvider.Client.exceptions.TermsExistsException
CognitoIdentityProvider.Client.exceptions.InvalidParameterException
CognitoIdentityProvider.Client.exceptions.TooManyRequestsException
CognitoIdentityProvider.Client.exceptions.NotAuthorizedException
CognitoIdentityProvider.Client.exceptions.LimitExceededException
CognitoIdentityProvider.Client.exceptions.InternalErrorException