Edit an attachment of a work request

Modifies an attachment already linked to a work request. For a Link attachment you can change the URL and/or the visible text (label); for a File attachment you can only change the visible text.

Add-on

General use — no specific add-on required.

PUT https://app.fracttal.com/api/work_requests_attachments_files/{id}

Input parameters

ParameterTypeRequiredDescription
idintegerYes (in the path)Attachment identifier. It can be queried here. (field id) It is also accepted in the body.
user_codetextYesCode of the human resource performing the edit. It must have an active user account; that account is used to validate the edit permission.
urltextConditionalNew attachment URL. Only applies to Link attachments. It must start with http:// or https:// and be at most 2048 characters long.
labeltextConditionalNew visible text of the attachment (Link or File). Maximum 500 characters.

Editing rules

  • You must send at least url or label. An empty value or one with only spaces is treated as not sent.
  • If you send only one of the two fields, the other keeps its current value.
  • For a File attachment, url cannot be changed: if you send it, the service responds URL_NOT_APPLICABLE_FOR_FILE_ATTACHMENTS.
  • The type of an attachment cannot be changed (from Link to File or vice versa).
  • The request must be in status Open (1), In process (2) or Resolved without WO (4). In any other status the service responds REQUEST_NOT_EDITABLE.
  • The user in user_code needs edit permission over work requests and access to the request's location.
  • An attachment from another company is treated the same as a nonexistent one (ATTACHMENT_NOT_FOUND).

Output parameters

ParameterTypeDescription
successbooleantrue if the edit was performed.
messagetextACTION_DONE when the operation succeeds. On error, it contains the error code.
totalinteger1 when the operation succeeds.
dataobjectUpdated attachment.
data.idintegerAttachment identifier.
data.id_companyintegerCompany the attachment belongs to.
data.id_requestintegerWork request the attachment belongs to.
data.id_statusintegerStatus recorded with the attachment.
data.pathtextFile: identifier of the stored file. Link: the URL.
data.descriptiontextVisible text of the attachment (label).
data.datetextAttachment creation date.
data.sizeintegerSize in bytes. 0 for Link attachments.
data.typeintegerAttachment type: 1 = File, 2 = Link.

Errors

CodeCause
400Validation failed. Invalid fields: id or user_code is missing.
400At least one field to update must be provided: url or label: neither url nor label was sent (or they were empty).
400URL_NOT_APPLICABLE_FOR_FILE_ATTACHMENTS: url was sent for a File attachment.
400UNSUPPORTED_ATTACHMENT_TYPE: the attachment type cannot be edited with this service.
400REQUEST_NOT_EDITABLE: the request status does not allow editing attachments.
400INVALID_URL: the URL does not start with http:// or https://.
400URL_TOO_LONG: the URL exceeds 2048 characters.
400LABEL_TOO_LONG: the label exceeds 500 characters.
403The user_code user does not have edit permission over the request, does not have access to its location, or their account is deactivated.
404ATTACHMENT_NOT_FOUND: the attachment does not exist or belongs to another company.
404The user_code does not exist, is inactive, or has no associated user account.
401INVALID_TOKEN: the authentication token is not valid.

Note on error codes

When the operation fails, the error code is returned in the message field (for example "403" or "404") and the detail in data[0].ERROR. The HTTP response for these errors is 400, regardless of the message value; use message to tell the cause apart.


Example

Request body

PUT /api/work_requests_attachments_files/102

{
  "user_code": "1001",
  "url": "https://ejemplo.com/manual-equipo-v2",
  "label": "Manual del equipo (versión 2)"
}

Response 200

{
  "success": true,
  "message": "ACTION_DONE",
  "data": {
    "id": 102,
    "id_company": 188,
    "id_request": 4010,
    "id_status": 1,
    "path": "https://ejemplo.com/manual-equipo-v2",
    "description": "Manual del equipo (versión 2)",
    "date": "2026-10-06",
    "size": 0,
    "type": 2
  },
  "total": 1
}

Response — File with url (400)

{
  "success": false,
  "message": "400",
  "total": 0,
  "data": [
    { "ERROR": "URL_NOT_APPLICABLE_FOR_FILE_ATTACHMENTS" }
  ]
}

Response — Attachment not found (404)

{
  "success": false,
  "message": "404",
  "total": 0,
  "data": [
    { "ERROR": "ATTACHMENT_NOT_FOUND" }
  ]
}

Response — No edit permission (403)

{
  "success": false,
  "message": "403",
  "total": 0,
  "data": [
    { "ERROR": "User does not have permission to edit request 4010" }
  ]
}

OpenAPI definition

{
  "openapi": "3.1.0",
  "info": {
    "title": "Work requests — attachments",
    "version": "2-En"
  },
  "servers": [
    { "url": "https://app.fracttal.com/api/work_requests_attachments_files" }
  ],
  "security": [{}],
  "paths": {
    "/{id}": {
      "put": {
        "summary": "Edit an attachment of a work request",
        "description": "",
        "operationId": "edit-an-attachment-of-a-work-request",
        "deprecated": false,
        "security": []
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
Path Params
integer
required

Work request code (id_code field).

Language
LoadingLoading…