Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CodexaCP/SERVICIOS-BACK/llms.txt

Use this file to discover all available pages before exploring further.

Beyond the required payment proof image submitted at request creation time, a service request can carry three additional file types: an optional customer attachment (for services that allow it), a fiscal invoice document uploaded by staff when the customer requested one, and a delivery confirmation document uploaded by staff when the service is completed. All uploaded files are saved to wwwroot/uploads/service-requests/ on the server disk and are served as static files. Each uploaded file is stored with a UUID-prefixed filename to avoid collisions.
The payment proof image itself is not managed by these endpoints — it is uploaded separately via POST /api/uploads/payment before creating the request. See Create & Retrieve for that flow.

POST /api/servicerequests//attachment — Upload optional attachment

Uploads an additional file attachment to a service request. This is only permitted when the associated service has PermiteAdjunto = 1 set in its service definition. The stored procedure CreateServiceRequestAttachment enforces this check and returns an error if the service does not allow attachments. Authentication: Bearer token (any role) Content type: multipart/form-data Max file size: 10 MB Accepted file types: Any (no extension restriction at the API layer)

Path parameters

id
integer
required
The requestId of the service request to attach the file to.

Form fields

file
file
required
The file to upload. Must be non-empty and no larger than 10 MB.

Response

attachmentId
integer
The auto-generated ID of the newly created attachment record.
{ "attachmentId": 45 }
Attempting to upload an attachment for a service that has PermiteAdjunto = 0 will return an error from the CreateServiceRequestAttachment stored procedure. Check the permiteAdjunto field on the service request detail (GET /api/servicerequests/{id}) before showing the upload UI to the user.

GET /api/servicerequests//attachment — Get attachment info

Returns the metadata of the optional attachment associated with a service request. Does not return the file content itself — use the rutaArchivo path to construct the full URL for download. Authentication: Bearer token (any role)

Path parameters

id
integer
required
The requestId of the service request whose attachment metadata you want to retrieve.

Response

Returns 404 Not Found if no attachment has been uploaded for the request.
id
integer
Auto-generated attachment record ID.
serviceRequestID
integer
ID of the parent service request.
nombreArchivo
string
Original filename as provided by the uploader.
rutaArchivo
string
Server-relative path to the file, e.g. /uploads/service-requests/uuid_filename.ext. Prefix with the server base URL to build a download link.
tamañoBytes
integer
File size in bytes.
fechaSubida
string (ISO 8601)
Timestamp when the file was uploaded.

POST /api/servicerequests//invoice — Upload invoice document

Uploads a fiscal invoice document for a service request that was created with requiresInvoice = true. This is a staff-only action performed after the payment has been approved and the service is in progress. Authentication: Bearer token — SUPER_ADMIN, ADMIN_GENERAL, or GESTOR_SUPREMO Content type: multipart/form-data Max file size: 10 MB Accepted file types: .pdf, .png, .jpg, .jpeg

Path parameters

id
integer
required
The requestId of the service request to attach the invoice to.

Form fields

file
file
required
The invoice file. Must be non-empty, no larger than 10 MB, and have an accepted extension (.pdf, .png, .jpg, or .jpeg). Returns 400 Bad Request for any other extension.

Response

invoiceUrl
string
Server-relative path where the invoice was saved, e.g. /uploads/service-requests/uuid_invoice.pdf.
{ "invoiceUrl": "/uploads/service-requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890_invoice.pdf" }

POST /api/servicerequests//delivery-attachment — Upload delivery confirmation

Uploads a delivery confirmation document when a service request is completed. This can be a signed delivery receipt, a photo, or any supporting document in an accepted format. Authentication: Bearer token — SUPER_ADMIN, ADMIN_GENERAL, GESTOR_SUPREMO, or GESTOR Content type: multipart/form-data Max file size: 10 MB Accepted file types: .pdf, .png, .jpg, .jpeg, .webp

Path parameters

id
integer
required
The requestId of the service request to attach the delivery document to.

Form fields

file
file
required
The delivery confirmation file. Must be non-empty, no larger than 10 MB, and have an accepted extension (.pdf, .png, .jpg, .jpeg, or .webp). Returns 400 Bad Request for any other extension.

Response

deliveryAttachmentUrl
string
Server-relative path where the delivery document was saved, e.g. /uploads/service-requests/uuid_delivery.pdf.
{ "deliveryAttachmentUrl": "/uploads/service-requests/b2c3d4e5-f6a7-8901-bcde-f01234567890_delivery.pdf" }

File storage

All files uploaded through these endpoints are saved to the wwwroot/uploads/service-requests/ directory on the server. Each file is renamed to {UUID}_{originalFilename} before saving to prevent collisions. The relative path stored in the database (/uploads/service-requests/...) can be prefixed with the server base URL to construct a publicly accessible download link, since the API serves static files from wwwroot.

Examples

Upload an optional attachment (customer)
curl -X POST https://your-api/api/servicerequests/123/attachment \
  -H "Authorization: Bearer <token>" \
  -F "file=@/path/to/document.pdf"
{ "attachmentId": 45 }
Get attachment metadata
curl https://your-api/api/servicerequests/123/attachment \
  -H "Authorization: Bearer <token>"
{
  "id": 45,
  "serviceRequestID": 123,
  "nombreArchivo": "document.pdf",
  "rutaArchivo": "/uploads/service-requests/a1b2c3d4-e5f6-7890-abcd-ef1234567890_document.pdf",
  "tamañoBytes": 204800,
  "fechaSubida": "2026-04-22T15:00:00"
}
Upload an invoice document (staff)
curl -X POST https://your-api/api/servicerequests/123/invoice \
  -H "Authorization: Bearer <admin-token>" \
  -F "file=@/path/to/invoice.pdf"
{ "invoiceUrl": "/uploads/service-requests/b2c3d4e5-f6a7-8901-bcde-f01234567890_invoice.pdf" }
Upload a delivery confirmation document (staff)
curl -X POST https://your-api/api/servicerequests/123/delivery-attachment \
  -H "Authorization: Bearer <staff-token>" \
  -F "file=@/path/to/delivery-receipt.jpg"
{ "deliveryAttachmentUrl": "/uploads/service-requests/c3d4e5f6-a7b8-9012-cdef-012345678901_delivery-receipt.jpg" }

Build docs developers (and LLMs) love