

# Previous low-level DynamoDB API version (2011-12-05)
<a name="Appendix.APIv20111205"></a>

This section documents the operations available in the previous DynamoDB low-level API version (2011-12-05). This version of the low-level API is maintained for backward compatibility with existing applications.

**New applications should use the current API version (2012-08-10)**. For more information, see [DynamoDB API reference](CurrentAPI.md).

**Note**  
We recommend that you migrate your applications to the latest API version (2012-08-10), since new DynamoDB features will not be backported to the previous API version.

**Topics**
+ [BatchGetItem](API_BatchGetItem_v20111205.md)
+ [BatchWriteItem](API_BatchWriteItem_v20111205.md)
+ [CreateTable](API_CreateTable_v20111205.md)
+ [DeleteItem](API_DeleteItem_v20111205.md)
+ [DeleteTable](API_DeleteTable_v20111205.md)
+ [DescribeTables](API_DescribeTables_v20111205.md)
+ [GetItem](API_GetItem_v20111205.md)
+ [ListTables](API_ListTables_v20111205.md)
+ [PutItem](API_PutItem_v20111205.md)
+ [Query](API_Query_v20111205.md)
+ [Scan](API_Scan_v20111205.md)
+ [UpdateItem](API_UpdateItem_v20111205.md)
+ [UpdateTable](API_UpdateTable_v20111205.md)

# BatchGetItem
<a name="API_BatchGetItem_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_BatchGetItem_Description"></a>

The `BatchGetItem` operation returns the attributes for multiple items from multiple tables using their primary keys. The maximum number of items that can be retrieved for a single operation is 100. Also, the number of items retrieved is constrained by a 1 MB size limit. If the response size limit is exceeded or a partial result is returned because the table’s provisioned throughput is exceeded, or because of an internal processing failure, DynamoDB returns an `UnprocessedKeys` value so you can retry the operation starting with the next item to get. DynamoDB automatically adjusts the number of items returned per page to enforce this limit. For example, even if you ask to retrieve 100 items, but each individual item is 50 KB in size, the system returns 20 items and an appropriate `UnprocessedKeys` value so you can get the next page of results. If desired, your application can include its own logic to assemble the pages of results into one set.

If no items could be processed because of insufficient provisioned throughput on each of the tables involved in the request, DynamoDB returns a `ProvisionedThroughputExceededException` error. 

**Note**  
By default, `BatchGetItem` performs eventually consistent reads on every table in the request. You can set the `ConsistentRead` parameter to `true`, on a per-table basis, if you want consistent reads instead.  
`BatchGetItem` fetches items in parallel to minimize response latencies.  
When designing your application, keep in mind that DynamoDB does not guarantee how attributes are ordered in the returned response. Include the primary key values in the `AttributesToGet` for the items in your request to help parse the response by item.   
If the requested items do not exist, nothing is returned in the response for those items. Requests for non-existent items consume the minimum read capacity units according to the type of read. For more information, see [DynamoDB item sizes and formats](CapacityUnitCalculations.md).

## Requests
<a name="API_BatchGetItem_RequestParameters"></a>

### Syntax
<a name="API_BatchGetItem_RequestParameters.syntax"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.BatchGetItem 
content-type: application/x-amz-json-1.0 

{"RequestItems":
    {"Table1": 
        {"Keys": 
            [{"HashKeyElement": {"S":"KeyValue1"}, "RangeKeyElement":{"N":"KeyValue2"}},
            {"HashKeyElement": {"S":"KeyValue3"}, "RangeKeyElement":{"N":"KeyValue4"}},
            {"HashKeyElement": {"S":"KeyValue5"}, "RangeKeyElement":{"N":"KeyValue6"}}],
        "AttributesToGet":["AttributeName1", "AttributeName2", "AttributeName3"]},
    "Table2": 
        {"Keys": 
            [{"HashKeyElement": {"S":"KeyValue4"}}, 
            {"HashKeyElement": {"S":"KeyValue5"}}],
        "AttributesToGet": ["AttributeName4", "AttributeName5", "AttributeName6"]
        }
    }
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  RequestItems  | A container of the table name and corresponding items to get by primary key. While requesting items, each table name can be invoked only once per operation.Type: String Default: None  |  Yes | 
| Table |  The name of the table containing the items to get. The entry is simply a string specifying an existing table with no label. Type: String  Default: None   | Yes | 
| Table:Keys  |  The primary key values that define the items in the specified table. For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey). Type: Keys   | Yes | 
| Table:AttributesToGet  |  Array of Attribute names within the specified table. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.  Type: Array   | No | 
| Table:ConsistentRead  |  If set to `true`, then a consistent read is issued, otherwise eventually consistent is used. Type: Boolean   | No | 

## Responses
<a name="API_BatchGetItem_ResponseElements"></a>

### Syntax
<a name="API_BatchGetItem_ResponseElements.syntax"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375
content-type: application/x-amz-json-1.0 
content-length: 855

{"Responses":
    {"Table1":
        {"Items":
        [{"AttributeName1": {"S":"AttributeValue"},
        "AttributeName2": {"N":"AttributeValue"},
        "AttributeName3": {"SS":["AttributeValue", "AttributeValue", "AttributeValue"]}
        },
        {"AttributeName1": {"S": "AttributeValue"},
        "AttributeName2": {"S": "AttributeValue"},
        "AttributeName3": {"NS": ["AttributeValue", "AttributeValue", "AttributeValue"]}
        }],
    "ConsumedCapacityUnits":1},
    "Table2": 
        {"Items":
        [{"AttributeName1": {"S":"AttributeValue"},
        "AttributeName2": {"N":"AttributeValue"},
        "AttributeName3": {"SS":["AttributeValue", "AttributeValue", "AttributeValue"]}
        },
        {"AttributeName1": {"S": "AttributeValue"},
        "AttributeName2": {"S": "AttributeValue"},
        "AttributeName3": {"NS": ["AttributeValue", "AttributeValue","AttributeValue"]}
        }],
    "ConsumedCapacityUnits":1}
    },
    "UnprocessedKeys":
        {"Table3": 
        {"Keys": 
            [{"HashKeyElement": {"S":"KeyValue1"}, "RangeKeyElement":{"N":"KeyValue2"}},
            {"HashKeyElement": {"S":"KeyValue3"}, "RangeKeyElement":{"N":"KeyValue4"}},
            {"HashKeyElement": {"S":"KeyValue5"}, "RangeKeyElement":{"N":"KeyValue6"}}],
        "AttributesToGet":["AttributeName1", "AttributeName2", "AttributeName3"]}
        }
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
| Responses  | Table names and the respective item attributes from the tables.Type: Map  | 
| Table |  The name of the table containing the items. The entry is simply a string specifying the table with no label.Type: String  | 
| Items  | Container for the attribute names and values meeting the operation parameters.Type: Map of attribute names to and their data types and values. | 
| ConsumedCapacityUnits | The number of read capacity units consumed, for each table. This value shows the number applied toward your provisioned throughput. Requests for non-existent items consume the minimum read capacity units, depending on the type of read. For more information see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Number | 
| UnprocessedKeys | Contains an array of tables and their respective keys that were not processed with the current response, possibly due to reaching a limit on the response size. The `UnprocessedKeys` value is in the same form as a `RequestItems` parameter (so the value can be provided directly to a subsequent `BatchGetItem` operation). For more information, see the above `RequestItems` parameter.Type: Array  | 
| UnprocessedKeys: Table: Keys  | The primary key attribute values that define the items and the attributes associated with the items. For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey) .Type: Array of attribute name-value pairs.  | 
| UnprocessedKeys: Table: AttributesToGet  |  Attribute names within the specified table. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.  Type: Array of attribute names.  | 
| UnprocessedKeys: Table: ConsistentRead  |  If set to `true`, then a consistent read is used for the specified table, otherwise an eventually consistent read is used. Type: Boolean.  | 

## Special errors
<a name="API_BatchGetItem_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
| ProvisionedThroughputExceededException  | Your maximum allowed provisioned throughput has been exceeded.  | 

## Examples
<a name="API_BatchGetItem_Examples"></a>

The following examples show an HTTP POST request and response using the BatchGetItem operation. For examples using the AWS SDK, see [Working with items and attributes in DynamoDB](WorkingWithItems.md).

### Sample request
<a name="API_BatchGetItem_Examples_Request"></a>

The following sample requests attributes from two different tables.

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.BatchGetItem 
content-type: application/x-amz-json-1.0 
content-length: 409

{"RequestItems":
    {"comp1":
        {"Keys":
            [{"HashKeyElement":{"S":"Casey"},"RangeKeyElement":{"N":"1319509152"}},
            {"HashKeyElement":{"S":"Dave"},"RangeKeyElement":{"N":"1319509155"}},
            {"HashKeyElement":{"S":"Riley"},"RangeKeyElement":{"N":"1319509158"}}],
        "AttributesToGet":["user","status"]},
    "comp2":
        {"Keys":
            [{"HashKeyElement":{"S":"Julie"}},{"HashKeyElement":{"S":"Mingus"}}],
        "AttributesToGet":["user","friends"]}
    }
}
```

### Sample response
<a name="API_BatchGetItem_Examples_Response"></a>

The following sample is the response.

```
HTTP/1.1 200 OK
x-amzn-RequestId: GTPQVRM4VJS792J1UFJTKUBVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0 
content-length: 373
Date: Fri, 02 Sep 2011 23:07:39 GMT

