---
type: api
title: Set allocator metadata
description: Sets the allocator metadata.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-set-allocator-metadata
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/operation/operation-set-allocator-metadata
products:
  - Elastic Cloud Enterprise
---

# Set allocator metadata

## Paths

- `PUT` `/platform/infrastructure/allocators/{allocator_id}/metadata`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/v4/authentication#apikey)

#### Path Parameters

- `allocator_id` (string)
  The allocator identifier.

## Description

Sets the allocator metadata.

## Query String Parameters

- `version` (string)
  Checks for conflicts against the metadata version, then returns the value in the `x-cloud-resource-version` header.

## Request Body

`application/json`

The metadata to update the allocator with

- `items` ([] MetadataItem) — required
  A collection of arbitrary metadata items associated with a resource.
  - `key` (string) — required
    The metadata field name
  - `value` (string) — required
    The metadata value

## Responses

#### `200`

The allocator metadata was successfully changed (the updated JSON is returned)

`application/json`

Type: `[] MetadataItem`

- `key` (string)
  The metadata field name
- `value` (string)
  The metadata value
#### `400`

The value specified is empty for at least one of the metadata tags. (code: `allocators.invalid_empty_metadata_items`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

#### `404`

The allocator specified by {allocator_id} cannot be found. (code: `allocators.allocator_not_found`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
PUT /platform/infrastructure/allocators/{allocator_id}/metadata
```

#### curl

```curl
curl -X PUT "/platform/infrastructure/allocators/{allocator_id}/metadata"
```

