# The atPlatform : The 'batch' verb

## Introduction

The batch verb in the atPlatform allows multiple commands to be sent in a single call to the secondary server. Developers of apps can leverage the batch feature to send multiple commands, thereby reducing the number of network calls from the device to the secondary server.

## 1\. Usage

### 1.1 Sample Request

```plaintext
[{"id":1,"command":"update:public:phone@alice +1 111 1111”},
{"id":2,"command":"update:@alice:phone@alice +1 222 2222”},
{"id":3,"command":"delete:public:phone@alice”}]
```

### 1.2 Sample Response

```plaintext
data:[{"id":1,"response":{"data":10}},
     {"id":2,"response":{"data":11}},
     {"id":3,"response":{"data":12}}]
```

### 2.1 Invalid command in batch

```plaintext
[{"id":1,"command":"update:public:phone@alice +1 111 1111”},
{"id":2,"command":"update:@alice:phone@alice”}]
```

### 2.2 Sample error response

```plaintext
data:[[{"id":1,"response":{"data":13}}, {"id":2,"response":{"error_code":"AT0003","error_message":"Invalid syntax"}}]
```

Refer to the [BatchVerbHandler](https://github.com/atsign-foundation/at_server/blob/master/at_secondary/at_secondary_server/lib/src/verb/handler/batch_verb_handler.dart) to learn more about this verb.

## Coming Soon

The batch verb has not yet been exposed in our [SDK](https://github.com/atsign-foundation/at_client_sdk) . We plan to do that soon.