{"Responses":
    {"comp1":
        {"Items":
            [{"status":{"S":"online"},"user":{"S":"Casey"}},
            {"status":{"S":"working"},"user":{"S":"Riley"}},
            {"status":{"S":"running"},"user":{"S":"Dave"}}],
        "ConsumedCapacityUnits":1.5},
    "comp2":
        {"Items":
            [{"friends":{"SS":["Elisabeth", "Peter"]},"user":{"S":"Mingus"}},
            {"friends":{"SS":["Dave", "Peter"]},"user":{"S":"Julie"}}],
        "ConsumedCapacityUnits":1}
    },
    "UnprocessedKeys":{}
}
```

# BatchWriteItem
<a name="API_BatchWriteItem_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_BatchWriteItems_Description"></a>

This operation enables you to put or delete several items across multiple tables in a single call. 

To upload one item, you can use `PutItem`, and to delete one item, you can use `DeleteItem`. However, when you want to upload or delete large amounts of data, such as uploading large amounts of data from Amazon EMR (Amazon EMR) or migrating data from another database in to DynamoDB, `BatchWriteItem` offers an efficient alternative. 

If you use languages such as Java, you can use threads to upload items in parallel. This adds complexity in your application to handle the threads. Other languages don't support threading. For example, if you are using PHP, you must upload or delete items one at a time. In both situations, `BatchWriteItem` provides an alternative where the specified put and delete operations are processed in parallel, giving you the power of the thread pool approach without having to introduce complexity in your application. 

Note that each individual put and delete specified in a `BatchWriteItem` operation costs the same in terms of consumed capacity units. However, because `BatchWriteItem` performs the specified operations in parallel, you get lower latency. Delete operations on non-existent items consume 1 write capacity unit. For more information about consumed capacity units, see [Working with tables and data in DynamoDB](WorkingWithTables.md).

When using `BatchWriteItem`, note the following limitations:
+ **Maximum operations in a single request—**You can specify a total of up to 25 put or delete operations; however, the total request size cannot exceed 1 MB (the HTTP payload). 
+ You can use the `BatchWriteItem` operation only to put and delete items. You cannot use it to update existing items.
+ **Not an atomic operation—**Individual operations specified in a `BatchWriteItem` are atomic; however `BatchWriteItem` as a whole is a "best-effort" operation and not an atomic operation. That is, in a `BatchWriteItem` request, some operations might succeed and others might fail. The failed operations are returned in an `UnprocessedItems` field in the response. Some of these failures might be because you exceeded the provisioned throughput configured for the table or a transient failure such as a network error. You can investigate and optionally resend the requests. Typically, you call `BatchWriteItem` in a loop and in each iteration check for unprocessed items, and submit a new `BatchWriteItem` request with those unprocessed items. 
+ **Does not return any items—**The `BatchWriteItem` is designed for uploading large amounts of data efficiently. It does not provide some of the sophistication offered by `PutItem` and `DeleteItem`. For example, `DeleteItem` supports the `ReturnValues` field in your request body to request the deleted item in the response. The `BatchWriteItem` operation does not return any items in the response.
+ Unlike `PutItem` and `DeleteItem`, `BatchWriteItem` does not allow you to specify conditions on individual write requests in the operation.
+ Attribute values must not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests that have empty values will be rejected with a `ValidationException`.

DynamoDB rejects the entire batch write operation if any one of the following is true: 
+ If one or more tables specified in the `BatchWriteItem` request does not exist.
+ If primary key attributes specified on an item in the request does not match the corresponding table's primary key schema.
+ If you try to perform multiple operations on the same item in the same `BatchWriteItem` request. For example, you cannot put and delete the same item in the same `BatchWriteItem` request. 
+ If the total request size exceeds the 1 MB request size (the HTTP payload) limit.
+ If any individual item in a batch exceeds the 64 KB item size limit.

## Requests
<a name="API_BatchWriteItems_RequestParameters"></a>

### Syntax
<a name="API_BatchWriteItems_RequestParameters.syntax"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1
x-amz-target: DynamoDB_20111205.BatchGetItem 
content-type: application/x-amz-json-1.0 

{
  "RequestItems" :  RequestItems
} 

RequestItems
{
     "TableName1" :  [ Request, Request, ... ],
     "TableName2" :  [ Request, Request, ... ],
     ...
}

Request ::=
  PutRequest | DeleteRequest

PutRequest ::=
{
  "PutRequest" : {
     "Item" : {
        "Attribute-Name1" : Attribute-Value,
        "Attribute-Name2" : Attribute-Value,
         ...
     }
  }
}

DeleteRequest ::=
{
   "DeleteRequest" : {
      "Key" : PrimaryKey-Value
   }
}


PrimaryKey-Value ::= HashTypePK | HashAndRangeTypePK

HashTypePK ::=
{ 
   "HashKeyElement" : Attribute-Value
}

HashAndRangeTypePK
{ 
   "HashKeyElement" : Attribute-Value,
   "RangeKeyElement" : Attribute-Value, 
}

Attribute-Value ::= String | Numeric| Binary | StringSet | NumericSet | BinarySet 

Numeric ::=
{
   "N": "Number"
}

String ::=
{
   "S": "String"
}

Binary ::=
{
    "B": "Base64 encoded binary data"
}

StringSet ::=
{
   "SS": [ "String1", "String2", ... ]
}

NumberSet ::=
{
   "NS": [ "Number1", "Number2", ... ]
}  

BinarySet ::=
{
   "BS": [ "Binary1", "Binary2", ... ]
}
```

In the request body, the `RequestItems` JSON object describes the operations that you want to perform. The operations are grouped by tables. You can use `BatchWriteItem` to update or delete several items across multiple tables. For each specific write request, you must identify the type of request (`PutItem`, `DeleteItem`) followed by detail information about the operation. 
+ For a `PutRequest`, you provide the item, that is, a list of attributes and their values.
+ For a `DeleteRequest`, you provide the primary key name and value. 

## Responses
<a name="API_BatchWriteItems_ResponseElements"></a>

### Syntax
<a name="API_BatchWriteItems_ResponseElements.syntax"></a>

The following is the syntax of the JSON body returned in the response.

```
{
  "Responses" :         ConsumedCapacityUnitsByTable
  "UnprocessedItems" :  RequestItems
} 

ConsumedCapacityUnitsByTable
{
    "TableName1" : { "ConsumedCapacityUnits", : NumericValue },
    "TableName2" : { "ConsumedCapacityUnits", : NumericValue },
     ...
}

RequestItems
This syntax is identical to the one described in the JSON syntax in the request.
```

## Special errors
<a name="API_BatchWriteItems_SpecialErrors"></a>

No errors specific to this operation.

## Examples
<a name="API_BatchWriteItems_Examples"></a>

The following example shows an HTTP POST request and the response of a `BatchWriteItem` operation. The request specifies the following operations on the Reply and the Thread tables:
+ Put an item and delete an item from the Reply table
+ Put an item into the Thread table

For examples using the AWS SDK, see [Working with items and attributes in DynamoDB](WorkingWithItems.md).

### Sample request
<a name="API_BatchWriteItems_Examples_Request"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1
x-amz-target: DynamoDB_20111205.BatchGetItem 
content-type: application/x-amz-json-1.0 

{
  "RequestItems":{
    "Reply":[
      {
        "PutRequest":{
          "Item":{
            "ReplyDateTime":{
              "S":"2012-04-03T11:04:47.034Z"
            },
            "Id":{
              "S":"DynamoDB#DynamoDB Thread 5"
            }
          }
        }
      },
      {
        "DeleteRequest":{
          "Key":{
            "HashKeyElement":{
              "S":"DynamoDB#DynamoDB Thread 4"
            },
            "RangeKeyElement":{
              "S":"oops - accidental row"
            }
          }
        }
      }
    ],
    "Thread":[
      {
        "PutRequest":{
          "Item":{
            "ForumName":{
              "S":"DynamoDB"
            },
            "Subject":{
              "S":"DynamoDB Thread 5"
            }
          }
        }
      }
    ]
  }
}
```

### Sample response
<a name="API_BatchWriteItems_Examples_Response"></a>

The following example response shows a put operation on both the Thread and Reply tables succeeded and a delete operation on the Reply table failed (for reasons such as throttling that is caused when you exceed the provisioned throughput on the table). Note the following in the JSON response:
+ The `Responses` object shows one capacity unit was consumed on both the `Thread` and `Reply` tables as a result of the successful put operation on each of these tables. 
+ The `UnprocessedItems` object shows the unsuccessful delete operation on the `Reply` table. You can then issue a new `BatchWriteItem` call to address these unprocessed requests.

```
HTTP/1.1 200 OK
x-amzn-RequestId: G8M9ANLOE5QA26AEUHJKJE0ASBVV4KQNSO5AEMVJF66Q9ASUAAJG
Content-Type: application/x-amz-json-1.0
Content-Length: 536
Date: Thu, 05 Apr 2012 18:22:09 GMT

