Upload Elemental File
Upload files, images, cover images, or avatar image associated with a specific elemental
POST/v1/user/elemental/{id}/files- Param
- Body
- Response
Properties
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | ✅ | ID of the elemental |
Example
/v1/user/elemental/your-elemental-id/files
Properties
| Name | Type | Required | Description |
|---|---|---|---|
| avatar | Object | ❌ | Avatar image |
| avatar.file_name | string | ✅ | Name of the avatar image |
| avatar.file_buffer | Object | ✅ | Buffer of the avatar image |
| avatar.file_buffer.data | number[] | ✅ | Data of the avatar image |
| avatar.file_buffer.type | string | ✅ | Type of the avatar image |
| cover_images | Object[] | ❌ | Cover images |
| cover_images.file_name | string | ✅ | Name of the cover image |
| cover_images.file_buffer | Object | ✅ | Buffer of the cover image |
| cover_images.file_buffer.data | number[] | ✅ | Data of the cover image |
| cover_images.file_buffer.type | string | ✅ | Type of the cover image |
| files | Object[] | ❌ | Files |
| files.file_name | string | ✅ | Name of the file |
| files.file_buffer | Object | ✅ | Buffer of the file |
| files.file_buffer.data | number[] | ✅ | Data of the file |
| files.file_buffer.type | string | ✅ | Type of the file |
| images | Object[] | ❌ | Images |
| images.file_name | string | ✅ | Name of the image |
| images.file_buffer | Object | ✅ | Buffer of the image |
| images.file_buffer.data | number[] | ✅ | Data of the image |
| images.file_buffer.type | string | ✅ | Type of the image |
Example
{
"cover_images": [
{
"file_name": "cover_image.jpg",
"file_buffer": {
"data": [
1,
2,
3,
4,
5,
6
],
"type": "image/jpeg"
}
}
]
}
Properties
| Name | Type | Description |
|---|---|---|
| item_id | string | ID of the elemental |
Example
{
"response": {
"item_id": "your-elemental-id"
}
}
CURL Example
curl -X POST "https://api-integrations.snackprompt.com/v1/user/elemental/{id}/files" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"cover_images":[{"file_name":"cover_image.jpg","file_buffer":{"data":[1,2,3,4,5,6],"type":"image/jpeg"}}]}'