:doc:`AppSync <../../appsync>` / Client / update_api_key

**************
update_api_key
**************



.. py:method:: AppSync.Client.update_api_key(**kwargs)

  

  Updates an API key. You can update the key as long as it's not deleted.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateApiKey>`_  


  **Request Syntax**
  ::

    response = client.update_api_key(
        apiId='string',
        id='string',
        description='string',
        expires=123
    )
    
  :type apiId: string
  :param apiId: **[REQUIRED]** 

    The ID for the GraphQL API.

    

  
  :type id: string
  :param id: **[REQUIRED]** 

    The API key ID.

    

  
  :type description: string
  :param description: 

    A description of the purpose of the API key.

    

  
  :type expires: integer
  :param expires: 

    From the update time, the time after which the API key expires. The date is represented as seconds since the epoch. For more information, see .

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'apiKey': {
              'id': 'string',
              'description': 'string',
              'expires': 123,
              'deletes': 123
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **apiKey** *(dict) --* 

        The API key.

        
        

        - **id** *(string) --* 

          The API key ID.

          
        

        - **description** *(string) --* 

          A description of the purpose of the API key.

          
        

        - **expires** *(integer) --* 

          The time after which the API key expires. The date is represented as seconds since the epoch, rounded down to the nearest hour.

          
        

        - **deletes** *(integer) --* 

          The time after which the API key is deleted. The date is represented as seconds since the epoch, rounded down to the nearest hour.

          
    
  
  **Exceptions**
  
  *   :py:class:`AppSync.Client.exceptions.BadRequestException`

  
  *   :py:class:`AppSync.Client.exceptions.NotFoundException`

  
  *   :py:class:`AppSync.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`AppSync.Client.exceptions.LimitExceededException`

  
  *   :py:class:`AppSync.Client.exceptions.InternalFailureException`

  
  *   :py:class:`AppSync.Client.exceptions.ApiKeyValidityOutOfBoundsException`

  