{
   "Responses":{
      "Thread":{
         "ConsumedCapacityUnits":1.0
      },
      "Reply":{
         "ConsumedCapacityUnits":1.0
      }
   },
   "UnprocessedItems":{
      "Reply":[
         {
            "DeleteRequest":{
               "Key":{
                  "HashKeyElement":{
                     "S":"DynamoDB#DynamoDB Thread 4"
                  },
                  "RangeKeyElement":{
                     "S":"oops - accidental row"
                  }
               }
            }
         }
      ]
   }
}
```

# CreateTable
<a name="API_CreateTable_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_CreateTable_Description"></a>

The `CreateTable` operation adds a new table to your account.

The table name must be unique among those associated with the AWS Account issuing the request, and the AWS region that receives the request (such as dynamodb.us-west-2.amazonaws.com). Each DynamoDB endpoint is entirely independent. For example, if you have two tables called "MyTable," one in dynamodb.us-west-2.amazonaws.com and one in dynamodb.us-west-1.amazonaws.com, they are completely independent and do not share any data.

The `CreateTable` operation triggers an asynchronous workflow to begin creating the table. DynamoDB immediately returns the state of the table (`CREATING`) until the table is in the `ACTIVE` state. Once the table is in the `ACTIVE` state, you can perform data plane operations. 

Use the [DescribeTables](API_DescribeTables_v20111205.md) operation to check the status of the table. 

## Requests
<a name="API_CreateTable_RequestParameters"></a>

### Syntax
<a name="API_CreateTable_RequestParameters.syntax"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.CreateTable 
content-type: application/x-amz-json-1.0 

{"TableName":"Table1",
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"AttributeName1","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"AttributeName2","AttributeType":"N"}},
    "ProvisionedThroughput":{"ReadCapacityUnits":5,"WriteCapacityUnits":10}
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table to create.Allowed characters are a-z, A-Z, 0-9, '\$1' (underscore), '-' (dash), and '.' (dot). Names can be between 3 and 255 characters long. Type: String  |  Yes  | 
|  KeySchema  | The primary key (simple or composite) structure for the table. A name-value pair for the `HashKeyElement` is required, and a name-value pair for the `RangeKeyElement` is optional (only required for composite primary keys). For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey).Primary key element names can be between 1 and 255 characters long with no character restrictions. Possible values for the AttributeType are "S" (string), "N" (numeric), or "B" (binary).Type: Map of `HashKeyElement`, or `HashKeyElement` and `RangeKeyElement` for a composite primary key. | Yes | 
|  ProvisionedThroughput  | New throughput for the specified table, consisting of values for ReadCapacityUnits and WriteCapacityUnits. For details, see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md).  For current maximum/minimum values, see [Quotas in Amazon DynamoDB](ServiceQuotas.md). Type: Array  | Yes | 
| ProvisionedThroughput: ReadCapacityUnits |  Sets the minimum number of consistent `ReadCapacityUnits` consumed per second for the specified table before DynamoDB balances the load with other operations.  Eventually consistent read operations require less effort than a consistent read operation, so a setting of 50 consistent `ReadCapacityUnits` per second provides 100 eventually consistent `ReadCapacityUnits` per second. Type: Number  | Yes | 
| ProvisionedThroughput: WriteCapacityUnits | Sets the minimum number of WriteCapacityUnits consumed per second for the specified table before DynamoDB balances the load with other operations. Type: Number  | Yes | 

## Responses
<a name="API_CreateTable_CommonResponseElements"></a>

### Syntax
<a name="API_CreateTable_CommonResponseElements.syntax"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 311
Date: Tue, 12 Jul 2011 21:31:03 GMT

{"TableDescription":
    {"CreationDateTime":1.310506263362E9,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"AttributeName1","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"AttributeName2","AttributeType":"N"}},
    "ProvisionedThroughput":{"ReadCapacityUnits":5,"WriteCapacityUnits":10},
    "TableName":"Table1",
    "TableStatus":"CREATING"
    }
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
| TableDescription  | A container for the table properties. | 
| CreationDateTime | Date when the table was created in [UNIX epoch time](http://www.epochconverter.com/).Type: Number | 
| KeySchema  | The primary key (simple or composite) structure for the table. A name-value pair for the `HashKeyElement` is required, and a name-value pair for the `RangeKeyElement` is optional (only required for composite primary keys). For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey) .Type: Map of `HashKeyElement`, or `HashKeyElement` and `RangeKeyElement` for a composite primary key. | 
| ProvisionedThroughput  |  Throughput for the specified table, consisting of values for `ReadCapacityUnits` and `WriteCapacityUnits`. See [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Array   | 
| ProvisionedThroughput :ReadCapacityUnits |  The minimum number of `ReadCapacityUnits` consumed per second before DynamoDB. balances the load with other operationsType: Number  | 
| ProvisionedThroughput :WriteCapacityUnits |  The minimum number of `ReadCapacityUnits` consumed per second before `WriteCapacityUnits`. balances the load with other operationsType: Number  | 
|  TableName  |  The name of the created table. Type: String  | 
|  TableStatus  | The current state of the table (`CREATING`). Once the table is in the `ACTIVE` state, you can put data in it.Use the [DescribeTables](API_DescribeTables_v20111205.md) API to check the status of the table.Type: String | 

## Special errors
<a name="API_CreateTable_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
|  ResourceInUseException  | Attempt to recreate an already existing table. | 
|  LimitExceededException  | The number of simultaneous table requests (cumulative number of tables in the `CREATING`, `DELETING` or `UPDATING` state) exceeds the maximum allowed. For current maximum/minimum values, see [Quotas in Amazon DynamoDB](ServiceQuotas.md). .  | 

## Examples
<a name="API_CreateTable_Examples"></a>

The following example creates a table with a composite primary key containing a string and a number. For examples using the AWS SDK, see [Working with tables and data in DynamoDB](WorkingWithTables.md).

### Sample request
<a name="API_CreateTable_Examples_Request"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.CreateTable 
content-type: application/x-amz-json-1.0


{"TableName":"comp-table",
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"user","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"time","AttributeType":"N"}},
    "ProvisionedThroughput":{"ReadCapacityUnits":5,"WriteCapacityUnits":10}
}
```

### Sample response
<a name="API_CreateTable_Examples_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 311
Date: Tue, 12 Jul 2011 21:31:03 GMT

{"TableDescription":
    {"CreationDateTime":1.310506263362E9,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"user","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"time","AttributeType":"N"}},
    "ProvisionedThroughput":{"ReadCapacityUnits":5,"WriteCapacityUnits":10},
    "TableName":"comp-table",
    "TableStatus":"CREATING"
    }
}
```

## Related actions
<a name="API_CreateTable_Related_Actions"></a>
+  [DescribeTables](API_DescribeTables_v20111205.md) 
+  [DeleteTable](API_DeleteTable_v20111205.md)

# DeleteItem
<a name="API_DeleteItem_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_DeleteItem_Description"></a>

Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the item if it exists, or if it has an expected attribute value.

**Note**  
If you specify `DeleteItem` without attributes or values, all the attributes for the item are deleted.   
Unless you specify conditions, the `DeleteItem` is an idempotent operation; running it multiple times on the same item or attribute does *not* result in an error response.  
Conditional deletes are useful for only deleting items and attributes if specific conditions are met. If the conditions are met, DynamoDB performs the delete. Otherwise, the item is not deleted.   
You can perform the expected conditional check on one attribute per operation.

## Requests
<a name="API_DeleteItem_RequestParameters"></a>

### Syntax
<a name="API_DeleteItem_RequestParameters.syntax"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.DeleteItem 
content-type: application/x-amz-json-1.0 

{"TableName":"Table1",
    "Key":
        {"HashKeyElement":{"S":"AttributeValue1"},"RangeKeyElement":{"N":"AttributeValue2"}},
    "Expected":{"AttributeName3":{"Value":{"S":"AttributeValue3"}}},
    "ReturnValues":"ALL_OLD"}
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table containing the item to delete. Type: String  |  Yes  | 
|  Key  | The primary key that defines the item. For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey).Type: Map of `HashKeyElement` to its value and `RangeKeyElement` to its value. | Yes | 
| Expected  | Designates an attribute for a conditional delete. The `Expected` parameter allows you to provide an attribute name, and whether or not DynamoDB should check to see if the attribute has a particular value before deleting it.Type: Map of attribute names. | No | 
| Expected:AttributeName  | The name of the attribute for the conditional put. Type: String | No | 
| Expected:AttributeName: ExpectedAttributeValue | Use this parameter to specify whether or not a value already exists for the attribute name-value pair. The following JSON notation deletes the item if the "Color" attribute doesn't exist for that item:<pre>"Expected" :<br />	{"Color":{"Exists":false}}</pre>The following JSON notation checks to see if the attribute with name "Color" has an existing value of "Yellow" before deleting the item: <pre>"Expected" : <br />	{"Color":{"Exists":true},{"Value":{"S":"Yellow"}}}</pre>By default, if you use the `Expected` parameter and provide a `Value`, DynamoDB assumes the attribute exists and has a current value to be replaced. So you don't have to specify `{"Exists":true}`, because it is implied. You can shorten the request to:<pre>"Expected" : <br />	{"Color":{"Value":{"S":"Yellow"}}}</pre> If you specify `{"Exists":true}` without an attribute value to check, DynamoDB returns an error.  | No | 
| ReturnValues  | Use this parameter if you want to get the attribute name-value pairs before they were deleted. Possible parameter values are `NONE` (default) or `ALL_OLD`. If `ALL_OLD` is specified, the content of the old item is returned. If this parameter is not provided or is `NONE`, nothing is returned.Type: String | No | 

## Responses
<a name="API_DeleteItem_CommonResponseElements"></a>

### Syntax
<a name="API_DeleteItem_CommonResponseElements.syntax"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 353
Date: Tue, 12 Jul 2011 21:31:03 GMT

{"Attributes":
    {"AttributeName3":{"SS":["AttributeValue3","AttributeValue4","AttributeValue5"]},
    "AttributeName2":{"S":"AttributeValue2"},
    "AttributeName1":{"N":"AttributeValue1"}
    },
"ConsumedCapacityUnits":1
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
|  Attributes  | If the `ReturnValues` parameter is provided as `ALL_OLD` in the request, DynamoDB returns an array of attribute name-value pairs (essentially, the deleted item). Otherwise, the response contains an empty set. Type: Array of attribute name-value pairs. | 
| ConsumedCapacityUnits | The number of write capacity units consumed by the operation. This value shows the number applied toward your provisioned throughput. Delete requests on non-existent items consume 1 write capacity unit. For more information see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Number | 

## Special errors
<a name="API_DeleteItem_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
|  ConditionalCheckFailedException  | Conditional check failed. An expected attribute value was not found.  | 

## Examples
<a name="API_DeleteItem_Examples"></a>

### Sample request
<a name="API_DeleteItem_Examples_Request"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.DeleteItem 
content-type: application/x-amz-json-1.0

{"TableName":"comp-table",
    "Key":
        {"HashKeyElement":{"S":"Mingus"},"RangeKeyElement":{"N":"200"}},
    "Expected":
        {"status":{"Value":{"S":"shopping"}}},
    "ReturnValues":"ALL_OLD"
}
```

### Sample response
<a name="API_DeleteItem_Examples_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: U9809LI6BBFJA5N2R0TB0P017JVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 353
Date: Tue, 12 Jul 2011 22:31:23 GMT

{"Attributes":
    {"friends":{"SS":["Dooley","Ben","Daisy"]},
    "status":{"S":"shopping"},
    "time":{"N":"200"},
    "user":{"S":"Mingus"}
    },
"ConsumedCapacityUnits":1
}
```

## Related actions
<a name="API_DeleteItem_Related_Actions"></a>
+  [PutItem](API_PutItem_v20111205.md) 

# DeleteTable
<a name="API_DeleteTable_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_DeleteTable_Description"></a>

The `DeleteTable` operation deletes a table and all of its items. After a `DeleteTable` request, the specified table is in the `DELETING` state until DynamoDB completes the deletion. If the table is in the `ACTIVE` state, you can delete it. If a table is in `CREATING` or `UPDATING` states, then DynamoDB returns a `ResourceInUseException` error. If the specified table does not exist, DynamoDB returns a `ResourceNotFoundException`. If table is already in the `DELETING` state, no error is returned. 

**Note**  
DynamoDB might continue to accept data plane operation requests, such as `GetItem` and `PutItem`, on a table in the `DELETING` state until the table deletion is complete.

Tables are unique among those associated with the AWS Account issuing the request, and the AWS region that receives the request (such as dynamodb.us-west-1.amazonaws.com). Each DynamoDB endpoint is entirely independent. For example, if you have two tables called "MyTable," one in dynamodb.us-west-2.amazonaws.com and one in dynamodb.us-west-1.amazonaws.com, they are completely independent and do not share any data; deleting one does not delete the other.

Use the [DescribeTables](API_DescribeTables_v20111205.md) operation to check the status of the table. 

## Requests
<a name="API_DeleteTable_RequestParameters"></a>

### Syntax
<a name="API_DeleteTable_RequestParameters.syntax"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.DeleteTable 
content-type: application/x-amz-json-1.0

{"TableName":"Table1"}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |   The name of the table to delete.   Type: String   |  Yes  | 

## Responses
<a name="API_DeleteTable_CommonResponseElements"></a>

### Syntax
<a name="API_DeleteTable_CommonResponseElements.syntax"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: 4HONCKIVH1BFUDQ1U68CTG3N27VV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 311
Date: Sun, 14 Aug 2011 22:56:22 GMT

{"TableDescription":
    {"CreationDateTime":1.313362508446E9,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"user","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"time","AttributeType":"N"}},
    "ProvisionedThroughput":{"ReadCapacityUnits":10,"WriteCapacityUnits":10},
    "TableName":"Table1",
    "TableStatus":"DELETING"
    }
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
| TableDescription  | A container for the table properties. | 
| CreationDateTime | Date when the table was created.Type: Number  | 
| KeySchema  | The primary key (simple or composite) structure for the table. A name-value pair for the `HashKeyElement` is required, and a name-value pair for the `RangeKeyElement` is optional (only required for composite primary keys). For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey).Type: Map of `HashKeyElement`, or `HashKeyElement` and `RangeKeyElement` for a composite primary key. | 
| ProvisionedThroughput  | Throughput for the specified table, consisting of values for ReadCapacityUnits and WriteCapacityUnits. See [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). | 
| ProvisionedThroughput: ReadCapacityUnits |  The minimum number of `ReadCapacityUnits` consumed per second for the specified table before DynamoDB balances the load with other operations. Type: Number  | 
| ProvisionedThroughput: WriteCapacityUnits | The minimum number of `WriteCapacityUnits` consumed per second for the specified table before DynamoDB balances the load with other operations.Type: Number  | 
|  TableName  |  The name of the deleted table. Type: String   | 
|  TableStatus  | The current state of the table (DELETING). Once the table is deleted, subsequent requests for the table return resource not found. Use the [DescribeTables](API_DescribeTables_v20111205.md) operation to check the status of the table. Type: String | 

## Special errors
<a name="API_DeleteTable_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
|  ResourceInUseException  |  Table is in state CREATING or UPDATING and can't be deleted.  | 

## Examples
<a name="API_DeleteTable_Examples"></a>

### Sample request
<a name="API_DeleteTable_Examples_Request"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.DeleteTable
content-type: application/x-amz-json-1.0
content-length: 40

{"TableName":"favorite-movies-table"}
```

