# Update a chat completion
URL: https://docs.munito.ai/api/updateChatCompletion

POST /chat/completions/{completion_id}

Replaces the `metadata` of a completion that was created with `store: true`. Metadata is the only field you can change. Send `null` to clear it.

```json
{
  "operationId": "updateChatCompletion",
  "summary": "Update a chat completion",
  "tags": [
    "Completions"
  ],
  "description": "Replaces the `metadata` of a completion that was created with `store: true`. Metadata is the only field you can change. Send `null` to clear it.",
  "parameters": [
    {
      "name": "completion_id",
      "in": "path",
      "required": true,
      "description": "The completion id to update.",
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "metadata"
          ],
          "additionalProperties": false,
          "properties": {
            "metadata": {
              "type": "object",
              "description": "Up to 16 string pairs, or `null`. A key has at most 64 characters, and a value at most 512 characters.",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        },
        "example": {
          "metadata": {
            "team": "research"
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The chat completion object with the new metadata."
    },
    "400": {
      "description": "The body holds a field other than `metadata`, or the metadata is not valid."
    },
    "404": {
      "description": "No completion with this id is stored in your workspace."
    }
  }
}
```

# Shared API schemas
{
  "securitySchemes": {
    "BearerAuth": {
      "type": "http",
      "scheme": "bearer",
      "description": "Your Munito API key."
    },
    "ApiKeyAuth": {
      "type": "apiKey",
      "in": "header",
      "name": "x-api-key",
      "description": "Your Munito API key."
    }
  }
}