put
https://app.fracttal.com/api/work_requests_attachments_files/-1
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.
PUT https://app.fracttal.com/api/work_requests_attachments_files/{id}Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes (in the path) | Attachment identifier. It can be queried here. (field id) It is also accepted in the body. |
user_code | text | Yes | Code of the human resource performing the edit. It must have an active user account; that account is used to validate the edit permission. |
url | text | Conditional | New attachment URL. Only applies to Link attachments. It must start with http:// or https:// and be at most 2048 characters long. |
label | text | Conditional | New visible text of the attachment (Link or File). Maximum 500 characters. |
Editing rules
- You must send at least
urlorlabel. 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,
urlcannot be changed: if you send it, the service respondsURL_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_codeneeds 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
| Parameter | Type | Description |
|---|---|---|
success | boolean | true if the edit was performed. |
message | text | ACTION_DONE when the operation succeeds. On error, it contains the error code. |
total | integer | 1 when the operation succeeds. |
data | object | Updated attachment. |
data.id | integer | Attachment identifier. |
data.id_company | integer | Company the attachment belongs to. |
data.id_request | integer | Work request the attachment belongs to. |
data.id_status | integer | Status recorded with the attachment. |
data.path | text | File: identifier of the stored file. Link: the URL. |
data.description | text | Visible text of the attachment (label). |
data.date | text | Attachment creation date. |
data.size | integer | Size in bytes. 0 for Link attachments. |
data.type | integer | Attachment type: 1 = File, 2 = Link. |
Errors
| Code | Cause |
|---|---|
400 | Validation failed. Invalid fields: id or user_code is missing. |
400 | At least one field to update must be provided: url or label: neither url nor label was sent (or they were empty). |
400 | URL_NOT_APPLICABLE_FOR_FILE_ATTACHMENTS: url was sent for a File attachment. |
400 | UNSUPPORTED_ATTACHMENT_TYPE: the attachment type cannot be edited with this service. |
400 | REQUEST_NOT_EDITABLE: the request status does not allow editing attachments. |
400 | INVALID_URL: the URL does not start with http:// or https://. |
400 | URL_TOO_LONG: the URL exceeds 2048 characters. |
400 | LABEL_TOO_LONG: the label exceeds 500 characters. |
403 | The user_code user does not have edit permission over the request, does not have access to its location, or their account is deactivated. |
404 | ATTACHMENT_NOT_FOUND: the attachment does not exist or belongs to another company. |
404 | The user_code does not exist, is inactive, or has no associated user account. |
401 | INVALID_TOKEN: the authentication token is not valid. |
Note on error codesWhen the operation fails, the error code is returned in the
messagefield (for example"403"or"404") and the detail indata[0].ERROR. The HTTP response for these errors is400, regardless of themessagevalue; usemessageto 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
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)
url (400){
"success": false,
"message": "400",
"total": 0,
"data": [
{ "ERROR": "URL_NOT_APPLICABLE_FOR_FILE_ATTACHMENTS" }
]
}Response — Attachment not found (404)
404){
"success": false,
"message": "404",
"total": 0,
"data": [
{ "ERROR": "ATTACHMENT_NOT_FOUND" }
]
}Response — No edit permission (403)
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
}