### Sample response
<a name="API_DeleteTable_Examples_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: 4HONCKIVH1BFUDQ1U68CTG3N27VV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 160
Date: Sun, 14 Aug 2011 17:20:03 GMT

{"TableDescription":
    {"CreationDateTime":1.313362508446E9,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"name","AttributeType":"S"}},
    "TableName":"favorite-movies-table",
    "TableStatus":"DELETING"
}
```

## Related actions
<a name="API_DeleteTable_Related_Actions"></a>
+  [CreateTable](API_CreateTable_v20111205.md) 
+  [DescribeTables](API_DescribeTables_v20111205.md) 

# DescribeTables
<a name="API_DescribeTables_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_DescribeTables_Description"></a>

Returns information about the table, including the current status of the table, the primary key schema and when the table was created. DescribeTable results are eventually consistent. If you use DescribeTable too early in the process of creating a table, DynamoDB returns a `ResourceNotFoundException`. If you use DescribeTable too early in the process of updating a table, the new values might not be immediately available.

## Requests
<a name="API_DescribeTables_RequestParameters"></a>

### Syntax
<a name="API_DescribeTables_RequestParameters.syntax"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.DescribeTable
content-type: application/x-amz-json-1.0

{"TableName":"Table1"}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table to describe.  Type: String   |  Yes  | 

## Responses
<a name="API_DescribeTables_ResponseElements"></a>

### Syntax
<a name="API_DescribeTables_ResponseElements.syntax"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375
content-type: application/x-amz-json-1.0
Content-Length: 543


{"Table":
    {"CreationDateTime":1.309988345372E9,
    ItemCount:1,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"AttributeName1","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"AttributeName2","AttributeType":"N"}},
    "ProvisionedThroughput":{"LastIncreaseDateTime": Date, "LastDecreaseDateTime": Date, "ReadCapacityUnits":10,"WriteCapacityUnits":10},
    "TableName":"Table1",
    "TableSizeBytes":1,
    "TableStatus":"ACTIVE"
    }
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
|  Table  |  Container for the table being described. Type: String  | 
| CreationDateTime | Date when the table was created in [UNIX epoch time](http://www.epochconverter.com/). | 
|  ItemCount  |  Number of items in the specified table. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value. Type: Number  | 
|  KeySchema  | The primary key (simple or composite) structure for the table. A name-value pair for the HashKeyElement is required, and a name-value pair for the RangeKeyElement is optional (only required for composite primary keys). The maximum hash key size is 2048 bytes. The maximum range key size is 1024 bytes. Both limits are enforced separately (i.e. you can have a combined hash \$1 range 2048 \$1 1024 key). For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey) . | 
| ProvisionedThroughput  | Throughput for the specified table, consisting of values for LastIncreaseDateTime (if applicable), LastDecreaseDateTime (if applicable), ReadCapacityUnits and WriteCapacityUnits. If the throughput for the table has never been increased or decreased, DynamoDB does not return values for those elements. See [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md).Type: Array  | 
|  TableName  |  The name of the requested table.  Type: String  | 
|  TableSizeBytes  |  Total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value. Type: Number  | 
|  TableStatus  | The current state of the table (CREATING, ACTIVE, DELETING or UPDATING). Once the table is in the ACTIVE state, you can add data.  | 

## Special errors
<a name="API_DescribeTables_SpecialErrors"></a>

No errors are specific to this operation.

## Examples
<a name="API_DescribeTables_Examples"></a>

 The following examples show an HTTP POST request and response using the DescribeTable operation for a table named "comp-table". The table has a composite primary key.

### Sample Request
<a name="API_DescribeTables_Examples_Request"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.DescribeTable
content-type: application/x-amz-json-1.0

{"TableName":"users"}
```

### Sample response
<a name="API_DescribeTables_Examples_Response"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375
content-type: application/x-amz-json-1.0
content-length: 543

{"Table":
    {"CreationDateTime":1.309988345372E9,
    "ItemCount":23,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"user","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"time","AttributeType":"N"}},
    "ProvisionedThroughput":{"LastIncreaseDateTime": 1.309988345384E9, "ReadCapacityUnits":10,"WriteCapacityUnits":10},
    "TableName":"users",
    "TableSizeBytes":949,
    "TableStatus":"ACTIVE"
    }
}
```

## Related actions
<a name="API_DescribeTables_Related_Actions"></a>
+  [CreateTable](API_CreateTable_v20111205.md) 
+  [DeleteTable](API_DeleteTable_v20111205.md) 
+  [ListTables](API_ListTables_v20111205.md) 

# GetItem
<a name="API_GetItem_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_GetItem_Description"></a>

The `GetItem` operation returns a set of `Attributes` for an item that matches the primary key. If there is no matching item, `GetItem` does not return any data.

The `GetItem` operation provides an eventually consistent read by default. If eventually consistent reads are not acceptable for your application, use `ConsistentRead`. Although this operation might take longer than a standard read, it always returns the last updated value. For more information, see [DynamoDB read consistency](HowItWorks.ReadConsistency.md).

## Requests
<a name="API_GetItem_RequestParameters"></a>

### Syntax
<a name="API_GetItem_RequestParameters.syntax"></a>

```
// This header is abbreviated.
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.GetItem
content-type: application/x-amz-json-1.0 

{"TableName":"Table1",
 	"Key": 
		{"HashKeyElement": {"S":"AttributeValue1"},
		"RangeKeyElement": {"N":"AttributeValue2"} 
	},
	"AttributesToGet":["AttributeName3","AttributeName4"],
	"ConsistentRead":Boolean
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table containing the requested item.  Type: String  |  Yes  | 
|  Key  | The primary key values that define the item. For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey).Type: Map of `HashKeyElement` to its value and `RangeKeyElement` to its value. | Yes | 
| AttributesToGet  | Array of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.Type: Array | No | 
| ConsistentRead  | If set to `true`, then a consistent read is issued, otherwise eventually consistent is used.Type: Boolean | No | 

## Responses
<a name="API_GetItem_ResponseElements"></a>

### Syntax
<a name="API_GetItem_ResponseElements.syntax"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 144

