SpiderMail Attachments
3 endpoints from the published OpenAPI import.
Get Attachment Content
Retrieve attachment content by attachment ID.
This endpoint supports the three-layer progressive disclosure pattern:
- Layer 1 (summary): LLM-generated summary (~100 tokens)
- Layer 2 (preview): First 1500 characters of extracted text
- Layer 3 (full): Complete extracted text content (default)
The attachment must belong to a mailbox owned by the authenticated client. Returns text/plain response for easy agent consumption.
Use this endpoint when an agent needs deeper analysis of an attachment that was summarized in the email payload.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
attachment_id | path | string | true | |
layer | query | any | false | Content layer to retrieve: 'summary' (Layer 1), 'preview' (Layer 2), or 'full' (Layer 3, default) |
Try it
Examples
cURL
curl -X GET 'https://spideriq.ai/api/v1/mail/attachments/{attachment_id}' \
-H 'Authorization: Bearer <token>'Python
import httpx
resp = httpx.get(
"https://spideriq.ai/api/v1/mail/attachments/{attachment_id}",
headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/mail/attachments/{attachment_id}", {
method: "GET",
headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);Go
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://spideriq.ai/api/v1/mail/attachments/{attachment_id}", nil)
req.Header.Set("Authorization", "Bearer <token>")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
| Status | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
Get Attachment By Storage Key
Retrieve attachment content by storage key.
This is an alternative endpoint for agents that have the storage_key from the email payload's retrieve_key field.
The storage key must correspond to an attachment owned by the client.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
storage_key | path | string | true |
Try it
Examples
cURL
curl -X GET 'https://spideriq.ai/api/v1/mail/attachments/by-key/{storage_key}' \
-H 'Authorization: Bearer <token>'Python
import httpx
resp = httpx.get(
"https://spideriq.ai/api/v1/mail/attachments/by-key/{storage_key}",
headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/mail/attachments/by-key/{storage_key}", {
method: "GET",
headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);Go
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://spideriq.ai/api/v1/mail/attachments/by-key/{storage_key}", nil)
req.Header.Set("Authorization", "Bearer <token>")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
| Status | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
List Message Attachments
List all attachments for a message.
Returns Layer 1 (summary) and Layer 2 (preview) for each attachment, along with metadata and retrieve keys for fetching full content.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
message_id | path | integer | true |
Try it
Examples
cURL
curl -X GET 'https://spideriq.ai/api/v1/mail/attachments/message/{message_id}' \
-H 'Authorization: Bearer <token>'Python
import httpx
resp = httpx.get(
"https://spideriq.ai/api/v1/mail/attachments/message/{message_id}",
headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())JavaScript
const resp = await fetch("https://spideriq.ai/api/v1/mail/attachments/message/{message_id}", {
method: "GET",
headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);Go
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://spideriq.ai/api/v1/mail/attachments/message/{message_id}", nil)
req.Header.Set("Authorization", "Bearer <token>")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}Responses
| Status | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |