# Updating Metadata on the atPlatform

atProtocol exposes various attributes that can be set as the metadata for a key.

Please refer to the [AtMetadata](https://github.com/atsign-foundation/at_server/blob/master/at_secondary/at_persistence_secondary_server/lib/src/model/at_meta_data.dart) class for the complete list of metadata attributes.

The focus of this article is on how to update the metadata of a key.

Description:

The update:meta verb is used for updating the metadata of a key. If a key is already present, the metadata is updated. If a key is not present, a new key is created with the given metadata with a ‘null’ value. Users can add the value using the update verb.

Please refer to [update\_meta\_verb\_handler](https://github.com/atsign-foundation/at_server/blob/master/at_secondary/at_secondary_server/lib/src/verb/handler/update_meta_verb_handler.dart) for implementation.

SDK offers the ‘ putMeta’ method to update the metadata of a key.

Updating metadata of a key using the SDK.

```plaintext
var currentAtSign = '@alice';

//Creating AtClient SDK instance.
await AtClientImpl.createClient(
   currentAtSign, 'me', TestUtil.getAlicePreference());

// Getting atClient Instance
var atClient = await AtClientImpl.getClient(currentAtSign);

var metadata = Metadata()..ttl = 600000
                         ..ttb = 600000;
var atKey = AtKey()..phone
                   ..sharedWith = ‘@bob’
                   ..sharedBy=’@alice’
                   ..metadata=metadata;
var result  = await atClient.putMeta(atKey);
```

The AtClient exposes the ‘getMeta’ which can be used to get the metadata of the key. The ‘getMeta’ method returns metadata in a JSON String.

```plaintext
var currentAtSign = '@alice';

//Creating AtClient SDK instance.
await AtClientImpl.createClient(
   currentAtSign, 'me', TestUtil.getAlicePreference());

// Getting atClient Instance
var atClient = await AtClientImpl.getClient(currentAtSign);

var atKey = AtKey()
 ..key = 'phone'
 ..sharedWith = '@bob
 ..sharedBy = '@alice';
var metadata = await atClient.getMeta(atKey);
```

Response :

```plaintext
Metadata{ttl: 600000, ttb: 600000, ttr: null,ccd: null, isPublic: false, isHidden: false, availableAt : 2021-02-18 02:40:03.207Z, expiresAt : 2021-02-18 02:50:03.207Z, refreshAt : null, createdAt : 2021-02-18 02:30:03.207Z,updatedAt : 2021-02-18 02:45:03.207Z,isBinary : null, isEncrypted : null, isCached : false, dataSignature: null}
```

For more samples, please refer to update\_meta\_verb\_test.

We are working to make the internet better. Please come code with us!!!