{"Item":{
	"AttributeName3":{"S":"AttributeValue3"},
	"AttributeName4":{"N":"AttributeValue4"},
	"AttributeName5":{"B":"dmFsdWU="}
	},
"ConsumedCapacityUnits": 0.5
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
|  Item  | Contains the requested attributes.Type: Map of attribute name-value pairs. | 
| ConsumedCapacityUnits | The number of read capacity units consumed by the operation. This value shows the number applied toward your provisioned throughput. Requests for non-existent items consume the minimum read capacity units, depending on the type of read. For more information see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Number | 

## Special errors
<a name="API_GetItem_SpecialErrors"></a>

No errors specific to this operation.

## Examples
<a name="API_GetItem_Examples"></a>

 For examples using the AWS SDK, see [Working with items and attributes in DynamoDB](WorkingWithItems.md).

### Sample request
<a name="API_GetItem_Examples_Request"></a>

```
// This header is abbreviated.
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.GetItem
content-type: application/x-amz-json-1.0 

{"TableName":"comptable",
	"Key":
		{"HashKeyElement":{"S":"Julie"},
		"RangeKeyElement":{"N":"1307654345"}},
	"AttributesToGet":["status","friends"],
	"ConsistentRead":true
}
```

### Sample response
<a name="API_GetItem_Examples_Response"></a>

Notice the ConsumedCapacityUnits value is 1, because the optional parameter `ConsistentRead` is set to `true`. If `ConsistentRead` is set to `false` (or not specified) for the same request, the response is eventually consistent and the ConsumedCapacityUnits value would be 0.5.

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 72

{"Item":
	{"friends":{"SS":["Lynda, Aaron"]},
	"status":{"S":"online"}
	},
"ConsumedCapacityUnits": 1
}
```

# ListTables
<a name="API_ListTables_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_ListTables_Description"></a>

Returns an array of all the tables associated with the current account and endpoint.

Each DynamoDB endpoint is entirely independent. For example, if you have two tables called "MyTable," one in dynamodb.us-west-2.amazonaws.com and one in dynamodb.us-east-1.amazonaws.com, they are completely independent and do not share any data. The ListTables operation returns all of the table names associated with the account making the request, for the endpoint that receives the request.

## Requests
<a name="API_ListTables_RequestParameters"></a>

### Syntax
<a name="API_ListTables_RequestParameters.syntax"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.ListTables
content-type: application/x-amz-json-1.0

{"ExclusiveStartTableName":"Table1","Limit":3}
```

The ListTables operation, by default, requests all of the table names associated with the account making the request, for the endpoint that receives the request.


****  

|  Name  |  Description  | Required | 
| --- | --- | --- | 
|  Limit  |  A number of maximum table names to return.  Type: Integer  | No | 
| ExclusiveStartTableName  | The name of the table that starts the list. If you already ran a ListTables operation and received an `LastEvaluatedTableName` value in the response, use that value here to continue the list. Type: String | No | 

## Responses
<a name="API_ListTables_ResponseElements"></a>

### Syntax
<a name="API_ListTables_ResponseElements.syntax"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: S1LEK2DPQP8OJNHVHL8OU2M7KRVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 81
Date: Fri, 21 Oct 2011 20:35:38 GMT

{"TableNames":["Table1","Table2","Table3"], "LastEvaluatedTableName":"Table3"}
```


****  

|  Name  |  Description  | 
| --- | --- | 
|  TableNames  |  The names of the tables associated with the current account at the current endpoint.  Type: Array  | 
| LastEvaluatedTableName  | The name of the last table in the current list, only if some tables for the account and endpoint have not been returned. This value does not exist in a response if all table names are already returned. Use this value as the `ExclusiveStartTableName` in a new request to continue the list until all the table names are returned.  Type: String  | 

## Special errors
<a name="API_ListTables_SpecialErrors"></a>

No errors are specific to this operation.

## Examples
<a name="API_ListTables_Examples"></a>

The following examples show an HTTP POST request and response using the ListTables operation.

### Sample request
<a name="API_ListTables_Examples_Request"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.ListTables
content-type: application/x-amz-json-1.0

{"ExclusiveStartTableName":"comp2","Limit":3}
```

### Sample response
<a name="API_ListTables_Examples_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: S1LEK2DPQP8OJNHVHL8OU2M7KRVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 81
Date: Fri, 21 Oct 2011 20:35:38 GMT

{"LastEvaluatedTableName":"comp5","TableNames":["comp3","comp4","comp5"]}
```

## Related actions
<a name="API_ListTables_Related_Actions"></a>
+  [DescribeTables](API_DescribeTables_v20111205.md) 
+  [CreateTable](API_CreateTable_v20111205.md) 
+  [DeleteTable](API_DeleteTable_v20111205.md) 

# PutItem
<a name="API_PutItem_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_PutItem_Description"></a>

Creates a new item, or replaces an old item with a new item (including all the attributes). If an item already exists in the specified table with the same primary key, the new item completely replaces the existing item. You can perform a conditional put (insert a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values. 

Attribute values may not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests with empty values will be rejected with a `ValidationException`.

**Note**  
To ensure that a new item does not replace an existing item, use a conditional put operation with `Exists` set to `false` for the primary key attribute, or attributes.

For more information about using `PutItem`, see [Working with items and attributes in DynamoDB](WorkingWithItems.md).

## Requests
<a name="API_PutItem_RequestParameters"></a>

### Syntax
<a name="API_PutItem_RequestParameters.syntax"></a>

```
// This header is abbreviated.
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.PutItem
content-type: application/x-amz-json-1.0

{"TableName":"Table1",
    "Item":{
        "AttributeName1":{"S":"AttributeValue1"},
        "AttributeName2":{"N":"AttributeValue2"},
        "AttributeName5":{"B":"dmFsdWU="}
    },
    "Expected":{"AttributeName3":{"Value": {"S":"AttributeValue"}, "Exists":Boolean}},
    "ReturnValues":"ReturnValuesConstant"}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table to contain the item. Type: String  |  Yes  | 
|  Item  | A map of the attributes for the item, and must include the primary key values that define the item. Other attribute name-value pairs can be provided for the item. For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey).Type: Map of attribute names to attribute values. | Yes | 
| Expected  | Designates an attribute for a conditional put. The `Expected` parameter allows you to provide an attribute name, and whether or not DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it.Type: Map of an attribute names to an attribute value, and whether it exists. | No | 
| Expected:AttributeName  | The name of the attribute for the conditional put.Type: String | No | 
| Expected:AttributeName: ExpectedAttributeValue | Use this parameter to specify whether or not a value already exists for the attribute name-value pair. The following JSON notation replaces the item if the "Color" attribute doesn't already exist for that item:<pre>"Expected" :<br />	{"Color":{"Exists":false}}</pre>The following JSON notation checks to see if the attribute with name "Color" has an existing value of "Yellow" before replacing the item: <pre>"Expected" : <br />	{"Color":{"Exists":true,{"Value":{"S":"Yellow"}}}</pre>By default, if you use the `Expected` parameter and provide a `Value`, DynamoDB assumes the attribute exists and has a current value to be replaced. So you don't have to specify `{"Exists":true}`, because it is implied. You can shorten the request to:<pre>"Expected" : <br />	{"Color":{"Value":{"S":"Yellow"}}}</pre> If you specify `{"Exists":true}` without an attribute value to check, DynamoDB returns an error.  | No | 
| ReturnValues  | Use this parameter if you want to get the attribute name-value pairs before they were updated with the `PutItem` request. Possible parameter values are `NONE` (default) or `ALL_OLD`. If `ALL_OLD` is specified, and `PutItem` overwrote an attribute name-value pair, the content of the old item is returned. If this parameter is not provided or is `NONE`, nothing is returned.Type: String | No | 

## Responses
<a name="API_PutItem_CommonResponseElements"></a>

### Syntax
<a name="API_PutItem_CommonResponseElements.syntax"></a>

The following syntax example assumes the request specified a `ReturnValues` parameter of `ALL_OLD`; otherwise, the response has only the `ConsumedCapacityUnits` element.

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 85

