Delete both types of images (UserIcon and TransactionIcon)

Delete Icon (UserIcon and TransactionIcon)

The POST /Files/deleteIcon endpoint removes an uploaded image from the system. When a transactionId is provided, the image linked to that specific transaction is deleted. When transactionId is omitted, the authenticated user's avatar is deleted instead.

Endpoint

POST /Files/deleteIcon

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 to clean up transaction icons that are no longer needed or to remove a user's avatar image. The conditional behavior — deleting a transaction icon when transactionId is supplied, or falling back to the user avatar when it is not — means a single endpoint handles both image types. This is particularly useful during account or transaction management workflows where stale or outdated images must be cleared.

Request Body

FieldTypeRequiredDescription
transactionIdstringNoID of the transaction whose icon should be deleted. Omit this field to delete the authenticated user's avatar instead.
{
  "transactionId": "txn_a1b2c3d4e5f6"
}

To delete the user's avatar, send an empty body or omit the field entirely:

{}

Response

200 OK

Returns an empty 200 OK response when the image was successfully deleted. No response body is returned.

Error Codes

CodeWhen it happens
400Missing required fields or validation error
401Token missing, expired, or invalid
403Insufficient permissions
404No image found for the given transactionId, or no avatar exists for the user
500Internal server error — image could not be deleted

Common Mistakes

  • Sending a transactionId that does not exist or belongs to a different user results in a 404 response; verify the ID before calling this endpoint.
  • Expecting a response body on success — the endpoint returns 200 OK with no payload; treat any non-error HTTP status as confirmation of deletion.
  • Forgetting that omitting transactionId targets the user avatar, not a transaction icon — always include the field explicitly when intending to delete a transaction icon to avoid accidentally removing the user's avatar.

Related Endpoints

  • POST /Files/uploadIcon — Upload a UserIcon or TransactionIcon image
  • GET /Files/getIcon — Retrieve an uploaded icon for a transaction or user avatar

Example

Delete a transaction icon:

curl -X POST https://api.banking.netevia.dev/Files/deleteIcon \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"transactionId": "txn_a1b2c3d4e5f6"}'

Delete the user's avatar (omit transactionId):

curl -X POST https://api.banking.netevia.dev/Files/deleteIcon \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Body Params

Request needs for delete TransactionIcon only

string | null
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:
Responses
200

returns Ok() when image was deleted

500

Can't delete image due to internal error

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