Attachments
Base URL: https://app.neuroflash.com/api/attachment-service
Upload Attachment
POST
/conversations/{conversation_id}/attachmentsPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | Yes |
Request Body
FieldTypeRequiredDescription
base64ContentobjectNoBase64-encoded file content. Mutually exclusive with contentUrl; exactly one of the two must be provided. Maximum decoded file size is 10 MB.contentUrlobjectNoHTTP(S) URL the file content is downloaded from. Mutually exclusive with base64Content; exactly one of the two must be provided. Maximum downloaded file size is 10 MB.mimeTypeobjectNoMIME type of the file. Optional for text-based formats: when omitted, or set to text/plain, the type is derived from the filename extension. For binary formats it is required and must match the file content.filenamestringYesOriginal filename of the attachment.Response
FieldTypeDescription
idstringconversationIdstringcreatedByUserIdstringfileTypestringfileSizeintegerfileNamestringcreatedAtstringupdatedAtstringbase64ContentobjectplaintextContentobject_linksobject
contentstringExample
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"base64Content": {},
"contentUrl": {},
"mimeType": {},
"filename": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"base64Content": {},
"contentUrl": {},
"mimeType": {},
"filename": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/attachment-service/conversations/${conversationId}/attachments`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"base64Content": {},
"contentUrl": {},
"mimeType": {},
"filename": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"base64Content": map[string]any{},
"contentUrl": map[string]any{},
"mimeType": map[string]any{},
"filename": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/attachment-service/conversations/"+conversationID+"/attachments", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"id": "string",
"conversationId": "string",
"createdByUserId": "string",
"fileType": "string",
"fileSize": 0,
"fileName": "string",
"createdAt": "string",
"updatedAt": "string",
"base64Content": {},
"plaintextContent": {},
"_links": {
"content": "string"
}
}
List Attachments
GET
/conversations/{conversation_id}/attachmentsPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-based) |
size | integer | 20 | Number of elements per page |
excludedFields | string | — |
Response
FieldTypeDescription
dataarray<object>
idstringconversationIdstringcreatedByUserIdstringfileTypestringfileSizeintegerfileNamestringcreatedAtstringupdatedAtstringbase64ContentobjectplaintextContentobject_linksobject
contentstringpageobject
sizeintegertotalElementsintegertotalPagesintegercurrentPageintegerExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/attachment-service/conversations/${conversationId}/attachments`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/attachment-service/conversations/"+conversationID+"/attachments", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"data": [
{
"id": "string",
"conversationId": "string",
"createdByUserId": "string",
"fileType": "string",
"fileSize": 0,
"fileName": "string",
"createdAt": "string",
"updatedAt": "string",
"base64Content": {},
"plaintextContent": {},
"_links": {
"content": "string"
}
}
],
"page": {
"size": 0,
"totalElements": 0,
"totalPages": 0,
"currentPage": 0
}
}
Delete Attachment
DELETE
/conversations/{conversation_id}/attachments/{attachment_id}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversation_id | string | Yes | |
attachment_id | string | Yes |
Example
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments/{attachment_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
requests.delete(
f"https://app.neuroflash.com/api/attachment-service/conversations/{conversation_id}/attachments/{attachment_id}",
headers={"Authorization": f"Bearer {token}"},
)
await fetch(
`https://app.neuroflash.com/api/attachment-service/conversations/${conversationId}/attachments/${attachmentId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/attachment-service/conversations/"+conversationID+"/attachments/"+attachmentID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{}
Get Attachment
GET
/attachments/{attachment_id}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
attachment_id | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
excludedFields | string | — |
Response
FieldTypeDescription
idstringconversationIdstringcreatedByUserIdstringfileTypestringfileSizeintegerfileNamestringcreatedAtstringupdatedAtstringbase64ContentobjectplaintextContentobject_linksobject
contentstringExample
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/attachment-service/attachments/{attachment_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/attachment-service/attachments/{attachment_id}",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/attachment-service/attachments/${attachmentId}`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/attachment-service/attachments/"+attachmentID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"id": "string",
"conversationId": "string",
"createdByUserId": "string",
"fileType": "string",
"fileSize": 0,
"fileName": "string",
"createdAt": "string",
"updatedAt": "string",
"base64Content": {},
"plaintextContent": {},
"_links": {
"content": "string"
}
}