Add Attachment to Ticket
This endpoint allows authorized users to upload a file attachment to an existing support or service ticket. The file must be Base64-encoded and submitted along with its name and MIME content type. Attachments can optionally be associated with a specific ticket message.
Endpoint
POST /api/tickets/attachment
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a partner or end user needs to provide supporting documentation for an open support ticket — for example, uploading a screenshot, statement, or signed form. The attachment is linked to the ticket (and optionally to a specific message within that ticket), giving the support team immediate access to the file during issue resolution.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
ticketId | integer (int32) | No | The unique identifier of the ticket to attach the file to. |
ticketMessageId | integer (int32) | No | The unique identifier of a specific ticket message to associate the attachment with. |
fileName | string | Yes | The name of the file being uploaded (e.g., statement.pdf). |
contentType | string | Yes | The MIME type of the file (e.g., application/pdf, image/png). |
fileBase64 | string | Yes | The Base64-encoded content of the file. |
{
"ticketId": 100234,
"ticketMessageId": 500789,
"fileName": "bank_statement_aug2024.pdf",
"contentType": "application/pdf",
"fileBase64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURlY29kZT4+CnN0cmVhbQp4nC..."
}Response
200 OK
| Field | Type | Description |
|---|---|---|
ticketMessageId | integer (int32) | null | The identifier of the ticket message the attachment is linked to. |
fileName | string | null | The stored file name of the attachment. |
contentType | string | null | The MIME type of the uploaded file. |
fileBase64 | string | null | The Base64-encoded content of the stored file. |
createdDate | string (date-time) | The UTC timestamp when the attachment was created. |
originalFileName | string | null | The original file name provided at upload time. |
{
"ticketMessageId": 500789,
"fileName": "bank_statement_aug2024.pdf",
"contentType": "application/pdf",
"fileBase64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURlY29kZT4+CnN0cmVhbQp4nC...",
"createdDate": "2024-08-15T10:30:00Z",
"originalFileName": "bank_statement_aug2024.pdf"
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields (fileName, contentType, or fileBase64), or the Base64 payload is malformed |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to attach files to the specified ticket |
| 404 | The specified ticketId or ticketMessageId does not exist |
| 500 | Internal server error while processing the upload |
Common Mistakes
- Omitting
fileName,contentType, orfileBase64— all three are required fields; the request will be rejected with a 400 error. - Passing a raw binary file instead of a Base64-encoded string in
fileBase64— the value must be properly Base64-encoded before submission. - Using an incorrect MIME type in
contentTypethat does not match the actual file format, which may cause downstream issues when the attachment is rendered or downloaded. - Supplying a
ticketIdthat does not belong to the authenticated user's account, resulting in a 403 or 404 response.
Related Endpoints
POST /api/tickets/message— Add a text message or comment to an existing ticketGET /api/tickets— Retrieve a list of support tickets for the authenticated userPOST /api/tickets— Create a new support ticket
Example
curl -X POST https://api.banking.netevia.dev/api/tickets/attachment \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ticketId": 100234,
"ticketMessageId": 500789,
"fileName": "bank_statement_aug2024.pdf",
"contentType": "application/pdf",
"fileBase64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURlY29kZT4+CnN0cmVhbQp4nC..."
}'