Invoice attachment access (pre-signed URLs)
Downloads invoice attachments via 1-hour pre-signed S3 URLs. Useful for documentary audits or compliance verifications.
86/100ยท๐ Ad hocยทIntermediateControllerAP Manager
ComplianceReconciliationget_payable_attachments
๐ฏ Skill purpose
Downloads invoice attachments via 1-hour pre-signed S3 URLs. Useful for documentary audits or compliance verifications.
๐ What it produces
1-hour valid access URLs for all attachments on the invoice, ready to open.
โก Benefit
Before
Manual download from the Spendesk UI, one file at a time.
After
Direct access to attachment URLs, ready to share or archive in bulk.
# Instructions โ Access to supporting documents
## โ ๏ธ URLs with a limited lifetime: 1 hour
URLs returned by `get_payable_attachments` are **pre-signed AWS S3 links**.
```
X-Amz-Expires=3600 โ expires 1 hour after generation
```
**Never:**
- Store these URLs in a database
- Cache them in a long conversational context
- Pass them to a third-party system that would use them later
**Always:** share the URL immediately and tell the user it expires in 1h.
## โ ๏ธ Tool cache = 3300s (55min)
The tool itself is cached for 55 minutes.
If the URL was retrieved at the start of the cache window, it will only have **5 minutes** left at the end of the cache window.
โ For interactive use, don't hesitate to call the tool again if the time between two uses exceeds 30 minutes.
## Step 1 โ Get the payableId
Call `get_payables` with the appropriate filter to find the target payable.
```json
{
"companyId": "...",
"filters": { "field": "documentaryEvidenceStatus", "operator": "=", "value": ["provided"] },
"pageSize": 20
}
```
โ Extract the `id` field of the payable you're interested in.
## Step 2 โ Retrieve the attachments
```json
{ "companyId": "...", "payableId": "<payable-id>" }
```
## Step 3 โ Interpret the fields
For each attachment:
- `url`: direct download link (valid for 1h) โ to share immediately
- `mimetype`: MIME type (`image/jpeg`, `application/pdf`, `image/png`, etc.) โ inform the user
- `checksum`: MD5 hash of the file for integrity verification
- `attachedAt`: attachment date (format `YYYY-MM-DD`, not datetime)
## Step 4 โ Present the result
```
Supporting document found for invoice [description]:
- Type: image/jpeg
- Attached on: 2023-01-11
- Download link: [URL]
โ ๏ธ This link expires in 1 hour. After expiry, call the command again to get a new link.
```
## Live example (real data)
```json
{
"mimetype": "image/jpeg",
"checksum": "107fc4b2a439cbeb84c91c9764b9744d",
"attachedAt": "2023-01-11",
"url": "https://spx-production.s3.eu-west-1.amazonaws.com/invoices/nTtrU1GKV_5633342?X-Amz-Expires=3600..."
}
```
โ S3 bucket: `spx-production.s3.eu-west-1.amazonaws.com` (EU region)
โ Expiry: 3600s confirmed live
## Example prompt
- "Show me the supporting document for the Airbnb invoice" โ get_payables search + get_payable_attachments
- "Download the PDF of last month's Oracle invoice" โ filter supplier + get_payable_attachments
- "Check that the attachment isn't corrupted" โ compare local checksum vs API checksum
How to install this skill
/
- 1Download the file
s21-payable-attachments-url-expiry.mdusing the button above. - 2Place the file in the
.claude/directory of your project (or~/.claude/for a global install).cp s21-payable-attachments-url-expiry.md .claude/s21-payable-attachments-url-expiry.md - 3Use in Claude Code โ the skill is automatically discovered. Describe your need in natural language and Claude will apply the skill instructions.
๐ก Make sure the Spendesk MCP is configured in your
.claude/settings.json with the tools get_payable_attachments.Similar skills
โ
Top