Submit Defense
Use this endpoint to register a defense for a specific MED by its id, with optional text and attachments.
Available Environments
- Production
https://api.gateway.com.br/core
Endpoint
- Method:
POST - Endpoint:
/med/{id}/appeal - Authentication: Bearer token
- Content-Type:
multipart/form-data
Path Params
| Name | Type | Required | Description | Validations |
|---|---|---|---|---|
id | string (UUID v4) | Yes | MED identifier | Must be a valid UUID v4 |
Body (multipart/form-data)
| Name | Type | Required | Description | Validations |
|---|---|---|---|---|
message | string | No | Defense message | Text field of the defense (AppealMedInput), between 2 and 1000 characters |
files | file[] | No | Evidence files | Send multiple files under the same files field; allowed extensions: .jpg, .jpeg, .png, .pdf, .txt, .xls, .xlsx, .ico |
Request Example (with every field)
- cURL
- JavaScript
curl --request POST \
--url https://api.gateway.com.br/core/med/553e8400-e29b-41d4-a716-436251480000/appeal \
--header 'Authorization: Bearer your-jwt-token' \
--form 'message=Anexamos comprovante de entrega e autenticação da compra.' \
--form 'files=@C:/evidencias/comprovante-entrega.pdf' \
--form 'files=@C:/evidencias/print-rastreio.png'
const formData = new FormData();
formData.append('message', 'Anexamos comprovante de entrega e autenticação da compra.');
formData.append('files', fileInput.files[0]);
formData.append('files', fileInput.files[1]);
const response = await fetch('https://api.gateway.com.br/core/med/553e8400-e29b-41d4-a716-436251480000/appeal', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-jwt-token'
},
body: formData
});
Success Response
| Code | Description |
|---|---|
201 Created | Defense registered successfully |
ℹ️ Response body
This endpoint returns 201 and has no response payload.
Possible Errors
| Code | Description | Solution |
|---|---|---|
| 400 | Invalid request | Check the multipart/form-data format and the files field |
| 401 | Invalid credentials | Check your credentials |
| 403 | No permission/authorization | Contact support |
| 404 | MED not found | Check the id you sent |
| 422 | Invalid or missing data | Check the content of the defense and the files sent |
| 500 | Internal error | Contact support |