---
updatedAt: 2025-05-19T20:30:44.000Z
agentTools:
  projectIndex: https://developers.pocketsmith.com/llms.txt
---

# Update attachment

Updates the title of the attachment.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "PocketSmith",
    "description": "The PocketSmith API",
    "contact": {
      "name": "API Support",
      "email": "api@pocketsmith.com"
    },
    "version": "2.0"
  },
  "x-samples-languages": [
    "curl",
    "node",
    "javascript",
    "php",
    "python"
  ],
  "servers": [
    {
      "url": "https://api.pocketsmith.com/v2",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "developerKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Developer-Key",
        "description": "If you want to build a tool just for yourself, be it a desktop widget to display your balances or a tool to import transactions from a bank without a bank feed, you can use our developer keys feature. You can issue yourself a key which will give you persistent API access to just your account. You should rotate your keys regularly."
      }
    },
    "responses": {
      "403": {
        "description": "Not Allowed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "Not Found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "422": {
        "description": "Validation Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The unique identifier of the attachment",
            "example": 42
          },
          "title": {
            "type": "string",
            "description": "The title of the attachment. If blank or not provided, the title will be derived from the file name.",
            "example": "Invoice for taxi"
          },
          "file_name": {
            "type": "string",
            "description": "The file name of the attachment.",
            "example": "taxi.png"
          },
          "type": {
            "type": "string",
            "description": "The type of attachment.",
            "example": "image"
          },
          "content_type": {
            "type": "string",
            "description": "The content type of the attachment.",
            "example": "image/png"
          },
          "content_type_meta": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "The content type title of the attachment.",
                "example": "PNG"
              },
              "description": {
                "type": "string",
                "description": "The content type description of the attachment.",
                "example": "PNG image"
              },
              "extension": {
                "type": "string",
                "description": "The extension type of the attachment.",
                "example": "png"
              }
            }
          },
          "original_url": {
            "type": "string",
            "description": "The url of the attachment.",
            "example": "https://image.com/image.png"
          },
          "variants": {
            "type": "object",
            "properties": {
              "large_url": {
                "type": "string",
                "description": "The url of the large version of the attachment.",
                "example": "https://image.com/image.png"
              },
              "thumb_url": {
                "type": "string",
                "description": "The url of the thumb version of the attachment.",
                "example": "https://image.com/image.png"
              }
            }
          },
          "created_at": {
            "type": "string",
            "description": "When the attachment was created.",
            "format": "ISO 8601 timestamp",
            "example": "2015-08-16T02:17:02Z"
          },
          "updated_at": {
            "type": "string",
            "description": "When the attachment was last updated.",
            "format": "ISO 8601 timestamp",
            "example": "2015-08-16T02:17:02Z"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A message describing the error that occurred.",
            "example": "A message describing the error that occurred."
          }
        }
      }
    }
  },
  "paths": {
    "/attachments/{id}": {
      "put": {
        "summary": "Update attachment",
        "description": "Updates the title of the attachment.",
        "tags": [
          "Attachments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique identifier of the attachment.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 42
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "The new title of the attachment. If the title is blank or not provided, the server will derive a title from the file name.",
                    "example": "Invoice for taxi"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "422": {
            "$ref": "#/components/responses/422"
          }
        }
      }
    }
  },
  "security": [
    {
      "developerKey": []
    }
  ]
}
```