# Upsert Package Metadata

Creates or overwrites metadata for a package.

Endpoint: POST /har/api/v3/packages/{id}/metadata
Version: 1.0
Security: x-api-key

## Query parameters:

  - `account_identifier` (string, required)
    Unique identifier for the Harness account.

## Path parameters:

  - `id` (string, required)

## Request fields (application/json):

  - `metadata` (array, required)
    Array of metadata key-value pairs
    Example: [{"key":"environment","value":"production"},{"key":"team","value":"backend"}]

  - `metadata.key` (string, required)
    The metadata key name (case-sensitive)
    Example: "environment"

  - `metadata.value` (string, required)
    The metadata value
    Example: "production"

## Response 200 fields (application/json):

  - `data` (array, required)
    Array of metadata entries

  - `data.id` (string, required)
    Unique identifier for this metadata entry

  - `data.key` (string, required)
    The metadata key name
    Example: "environment"

  - `data.type` (string, required)
    Indicates if metadata was manually added (MANUAL) or system-generated (AUTO)
    Enum: "MANUAL", "AUTO"

  - `data.value` (string, required)
    The metadata value
    Example: "production"

## Response default fields (application/json):

  - `error` (object, required)

  - `error.code` (string)
    For some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.

  - `error.message` (string)
    A human-readable message providing more details about the error. These messages can be shown to users.

  - `error.param` (string)
    If the error is parameter-specific, the parameter related to the error. For example, we can use this to display a message near the correct form field.

  - `error.type` (string, required)
    The type of error returned.
    Enum: "INVALID_REQUEST_ERROR", "AUTHENTICATION_ERROR", "PERMISSION_ERROR", "API_ERROR"


