# Patch file meta by id

`PATCH /files/{id}`



[Files API guide](https://docs.contextual.io/tenants/tenant-apis/files-api.md)

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Files Api",
    "description": " ",
    "version": "1.6.3"
  },
  "security": [
    {
      "jwt": []
    }
  ],
  "servers": [
    {
      "url": "https://files.prod-001.prod.contextual.io/api/v1"
    }
  ],
  "paths": {
    "/files/{id}": {
      "patch": {
        "tags": [
          "Files"
        ],
        "summary": "Patch file meta by id",
        "parameters": [
          {
            "name": "x-if-hash-match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^\\/meta\\/"
                            },
                            {
                              "pattern": "^\\/meta\\/(?!path|contentType|contentMD5|size)"
                            }
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "op": {
                          "type": "string",
                          "const": "add"
                        }
                      },
                      "required": [
                        "path",
                        "value",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^\\/meta\\/"
                            },
                            {
                              "pattern": "^\\/meta\\/(?!path|contentType|contentMD5|size)"
                            }
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "op": {
                          "type": "string",
                          "const": "set"
                        }
                      },
                      "required": [
                        "path",
                        "value",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^\\/meta\\/"
                            },
                            {
                              "pattern": "^\\/meta\\/(?!path|contentType|contentMD5|size)"
                            }
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "op": {
                          "type": "string",
                          "const": "replace"
                        }
                      },
                      "required": [
                        "path",
                        "value",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^\\/meta\\/"
                            },
                            {
                              "pattern": "^\\/meta\\/(?!path|contentType|contentMD5|size)"
                            }
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {}
                            },
                            {
                              "type": "array",
                              "items": {}
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "op": {
                          "type": "string",
                          "const": "incr"
                        }
                      },
                      "required": [
                        "path",
                        "value",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "op": {
                          "type": "string",
                          "const": "remove"
                        },
                        "path": {
                          "type": "string",
                          "allOf": [
                            {
                              "pattern": "^\\/meta\\/"
                            },
                            {
                              "pattern": "^\\/meta\\/(?!path|contentType|contentMD5|size)"
                            }
                          ]
                        }
                      },
                      "required": [
                        "op",
                        "path"
                      ],
                      "additionalProperties": false
                    }
                  ],
                  "type": "object"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File meta updated successfully",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid authorization header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Invalid permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "File not found",
            "content": {}
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "$ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "number"
            ]
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    }
  }
}
```