Add attachment to ticket

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

FieldTypeRequiredDescription
ticketIdinteger (int32)NoThe unique identifier of the ticket to attach the file to.
ticketMessageIdinteger (int32)NoThe unique identifier of a specific ticket message to associate the attachment with.
fileNamestringYesThe name of the file being uploaded (e.g., statement.pdf).
contentTypestringYesThe MIME type of the file (e.g., application/pdf, image/png).
fileBase64stringYesThe Base64-encoded content of the file.
{
  "ticketId": 100234,
  "ticketMessageId": 500789,
  "fileName": "bank_statement_aug2024.pdf",
  "contentType": "application/pdf",
  "fileBase64": "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURlY29kZT4+CnN0cmVhbQp4nC..."
}

Response

200 OK

FieldTypeDescription
ticketMessageIdinteger (int32) | nullThe identifier of the ticket message the attachment is linked to.
fileNamestring | nullThe stored file name of the attachment.
contentTypestring | nullThe MIME type of the uploaded file.
fileBase64string | nullThe Base64-encoded content of the stored file.
createdDatestring (date-time)The UTC timestamp when the attachment was created.
originalFileNamestring | nullThe 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

CodeWhen it happens
400Missing required fields (fileName, contentType, or fileBase64), or the Base64 payload is malformed
401Token missing, expired, or invalid
403Insufficient permissions to attach files to the specified ticket
404The specified ticketId or ticketMessageId does not exist
500Internal server error while processing the upload

Common Mistakes

  • Omitting fileName, contentType, or fileBase64 — 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 contentType that does not match the actual file format, which may cause downstream issues when the attachment is rendered or downloaded.
  • Supplying a ticketId that 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 ticket
  • GET /api/tickets — Retrieve a list of support tickets for the authenticated user
  • POST /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..."
  }'
Body Params
int32
int32 | null
string
required
length ≥ 1
string
required
length ≥ 1
string
required
length ≥ 1
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json