How do I add a meta tag when creating a node via REST API? So I have this code, using Guzzle POSTing to create node via Drupal REST API.
No error, but the field_meta_tags value is empty  on the node created (still using default [node:summary] for the meta description).

$node = array(
'title' =&gt; array(0 =&gt; array('value' =&gt; 'asd')),
'type' =&gt; array(0 =&gt; array('target_id' =&gt; 'page')),
'path' =&gt; array(0 =&gt; array('alias' =&gt; $pathalias)),
'field_meta_tags' =&gt; array(
  'title' =&gt; 'asd',
  'description' =&gt; 'asd',
  'keywords' =&gt; 'asd',
),
'body' =&gt; array(0 =&gt; array('value' =&gt; 'huehuehue')),
);

$response = $client-&gt;post($base_url . '/entity/node', array(
  'cookies' =&gt; $jar,
  'query' =&gt; array(
    '_format' =&gt; 'json',
  ),
  'headers' =&gt; array(
    'Accept' =&gt; 'application/json',
    'Content-Type' =&gt; 'application/json',
    'X-CSRF-Token' =&gt; $csrf_token,
  ),
  'json' =&gt; $node
));


I also try using array structure like this:

'field_meta_tags' =&gt; array(0 =&gt; array(
  'title' =&gt; 'asd',
  'description' =&gt; 'asd',
  'keywords' =&gt; 'asd,
)),


But still no luck. 

What is the correct format to provide metatag value? Or is there another thing that I might need to check?
I copy/paste the following snippets from the readme file of the metatag module.
I can see that you are missing the serialize function in your solution.
Hopefully that helps you.

Programmatically assign meta tags to an entity
--------------------------------------------------------------------------------
There are two ways to assign an entity's meta tags in custom module. Both
scenarios require a "Metatag" field be added to the entity's field settings, the
field name "field_meta_tags" is used but this is completely arbitrary.

Option 1:

  $entity_type = 'node';
  $values = [
    'nid' =&gt; NULL,
    'type' =&gt; 'article',
    'title' =&gt; 'Testing metatag creation',
    'uid' =&gt; 1,
    'status' =&gt; TRUE,
    'field_meta_tags' =&gt; serialize([
      'title' =&gt; 'Some title',
      'description' =&gt; 'Some description.',
      'keywords' =&gt; 'Some,Keywords',
    ]),
  ];
  $node = \Drupal::entityTypeManager()-&gt;getStorage($entity_type)-&gt;create($values);
  $node-&gt;save();

Option 2:

  $node = Node::create(array(
    'type' =&gt; article,
    'langcode' =&gt; 'en',
    'status' =&gt; 1,
    'uid' =&gt; 1,
  ));
  $node-&gt;set('title', 'Testing metatag creation');
  $node-&gt;set('field_meta_tags', serialize([
    'title' =&gt; 'Some title',
    'description' =&gt; 'Some description.',
    'keywords' =&gt; 'Some,Keywords',
  ]));
  $node-&gt;save();

In both examples, the custom meta tag values will still be merged with the
values defined via the global defaults prior to being output - it is not
necessary to copy each value to the new record.