# Update a file (/growsocmed/docs/api-reference/media/update-media)

Change a file's alt text, name, or whether it is kept (never deleted automatically)

PATCH /media/{id}

```json
{
  "tags": [
    "Media"
  ],
  "summary": "Update a file",
  "parameters": [
    {
      "schema": {
        "type": "string",
        "format": "uuid"
      },
      "required": true,
      "name": "id",
      "in": "path"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "alt_text": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 1000
            },
            "original_name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "keep": {
              "type": "boolean"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "media": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video",
                      "document"
                    ]
                  },
                  "page_count": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "ready",
                      "failed",
                      "expired"
                    ]
                  },
                  "original_name": {
                    "type": "string"
                  },
                  "mime_type": {
                    "type": "string"
                  },
                  "size_bytes": {
                    "type": "number"
                  },
                  "width": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "height": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "duration_ms": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "frame_rate": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "fail_reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "alt_text": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "keep": {
                    "type": "boolean",
                    "description": "Kept files are never deleted automatically"
                  },
                  "used_in_posts": {
                    "type": "number"
                  },
                  "expires_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "When the file is deleted automatically; null = never"
                  },
                  "url": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "created_at": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "type",
                  "status",
                  "original_name",
                  "mime_type",
                  "size_bytes",
                  "width",
                  "height",
                  "duration_ms",
                  "frame_rate",
                  "fail_reason",
                  "alt_text",
                  "keep",
                  "url",
                  "created_at"
                ]
              }
            },
            "required": [
              "media"
            ]
          }
        }
      }
    }
  },
  "operationId": "update-media",
  "description": "Change a file's alt text, name, or whether it is kept (never deleted automatically)"
}
```