{"Attributes":
	{"AttributeName3":{"S":"AttributeValue3"},
	"AttributeName2":{"SS":"AttributeValue2"},
	"AttributeName1":{"SS":"AttributeValue1"},
	},
"ConsumedCapacityUnits":1
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
|  Attributes  | Attribute values before the put operation, but only if the `ReturnValues` parameter is specified as `ALL_OLD` in the request.Type: Map of attribute name-value pairs. | 
| ConsumedCapacityUnits | The number of write capacity units consumed by the operation. This value shows the number applied toward your provisioned throughput. For more information see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Number | 

## Special errors
<a name="API_PutItem_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
|  ConditionalCheckFailedException  | Conditional check failed. An expected attribute value was not found.  | 
| ResourceNotFoundException  | The specified item or attribute was not found. | 

## Examples
<a name="API_PutItem_Examples"></a>

For examples using the AWS SDK, see [Working with items and attributes in DynamoDB](WorkingWithItems.md).

### Sample request
<a name="API_PutItem_Examples_Request"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.PutItem 
content-type: application/x-amz-json-1.0

{"TableName":"comp5",
	"Item":
		{"time":{"N":"300"},
		"feeling":{"S":"not surprised"},
		"user":{"S":"Riley"}
		},
	"Expected":
		{"feeling":{"Value":{"S":"surprised"},"Exists":true}}
	"ReturnValues":"ALL_OLD"
}
```

### Sample response
<a name="API_PutItem_Examples_Response"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8952fa74-71e9-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 84

{"Attributes":
	{"feeling":{"S":"surprised"},
	"time":{"N":"300"},
	"user":{"S":"Riley"}},
"ConsumedCapacityUnits":1
}
```

## Related actions
<a name="API_PutItem_Related_Actions"></a>
+  [UpdateItem](API_UpdateItem_v20111205.md) 
+  [DeleteItem](API_DeleteItem_v20111205.md) 
+  [GetItem](API_GetItem_v20111205.md) 
+  [BatchGetItem](API_BatchGetItem_v20111205.md) 

# Query
<a name="API_Query_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_Query_Description"></a>

A `Query` operation gets the values of one or more items and their attributes by primary key (`Query` is only available for hash-and-range primary key tables). You must provide a specific `HashKeyValue`, and can narrow the scope of the query using comparison operators on the `RangeKeyValue` of the primary key. Use the `ScanIndexForward` parameter to get results in forward or reverse order by range key. 

Queries that do not return results consume the minimum read capacity units according to the type of read.

**Note**  
If the total number of items meeting the query parameters exceeds the 1MB limit, the query stops and results are returned to the user with a `LastEvaluatedKey` to continue the query in a subsequent operation. Unlike a Scan operation, a Query operation never returns an empty result set *and* a `LastEvaluatedKey`. The `LastEvaluatedKey` is only provided if the results exceed 1MB, or if you have used the `Limit` parameter.   
The result can be set for a consistent read using the `ConsistentRead` parameter.

## Requests
<a name="API_Query_RequestParameters"></a>

### Syntax
<a name="API_Query_RequestParameters.syntax"></a>

```
// This header is abbreviated.
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.Query  
content-type: application/x-amz-json-1.0

{"TableName":"Table1",
	"Limit":2,
	"ConsistentRead":true,
	"HashKeyValue":{"S":"AttributeValue1":},
	"RangeKeyCondition": {"AttributeValueList":[{"N":"AttributeValue2"}],"ComparisonOperator":"GT"}
	"ScanIndexForward":true,
	"ExclusiveStartKey":{
		"HashKeyElement":{"S":"AttributeName1"},
		"RangeKeyElement":{"N":"AttributeName2"}
	},
    "AttributesToGet":["AttributeName1", "AttributeName2", "AttributeName3"]},
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table containing the requested items.  Type: String  |  Yes  | 
| AttributesToGet  | Array of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.Type: Array | No | 
| Limit  | The maximum number of items to return (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while querying the table, it stops the query and returns the matching values up to that point, and a `LastEvaluatedKey` to apply in a subsequent operation to continue the query. Also, if the result set size exceeds 1MB before DynamoDB hits this limit, it stops the query and returns the matching values, and a `LastEvaluatedKey` to apply in a subsequent operation to continue the query.Type: Number | No | 
| ConsistentRead  | If set to `true`, then a consistent read is issued, otherwise eventually consistent is used.Type: Boolean | No | 
| Count  | If set to `true`, DynamoDB returns a total number of items that match the query parameters, instead of a list of the matching items and their attributes. You can apply the `Limit` parameter to count-only queries.  Do not set `Count` to `true` while providing a list of `AttributesToGet`; otherwise, DynamoDB returns a validation error. For more information, see [Counting the items in the results](Query.Other.md#Query.Count).Type: Boolean | No | 
| HashKeyValue  | Attribute value of the hash component of the composite primary key.Type: String, Number, or Binary | Yes | 
| RangeKeyCondition  | A container for the attribute values and comparison operators to use for the query. A query request does not require a `RangeKeyCondition`. If you provide only the `HashKeyValue`, DynamoDB returns all items with the specified hash key element value.Type: Map | No | 
| RangeKeyCondition:​ AttributeValueList | The attribute values to evaluate for the query parameters. The `AttributeValueList` contains one attribute value, unless a `BETWEEN` comparison is specified. For the `BETWEEN` comparison, the `AttributeValueList` contains two attribute values. Type: A map of `AttributeValue` to a `ComparisonOperator`.  | No | 
| RangeKeyCondition:​ ComparisonOperator |  The criteria for evaluating the provided attributes, such as equals, greater-than, etc. The following are valid comparison operators for a Query operation.  String value comparisons for greater than, equals, or less than are based on ASCII character code values. For example, `a` is greater than `A`, and `aa` is greater than `B`. For a list of code values, see [http://en.wikipedia.org/wiki/ASCII\$1ASCII\$1printable\$1characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters).  For Binary, DynamoDB treats each byte of the binary data as unsigned when it compares binary values, for example when evaluating query expressions.   Type: String or Binary  | No | 
|   | `EQ` : Equal. For `EQ`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not equal `{"NS":["6", "2", "1"]}`. |   | 
|   | `LE` : Less than or equal. For `LE`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `LT` : Less than. For `LT`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `GE` : Greater than or equal. For `GE`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `GT` : Greater than. For `GT`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `BEGINS_WITH` : checks for a prefix. For `BEGINS_WITH`, `AttributeValueList` can contain only one `AttributeValue` of type String or Binary (not a Number or a set). The target attribute of the comparison must be a String or Binary (not a Number or a set). |   | 
|   | `BETWEEN` : Greater than, or equal to, the first value and less than, or equal to, the second value. For `BETWEEN`, `AttributeValueList` must contain two `AttributeValue` elements of the same type, either String, Number, or Binary (not a set). A target attribute matches if the target value is greater than, or equal to, the first element and less than, or equal to, the second element. If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not compare to `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
| ScanIndexForward | Specifies ascending or descending traversal of the index. DynamoDB returns results reflecting the requested order determined by the range key: If the data type is Number, the results are returned in numeric order; otherwise, the traversal is based on ASCII character code values.Type: BooleanDefault is `true` (ascending). | No | 
| ExclusiveStartKey | Primary key of the item from which to continue an earlier query. An earlier query might provide this value as the `LastEvaluatedKey` if that query operation was interrupted before completing the query; either because of the result set size or the `Limit` parameter. The `LastEvaluatedKey` can be passed back in a new query request to continue the operation from that point.Type: `HashKeyElement`, or `HashKeyElement` and `RangeKeyElement` for a composite primary key. | No | 

## Responses
<a name="API_Query_ResponseElements"></a>

### Syntax
<a name="API_Query_ResponseElements.syntax"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 308

{"Count":2,"Items":[{
    "AttributeName1":{"S":"AttributeValue1"},
    "AttributeName2":{"N":"AttributeValue2"},
    "AttributeName3":{"S":"AttributeValue3"}
    },{
    "AttributeName1":{"S":"AttributeValue3"},
    "AttributeName2":{"N":"AttributeValue4"},
    "AttributeName3":{"S":"AttributeValue3"},
    "AttributeName5":{"B":"dmFsdWU="}
}],
    "LastEvaluatedKey":{"HashKeyElement":{"AttributeValue3":"S"},
                        "RangeKeyElement":{"AttributeValue4":"N"}
     },
     "ConsumedCapacityUnits":1
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
| Items  | Item attributes meeting the query parameters.Type: Map of attribute names to and their data types and values. | 
| Count  |  Number of items in the response. For more information, see [Counting the items in the results](Query.Other.md#Query.Count). Type: Number  | 
| LastEvaluatedKey | Primary key of the item where the query operation stopped, inclusive of the previous result set. Use this value to start a new operation excluding this value in the new request.The `LastEvaluatedKey` is `null` when the entire query result set is complete (i.e. the operation processed the “last page”). Type: `HashKeyElement`, or `HashKeyElement` and `RangeKeyElement` for a composite primary key. | 
| ConsumedCapacityUnits | The number of read capacity units consumed by the operation. This value shows the number applied toward your provisioned throughput. For more information see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Number | 

## Special errors
<a name="API_Query_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
| ResourceNotFoundException  | The specified table was not found. | 

## Examples
<a name="API_Query_Examples"></a>

 For examples using the AWS SDK, see [Querying tables in DynamoDB](Query.md).

### Sample request
<a name="API_Query_Examples_Request"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.Query  
content-type: application/x-amz-json-1.0

{"TableName":"1-hash-rangetable",
	"Limit":2,
	"HashKeyValue":{"S":"John"},
	"ScanIndexForward":false,
	"ExclusiveStartKey":{
		"HashKeyElement":{"S":"John"},
		"RangeKeyElement":{"S":"The Matrix"}
	}
}
```

### Sample response
<a name="API_Query_Examples_Response"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 3647e778-71eb-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 308

{"Count":2,"Items":[{
	"fans":{"SS":["Jody","Jake"]},
	"name":{"S":"John"},
	"rating":{"S":"***"},
	"title":{"S":"The End"}
	},{
	"fans":{"SS":["Jody","Jake"]},
	"name":{"S":"John"},
	"rating":{"S":"***"},
	"title":{"S":"The Beatles"}
	}],
	"LastEvaluatedKey":{"HashKeyElement":{"S":"John"},"RangeKeyElement":{"S":"The Beatles"}},
"ConsumedCapacityUnits":1
}
```

### Sample request
<a name="API_Query_Examples_Request2"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.Query 
content-type: application/x-amz-json-1.0
 
{"TableName":"1-hash-rangetable",
	"Limit":2,
	"HashKeyValue":{"S":"Airplane"},
	"RangeKeyCondition":{"AttributeValueList":[{"N":"1980"}],"ComparisonOperator":"EQ"},
	"ScanIndexForward":false}
```

### Sample response
<a name="API_Query_Examples_Response2"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8b9ee1ad-774c-11e0-9172-d954e38f553a
content-type: application/x-amz-json-1.0
content-length: 119 
 
{"Count":1,"Items":[{
	"fans":{"SS":["Dave","Aaron"]},
	"name":{"S":"Airplane"},
	"rating":{"S":"***"},
	"year":{"N":"1980"}
	}],
"ConsumedCapacityUnits":1
}
```

## Related actions
<a name="API_Query_Related_Actions"></a>
+  [Scan](API_Scan_v20111205.md) 

# Scan
<a name="API_Scan_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_Scan_Description"></a>

The `Scan` operation returns one or more items and its attributes by performing a full scan of a table. Provide a `ScanFilter` to get more specific results. 

**Note**  
If the total number of scanned items exceeds the 1MB limit, the scan stops and results are returned to the user with a `LastEvaluatedKey` to continue the scan in a subsequent operation. The results also include the number of items exceeding the limit. A scan can result in no table data meeting the filter criteria.   
The result set is eventually consistent. 

## Requests
<a name="API_Scan_RequestParameters"></a>

### Syntax
<a name="API_Scan_RequestParameters.syntax"></a>

```
// This header is abbreviated.
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.Scan  
content-type: application/x-amz-json-1.0

{"TableName":"Table1",
    "Limit": 2,
    "ScanFilter":{
        "AttributeName1":{"AttributeValueList":[{"S":"AttributeValue"}],"ComparisonOperator":"EQ"}
    },
    "ExclusiveStartKey":{
        "HashKeyElement":{"S":"AttributeName1"},
        "RangeKeyElement":{"N":"AttributeName2"}
    },
    "AttributesToGet":["AttributeName1", "AttributeName2", "AttributeName3"]},
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table containing the requested items. Type: String  |  Yes  | 
| AttributesToGet  | Array of Attribute names. If attribute names are not specified then all attributes will be returned. If some attributes are not found, they will not appear in the result.Type: Array | No | 
| Limit  | The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops and returns the matching values up to that point, and a `LastEvaluatedKey` to apply in a subsequent operation to continue retrieving items. Also, if the scanned data set size exceeds 1MB before DynamoDB reaches this limit, it stops the scan and returns the matching values up to the limit, and a `LastEvaluatedKey` to apply in a subsequent operation to continue the scan.Type: Number | No | 
| Count  | If set to `true`, DynamoDB returns a total number of items for the Scan operation, even if the operation has no matching items for the assigned filter. You can apply the Limit parameter to count-only scans.  Do not set `Count` to `true` while providing a list of `AttributesToGet`, otherwise DynamoDB returns a validation error. For more information, see [Counting the items in the results](Scan.md#Scan.Count).Type: Boolean | No | 
| ScanFilter  | Evaluates the scan results and returns only the desired values. Multiple conditions are treated as "AND" operations: all conditions must be met to be included in the results. Type: A map of attribute names to values with comparison operators. | No | 
| ScanFilter:AttributeValueList | The values and conditions to evaluate the scan results for the filter.Type: A map of `AttributeValue` to a `Condition`. | No | 
| ScanFilter:​ ComparisonOperator | The criteria for evaluating the provided attributes, such as equals, greater-than, etc. The following are valid comparison operators for a scan operation. String value comparisons for greater than, equals, or less than are based on ASCII character code values. For example, `a` is greater than `A`, and `aa` is greater than `B`. For a list of code values, see [http://en.wikipedia.org/wiki/ASCII\$1ASCII\$1printable\$1characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). For Binary, DynamoDB treats each byte of the binary data as unsigned when it compares binary values, for example when evaluating query expressions.   Type: String or Binary  | No | 
|   | `EQ` : Equal. For `EQ`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not equal `{"NS":["6", "2", "1"]}`. |   | 
|   | `NE` : Not Equal. For `NE`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not equal `{"NS":["6", "2", "1"]}`. |   | 
|   | `LE` : Less than or equal. For `LE`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `LT` : Less than. For `LT`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `GE` : Greater than or equal. For `GE`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `GT` : Greater than. For `GT`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
|   | `NOT_NULL` : Attribute exists.  |   | 
|   | `NULL` : Attribute does not exist.  |   | 
|   | `CONTAINS` : checks for a subsequence, or value in a set. For `CONTAINS`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If the target attribute of the comparison is a String, then the operation checks for a substring match. If the target attribute of the comparison is Binary, then the operation looks for a subsequence of the target that matches the input. If the target attribute of the comparison is a set ("SS", "NS", or "BS"), then the operation checks for a member of the set (not as a substring). |   | 
|   | `NOT_CONTAINS` : checks for absence of a subsequence, or absence of a value in a set. For `NOT_CONTAINS`, `AttributeValueList` can contain only one `AttributeValue` of type String, Number, or Binary (not a set). If the target attribute of the comparison is a String, then the operation checks for the absence of a substring match. If the target attribute of the comparison is Binary, then the operation checks for the absence of a subsequence of the target that matches the input. If the target attribute of the comparison is a set ("SS", "NS", or "BS"), then the operation checks for the absence of a member of the set (not as a substring). |   | 
|   | `BEGINS_WITH` : checks for a prefix. For `BEGINS_WITH`, `AttributeValueList` can contain only one `AttributeValue` of type String or Binary (not a Number or a set). The target attribute of the comparison must be a String or Binary (not a Number or a set). |   | 
|   | `IN` : checks for exact matches. For `IN`, `AttributeValueList` can contain more than one `AttributeValue` of type String, Number, or Binary (not a set). The target attribute of the comparison must be of the same type and exact value to match. A String never matches a String set. |   | 
|   | `BETWEEN` : Greater than, or equal to, the first value and less than, or equal to, the second value. For `BETWEEN`, `AttributeValueList` must contain two `AttributeValue` elements of the same type, either String, Number, or Binary (not a set). A target attribute matches if the target value is greater than, or equal to, the first element and less than, or equal to, the second element. If an item contains an `AttributeValue` of a different type than the one specified in the request, the value does not match. For example, `{"S":"6"}` does not compare to `{"N":"6"}`. Also, `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}`. |   | 
| ExclusiveStartKey | Primary key of the item from which to continue an earlier scan. An earlier scan might provide this value if that scan operation was interrupted before scanning the entire table; either because of the result set size or the `Limit` parameter. The `LastEvaluatedKey` can be passed back in a new scan request to continue the operation from that point.Type: `HashKeyElement`, or `HashKeyElement` and `RangeKeyElement` for a composite primary key. | No | 

## Responses
<a name="API_Scan_ResponseElements"></a>

### Syntax
<a name="API_Scan_ResponseElements.syntax"></a>

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 229 

{"Count":2,"Items":[{
    "AttributeName1":{"S":"AttributeValue1"},
    "AttributeName2":{"S":"AttributeValue2"},
    "AttributeName3":{"S":"AttributeValue3"}
    },{
    "AttributeName1":{"S":"AttributeValue4"},
    "AttributeName2":{"S":"AttributeValue5"},
    "AttributeName3":{"S":"AttributeValue6"},
    "AttributeName5":{"B":"dmFsdWU="}
    }],
    "LastEvaluatedKey":
        {"HashKeyElement":{"S":"AttributeName1"},
        "RangeKeyElement":{"N":"AttributeName2"},
    "ConsumedCapacityUnits":1,
    "ScannedCount":2}
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
| Items  | Container for the attributes meeting the operation parameters.Type: Map of attribute names to and their data types and values. | 
| Count  |  Number of items in the response. For more information, see [Counting the items in the results](Scan.md#Scan.Count). Type: Number  | 
| ScannedCount  | Number of items in the complete scan before any filters are applied. A high `ScannedCount` value with few, or no, `Count` results indicates an inefficient Scan operation. For more information, see [Counting the items in the results](Scan.md#Scan.Count).Type: Number | 
| LastEvaluatedKey | Primary key of the item where the scan operation stopped. Provide this value in a subsequent scan operation to continue the operation from that point.The `LastEvaluatedKey` is `null` when the entire scan result set is complete (i.e. the operation processed the “last page”).  | 
| ConsumedCapacityUnits | The number of read capacity units consumed by the operation. This value shows the number applied toward your provisioned throughput. For more information see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Number | 

## Special errors
<a name="API_Scan_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
| ResourceNotFoundException  | The specified table was not found. | 

## Examples
<a name="API_Scan_Examples"></a>

For examples using the AWS SDK, see [Scanning tables in DynamoDB](Scan.md).

### Sample request
<a name="API_Scan_Examples_Request"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.Scan 
content-type: application/x-amz-json-1.0

{"TableName":"1-hash-rangetable","ScanFilter":{}}
```

### Sample response
<a name="API_Scan_Examples_Response"></a>

```
HTTP/1.1 200
x-amzn-RequestId: 4e8a5fa9-71e7-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0 
content-length: 465 

{"Count":4,"Items":[{
	"date":{"S":"1980"},
	"fans":{"SS":["Dave","Aaron"]},
	"name":{"S":"Airplane"},
	"rating":{"S":"***"}
	},{
	"date":{"S":"1999"},
	"fans":{"SS":["Ziggy","Laura","Dean"]},
	"name":{"S":"Matrix"},
	"rating":{"S":"*****"}
	},{
	"date":{"S":"1976"},
	"fans":{"SS":["Riley"]},"
	name":{"S":"The Shaggy D.A."},
	"rating":{"S":"**"}
	},{
	"date":{"S":"1985"},
	"fans":{"SS":["Fox","Lloyd"]},
	"name":{"S":"Back To The Future"},
	"rating":{"S":"****"}
	}],
    "ConsumedCapacityUnits":0.5
	"ScannedCount":4}
```

### Sample request
<a name="API_Scan_Examples_Request2"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.Scan 
content-type: application/x-amz-json-1.0
content-length: 125 

{"TableName":"comp5",
	"ScanFilter":
		{"time":
			{"AttributeValueList":[{"N":"400"}],
			"ComparisonOperator":"GT"}
	}
}
```

### Sample response
<a name="API_Scan_Examples_Response2"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: PD1CQK9QCTERLTJP20VALJ60TRVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 262
Date: Mon, 15 Aug 2011 16:52:02 GMT

{"Count":2,
	"Items":[
		{"friends":{"SS":["Dave","Ziggy","Barrie"]},
		"status":{"S":"chatting"},
		"time":{"N":"2000"},
		"user":{"S":"Casey"}},
		{"friends":{"SS":["Dave","Ziggy","Barrie"]},
		"status":{"S":"chatting"},
		"time":{"N":"2000"},
		"user":{"S":"Fredy"}
		}],
"ConsumedCapacityUnits":0.5
"ScannedCount":4
}
```

### Sample request
<a name="API_Scan_Examples_Request3"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.Scan
content-type: application/x-amz-json-1.0

{"TableName":"comp5",
	"Limit":2,
	"ScanFilter":
		{"time":
			{"AttributeValueList":[{"N":"400"}],
			"ComparisonOperator":"GT"}
	},
	"ExclusiveStartKey":
		{"HashKeyElement":{"S":"Fredy"},"RangeKeyElement":{"N":"2000"}}
}
```

### Sample response
<a name="API_Scan_Examples_Response3"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: PD1CQK9QCTERLTJP20VALJ60TRVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 232
Date: Mon, 15 Aug 2011 16:52:02 GMT

{"Count":1,
	"Items":[
		{"friends":{"SS":["Jane","James","John"]},
		"status":{"S":"exercising"},
		"time":{"N":"2200"},
		"user":{"S":"Roger"}}
	],
	"LastEvaluatedKey":{"HashKeyElement":{"S":"Riley"},"RangeKeyElement":{"N":"250"}},
"ConsumedCapacityUnits":0.5
"ScannedCount":2
}
```

## Related actions
<a name="API_Scan_Related_Actions"></a>
+  [Query](API_Query_v20111205.md) 
+  [BatchGetItem](API_BatchGetItem_v20111205.md) 

# UpdateItem
<a name="API_UpdateItem_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_UpdateItem_Description"></a>

Edits an existing item's attributes. You can perform a conditional update (insert a new attribute name-value pair if it doesn't exist, or replace an existing name-value pair if it has certain expected attribute values).

**Note**  
You cannot update the primary key attributes using UpdateItem. Instead, delete the item and use PutItem to create a new item with new attributes.

The UpdateItem operation includes an `Action` parameter, which defines how to perform the update. You can put, delete, or add attribute values. 

Attribute values may not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests with empty values will be rejected with a `ValidationException`.

If an existing item has the specified primary key: 
+ **PUT—** Adds the specified attribute. If the attribute exists, it is replaced by the new value. 
+ **DELETE—** If no value is specified, this removes the attribute and its value. If a set of values is specified, then the values in the specified set are removed from the old set. So if the attribute value contains [a,b,c] and the delete action contains [a,c], then the final attribute value is [b]. The type of the specified value must match the existing value type. Specifying an empty set is not valid.
+ **ADD—** Only use the add action for numbers or if the target attribute is a set (including string sets). ADD does not work if the target attribute is a single string value or a scalar binary value. The specified value is added to a numeric value (incrementing or decrementing the existing numeric value) or added as an additional value in a string set. If a set of values is specified, the values are added to the existing set. For example if the original set is [1,2] and supplied value is [3], then after the add operation the set is [1,2,3], not [4,5]. An error occurs if an Add action is specified for a set attribute and the attribute type specified does not match the existing set type. 

  If you use ADD for an attribute that does not exist, the attribute and its values are added to the item.

If no item matches the specified primary key: 
+ **PUT—** Creates a new item with specified primary key. Then adds the specified attribute. 
+ **DELETE—** Nothing happens. 
+ **ADD—** Creates an item with supplied primary key and number (or set of numbers) for the attribute value. Not valid for a string or a binary type. 

**Note**  
If you use `ADD` to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses `0` as the initial value. Also, if you update an item using `ADD` to increment or decrement a number value for an attribute that doesn't exist before the update (but the item does) DynamoDB uses `0` as the initial value. For example, you use `ADD` to add `+3` to an attribute that did not exist before the update. DynamoDB uses `0` for the initial value, and the value after the update is `3`. 

For more information about using this operation, see [Working with items and attributes in DynamoDB](WorkingWithItems.md). 

## Requests
<a name="API_UpdateItem_RequestParameters"></a>

### Syntax
<a name="API_UpdateItem_RequestParameters.syntax"></a>

```
// This header is abbreviated.
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.UpdateItem
content-type: application/x-amz-json-1.0

{"TableName":"Table1",
    "Key":
        {"HashKeyElement":{"S":"AttributeValue1"},
        "RangeKeyElement":{"N":"AttributeValue2"}},
    "AttributeUpdates":{"AttributeName3":{"Value":{"S":"AttributeValue3_New"},"Action":"PUT"}},
    "Expected":{"AttributeName3":{"Value":{"S":"AttributeValue3_Current"}}},
    "ReturnValues":"ReturnValuesConstant"
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table containing the item to update.  Type: String  |  Yes  | 
|  Key  | The primary key that defines the item. For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey).Type: Map of `HashKeyElement` to its value and `RangeKeyElement` to its value. | Yes | 
| AttributeUpdates | Map of attribute name to the new value and action for the update. The attribute names specify the attributes to modify, and cannot contain any primary key attributes.Type: Map of attribute name, value, and an action for the attribute update. |  | 
| AttributeUpdates:Action | Specifies how to perform the update. Possible values: `PUT` (default), `ADD` or `DELETE`. The semantics are explained in the UpdateItem description.Type: StringDefault: `PUT` | No | 
| Expected  | Designates an attribute for a conditional update. The `Expected` parameter allows you to provide an attribute name, and whether or not DynamoDB should check to see if the attribute value already exists; or if the attribute value exists and has a particular value before changing it.Type: Map of attribute names. | No | 
| Expected:AttributeName  | The name of the attribute for the conditional put.Type: String | No | 
| Expected:AttributeName: ExpectedAttributeValue | Use this parameter to specify whether or not a value already exists for the attribute name-value pair. The following JSON notation updates the item if the "Color" attribute doesn't already exist for that item:<pre>"Expected" :<br />	{"Color":{"Exists":false}}</pre>The following JSON notation checks to see if the attribute with name "Color" has an existing value of "Yellow" before updating the item: <pre>"Expected" : <br />	{"Color":{"Exists":true},{"Value":{"S":"Yellow"}}}</pre>By default, if you use the `Expected` parameter and provide a `Value`, DynamoDB assumes the attribute exists and has a current value to be replaced. So you don't have to specify `{"Exists":true}`, because it is implied. You can shorten the request to:<pre>"Expected" : <br />	{"Color":{"Value":{"S":"Yellow"}}}</pre> If you specify `{"Exists":true}` without an attribute value to check, DynamoDB returns an error.  | No | 
| ReturnValues  | Use this parameter if you want to get the attribute name-value pairs before they were updated with the `UpdateItem` request. Possible parameter values are `NONE` (default) or `ALL_OLD`, `UPDATED_OLD`, `ALL_NEW` or `UPDATED_NEW`. If `ALL_OLD` is specified, and `UpdateItem` overwrote an attribute name-value pair, the content of the old item is returned. If this parameter is not provided or is `NONE`, nothing is returned. If `ALL_NEW` is specified, then all the attributes of the new version of the item are returned. If `UPDATED_NEW` is specified, then the new versions of only the updated attributes are returned.Type: String | No | 

## Responses
<a name="API_UpdateItem_CommonResponseElements"></a>

### Syntax
<a name="API_UpdateItem_CommonResponseElements.syntax"></a>

The following syntax example assumes the request specified a `ReturnValues` parameter of `ALL_OLD`; otherwise, the response has only the `ConsumedCapacityUnits` element.

```
HTTP/1.1 200 
x-amzn-RequestId: 8966d095-71e9-11e0-a498-71d736f27375 
content-type: application/x-amz-json-1.0
content-length: 140

{"Attributes":{
	"AttributeName1":{"S":"AttributeValue1"},
	"AttributeName2":{"S":"AttributeValue2"},
	"AttributeName3":{"S":"AttributeValue3"},
	"AttributeName5":{"B":"dmFsdWU="}
	},
"ConsumedCapacityUnits":1
}
```


****  

|  Name  |  Description  | 
| --- | --- | 
|  Attributes  | A map of attribute name-value pairs, but only if the `ReturnValues` parameter is specified as something other than `NONE` in the request.Type: Map of attribute name-value pairs. | 
| ConsumedCapacityUnits | The number of write capacity units consumed by the operation. This value shows the number applied toward your provisioned throughput. For more information see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md). Type: Number | 

## Special errors
<a name="API_UpdateItem_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
|  ConditionalCheckFailedException  | Conditional check failed. Attribute ("\$1 name \$1") value is ("\$1 value \$1") but was expected ("\$1 expValue \$1")  | 
| ResourceNotFoundExceptions  | The specified item or attribute was not found. | 

## Examples
<a name="API_UpdateItem_Examples"></a>

For examples using the AWS SDK, see [Working with items and attributes in DynamoDB](WorkingWithItems.md).

### Sample request
<a name="API_UpdateItem_Examples_Request"></a>

```
// This header is abbreviated. For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.UpdateItem
content-type: application/x-amz-json-1.0 

{"TableName":"comp5",
    "Key":
        {"HashKeyElement":{"S":"Julie"},"RangeKeyElement":{"N":"1307654350"}},
    "AttributeUpdates":
        {"status":{"Value":{"S":"online"},
        "Action":"PUT"}},
    "Expected":{"status":{"Value":{"S":"offline"}}},
    "ReturnValues":"ALL_NEW"
}
```

### Sample response
<a name="API_UpdateItem_Examples_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: 5IMHO7F01Q9P7Q6QMKMMI3R3QRVV4KQNSO5AEMVJF66Q9ASUAAJG
content-type: application/x-amz-json-1.0
content-length: 121
Date: Fri, 26 Aug 2011 21:05:00 GMT

{"Attributes":
    {"friends":{"SS":["Lynda, Aaron"]},
    "status":{"S":"online"},
    "time":{"N":"1307654350"},
    "user":{"S":"Julie"}},
"ConsumedCapacityUnits":1
}
```

## Related actions
<a name="API_UpdateItem_Related_Actions"></a>
+  [PutItem](API_PutItem_v20111205.md) 
+  [DeleteItem](API_DeleteItem_v20111205.md) 

# UpdateTable
<a name="API_UpdateTable_v20111205"></a>

**Important**  
***This section refers to API version 2011-12-05, which is deprecated and should not be used for new applications.***  
 **For documentation on the current low-level API, see the [Amazon DynamoDB API Reference](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/).**

## Description
<a name="API_updatetable_Description"></a>

Updates the provisioned throughput for the given table. Setting the throughput for a table helps you manage performance and is part of the provisioned throughput feature of DynamoDB. For more information, see [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md).

The provisioned throughput values can be upgraded or downgraded based on the maximums and minimums listed in [Quotas in Amazon DynamoDB](ServiceQuotas.md).

The table must be in the `ACTIVE` state for this operation to succeed. UpdateTable is an asynchronous operation; while executing the operation, the table is in the `UPDATING` state. While the table is in the `UPDATING` state, the table still has the provisioned throughput from before the call. The new provisioned throughput setting is in effect only when the table returns to the `ACTIVE` state after the UpdateTable operation. 

## Requests
<a name="API_UpdateTable_RequestParameters"></a>

### Syntax
<a name="API_UpdateTable_RequestParameters.syntax"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.UpdateTable
content-type: application/x-amz-json-1.0

{"TableName":"Table1",
    "ProvisionedThroughput":{"ReadCapacityUnits":5,"WriteCapacityUnits":15}
}
```


****  

|  Name  |  Description  |  Required | 
| --- | --- | --- | 
|  TableName  |  The name of the table to update.  Type: String   |  Yes  | 
|  ProvisionedThroughput  | New throughput for the specified table, consisting of values for `ReadCapacityUnits` and `WriteCapacityUnits`. See [DynamoDB provisioned capacity mode](provisioned-capacity-mode.md).Type: Array  | Yes | 
| ProvisionedThroughput :ReadCapacityUnits |  Sets the minimum number of consistent `ReadCapacityUnits` consumed per second for the specified table before DynamoDB balances the load with other operations.  Eventually consistent read operations require less effort than a consistent read operation, so a setting of 50 consistent `ReadCapacityUnits` per second provides 100 eventually consistent `ReadCapacityUnits` per second. Type: Number  | Yes | 
| ProvisionedThroughput :WriteCapacityUnits |  Sets the minimum number of `WriteCapacityUnits` consumed per second for the specified table before DynamoDB balances the load with other operations. Type: Number  | Yes | 

## Responses
<a name="API_UpdateTable_ResponseElements"></a>

### Syntax
<a name="API_UpdateTable_ResponseElements.syntax"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG
Content-Type: application/json
Content-Length: 311
Date: Tue, 12 Jul 2011 21:31:03 GMT

{"TableDescription":
    {"CreationDateTime":1.321657838135E9,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"AttributeValue1","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"AttributeValue2","AttributeType":"N"}},
    "ProvisionedThroughput":
        {"LastDecreaseDateTime":1.321661704489E9,
        "LastIncreaseDateTime":1.321663607695E9,
        "ReadCapacityUnits":5,
        "WriteCapacityUnits":10},
    "TableName":"Table1",
    "TableStatus":"UPDATING"}}
```


****  

|  Name  |  Description  | 
| --- | --- | 
| CreationDateTime | Date when the table was created.Type: Number | 
|  KeySchema  | The primary key (simple or composite) structure for the table. A name-value pair for the `HashKeyElement` is required, and a name-value pair for the `RangeKeyElement` is optional (only required for composite primary keys). The maximum hash key size is 2048 bytes. The maximum range key size is 1024 bytes. Both limits are enforced separately (i.e. you can have a combined hash \$1 range 2048 \$1 1024 key). For more information about primary keys, see [Primary key](HowItWorks.CoreComponents.md#HowItWorks.CoreComponents.PrimaryKey).Type: Map of `HashKeyElement`, or `HashKeyElement` and `RangeKeyElement` for a composite primary key. | 
| ProvisionedThroughput | Current throughput settings for the specified table, including values for `LastIncreaseDateTime` (if applicable), `LastDecreaseDateTime` (if applicable), Type: Array  | 
|  TableName  |  The name of the updated table. Type: String  | 
|  TableStatus  | The current state of the table (CREATING, ACTIVE, DELETING or UPDATING), which should be UPDATING. Use the [DescribeTables](API_DescribeTables_v20111205.md) operationto check the status of the table. Type: String | 

## Special errors
<a name="API_UpdateTable_SpecialErrors"></a>


****  

|  Error  |  Description  | 
| --- | --- | 
| ResourceNotFoundException  | The specified table was not found.  | 
| ResourceInUseException | The table is not in the ACTIVE state. | 

## Examples
<a name="API_UpdateTable_Examples"></a>

### Sample request
<a name="API_UpdateTable_Examples_Request"></a>

```
// This header is abbreviated. 
// For a sample of a complete header, see DynamoDB low-level API.
POST / HTTP/1.1 
x-amz-target: DynamoDB_20111205.UpdateTable
content-type: application/x-amz-json-1.0

{"TableName":"comp1",
    "ProvisionedThroughput":{"ReadCapacityUnits":5,"WriteCapacityUnits":15}
}
```

### Sample response
<a name="API_UpdateTable_Examples_Response"></a>

```
HTTP/1.1 200 OK
content-type: application/x-amz-json-1.0
content-length: 390
Date: Sat, 19 Nov 2011 00:46:47 GMT

{"TableDescription":
    {"CreationDateTime":1.321657838135E9,
    "KeySchema":
        {"HashKeyElement":{"AttributeName":"user","AttributeType":"S"},
        "RangeKeyElement":{"AttributeName":"time","AttributeType":"N"}},
    "ProvisionedThroughput":
        {"LastDecreaseDateTime":1.321661704489E9,
        "LastIncreaseDateTime":1.321663607695E9,
        "ReadCapacityUnits":5,
        "WriteCapacityUnits":10},
    "TableName":"comp1",
    "TableStatus":"UPDATING"}
}
```

## Related actions
<a name="API_UpdateTable_Related_Actions"></a>
+  [CreateTable](API_CreateTable_v20111205.md) 
+  [DescribeTables](API_DescribeTables_v20111205.md) 
+  [DeleteTable](API_DeleteTable_v20111205.md) 