Images
Base URL: https://app.neuroflash.com/api/image-service
Upload an image into the workspace
POST
/v1/workspaces/{workspaceId}/imagesCreates an image in the workspace from the supplied URL or data URI. The returned id can be passed as input to image-edit-tasks or image-upscale-tasks.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes |
Request Body
FieldTypeRequiredDescription
imageUrlstringYesHTTP(S) URL of the image to fetch, or an inline data: URIfileNamestringYesDownload filename including the extension. Sanitized server-side (path components stripped, non-alphanumeric characters folded to dashes). Capped at 50 characters.Response
FieldTypeDescription
idstringunique UUIDgenerationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.workspaceIdstringowning workspace IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringmodel used to produce the imageparametersobjectgeneration parameters (aspect ratio, format, etc.)inputImageIdsobjectIDs of any input images supplied for edit-tasks or upscale-tasksfileNamestringHuman-readable filename (with extension) suitable for downloads. Uploads carry the user-supplied name; generations get an LLM-derived slug; edits/upscales suffix the input's name. Capped at 50 characters.imageWidthobjectimage width in pixelsimageHeightobjectimage height in pixelsimageSizeobjectimage file size in bytescreatedAtstringcreation timestamp as ISO 8601updatedAtstringlast update timestamp as ISO 8601shareKeystringHMAC key authorizing this image's public share link (pass as ?key=)_linksobject
contentstringtemporary url to the image binarydownloadstringtemporary url that forces a file download (content-disposition: attachment)Example
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "string",
"fileName": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"imageUrl": "string",
"fileName": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"imageUrl": "string",
"fileName": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"imageUrl": "string",
"fileName": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images", 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": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
List images in a workspace (paginated)
GET
/v1/workspaces/{workspaceId}/imagesReturns images crated by the authenticated user, newest first.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | 1-based page number |
size | integer | 50 | items per page (max 200) |
generationId | string | — | filter to images produced by a specific generation request (useful for fetching all N outputs of one POST/PUT call) |
modelId | string | — | filter to images produced by this model id |
Response
FieldTypeDescription
pageobject
sizeintegernumber of elements requested per pagetotalElementsintegertotal number of matching elementstotalPagesintegertotal number of pagescurrentPageinteger1-based index of the returned pagedataarray<object>
idstringunique UUIDgenerationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.workspaceIdstringowning workspace IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringmodel used to produce the imageparametersobjectgeneration parameters (aspect ratio, format, etc.)inputImageIdsobjectIDs of any input images supplied for edit-tasks or upscale-tasksfileNamestringHuman-readable filename (with extension) suitable for downloads. Uploads carry the user-supplied name; generations get an LLM-derived slug; edits/upscales suffix the input's name. Capped at 50 characters.imageWidthobjectimage width in pixelsimageHeightobjectimage height in pixelsimageSizeobjectimage file size in bytescreatedAtstringcreation timestamp as ISO 8601updatedAtstringlast update timestamp as ISO 8601shareKeystringHMAC key authorizing this image's public share link (pass as ?key=)_linksobject
contentstringtemporary url to the image binarydownloadstringtemporary url that forces a file download (content-disposition: attachment)Example
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"page": {
"size": 0,
"totalElements": 0,
"totalPages": 0,
"currentPage": 0
},
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
]
}
Get a single image's metadata
GET
/v1/workspaces/{workspaceId}/images/{imageId}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | |
imageId | string | Yes |
Response
FieldTypeDescription
idstringunique UUIDgenerationIdstringGroups every image produced by one generation request. Multiple rows can share the same generationId when a request asked for more than one image.workspaceIdstringowning workspace IDcreatedByUserIdstringuserId of the account that created this imagepromptstringprompt that produced the image (empty for upscales or uploads)modelstringmodel used to produce the imageparametersobjectgeneration parameters (aspect ratio, format, etc.)inputImageIdsobjectIDs of any input images supplied for edit-tasks or upscale-tasksfileNamestringHuman-readable filename (with extension) suitable for downloads. Uploads carry the user-supplied name; generations get an LLM-derived slug; edits/upscales suffix the input's name. Capped at 50 characters.imageWidthobjectimage width in pixelsimageHeightobjectimage height in pixelsimageSizeobjectimage file size in bytescreatedAtstringcreation timestamp as ISO 8601updatedAtstringlast update timestamp as ISO 8601shareKeystringHMAC key authorizing this image's public share link (pass as ?key=)_linksobject
contentstringtemporary url to the image binarydownloadstringtemporary url that forces a file download (content-disposition: attachment)Example
- cURL
- Python
- Node.js
- Go
curl "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
response = requests.get(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}",
headers={"Authorization": f"Bearer {token}"},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images/${imageId}`,
{ headers: { Authorization: `Bearer ${token}` } }
).then((r) => r.json());
req, _ := http.NewRequest("GET", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Response:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generationId": "string",
"workspaceId": "string",
"createdByUserId": "string",
"prompt": "string",
"model": "string",
"parameters": {},
"inputImageIds": {},
"fileName": "string",
"imageWidth": {},
"imageHeight": {},
"imageSize": {},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z",
"shareKey": "string",
"_links": {
"content": "string",
"download": "string"
}
}
Delete an image
DELETE
/v1/workspaces/{workspaceId}/images/{imageId}Only the owner of the image (createdByUserId) or a user with the NF_ADMIN, NF_CUSTOMER_SUPPORT, or ADMIN_SERVICE role can delete an image.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | |
imageId | string | Yes |
Example
- cURL
- Python
- Node.js
- Go
curl -X DELETE "https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
requests.delete(
f"https://app.neuroflash.com/api/image-service/v1/workspaces/{workspace_id}/images/{image_id}",
headers={"Authorization": f"Bearer {token}"},
)
await fetch(
`https://app.neuroflash.com/api/image-service/v1/workspaces/${workspaceId}/images/${imageId}`,
{
method: "DELETE",
headers: { Authorization: `Bearer ${token}` },
}
);
req, _ := http.NewRequest("DELETE", "https://app.neuroflash.com/api/image-service/v1/workspaces/"+workspaceID+"/images/"+imageID+"", nil)
req.Header.Set("Authorization", "Bearer "+token)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()