# Attachments

This API allows users to retrieve attachments associated with a specific record in a table. Attachments can include various types of files such as documents, images, and other resources uploaded to the system.

## List all attachments for a record

> List all attachments for a record. Requires \`can\_read\_attachments\` permission on the table.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]},{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."},"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Legacy JWT Bearer token — deprecated in favor of organization tokens (tot_). Still supported for backwards compatibility."}},"schemas":{"AttachmentListResponse":{"title":"AttachmentListResponse","type":"array","description":"List of attachments","items":{"required":["createdDateTime","id","name","recordId","size","tags","type"],"type":"object","properties":{"recordId":{"type":"string","description":"Identifier of the record this attachment belongs to"},"size":{"type":"number","description":"Size of the attachment in bytes"},"name":{"type":"string","description":"Name of the attachment"},"createdDateTime":{"type":"string","description":"Creation timestamp of the attachment"},"id":{"type":"string","description":"Unique identifier of the attachment"},"type":{"type":"string","description":"MIME type of the attachment"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags of the attachment"}},"description":"List of attachments"}},"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/tables/{tableId}/records/{recordId}/attachments":{"get":{"tags":["Attachments"],"summary":"List all attachments for a record","description":"List all attachments for a record. Requires `can_read_attachments` permission on the table.","operationId":"list-attachments","parameters":[{"name":"tableId","in":"path","description":"Table identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"recordId","in":"path","description":"Record identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Organization token (`tot_`) — preferred method, or legacy Bearer JWT token. Pass the `tot_` token directly without Bearer prefix; use `Bearer <jwt>` for legacy JWT auth.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","headers":{"Content-Type":{"description":"Content type of the response","style":"simple","explode":false,"schema":{"type":"string"}}},"content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/AttachmentListResponse"}}}},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found – resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get link of a specific attachment

> Get link of a specific attachment. Requires \`can\_read\_attachments\` permission on the table.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]},{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."},"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Legacy JWT Bearer token — deprecated in favor of organization tokens (tot_). Still supported for backwards compatibility."}},"schemas":{"AttachmentLinkResponse":{"title":"AttachmentLinkResponse","required":["link"],"type":"object","properties":{"link":{"type":"string","description":"Pre-signed URL to download the attachment"}}},"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/tables/{tableId}/records/{recordId}/attachments/{attachmentId}":{"get":{"tags":["Attachments"],"summary":"Get link of a specific attachment","description":"Get link of a specific attachment. Requires `can_read_attachments` permission on the table.","operationId":"get-attachment","parameters":[{"name":"tableId","in":"path","description":"Table identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"recordId","in":"path","description":"Record identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"attachmentId","in":"path","description":"Attachment identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Organization token (`tot_`) — preferred method, or legacy Bearer JWT token. Pass the `tot_` token directly without Bearer prefix; use `Bearer <jwt>` for legacy JWT auth.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","headers":{"Content-Type":{"description":"Content type of the response","style":"simple","explode":false,"schema":{"type":"string"}}},"content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/AttachmentLinkResponse"}}}},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found – resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Create an attachment for a record

> Create an attachment for a record. Requires \`can\_edit\_attachments\` permission on the table.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]},{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."},"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Legacy JWT Bearer token — deprecated in favor of organization tokens (tot_). Still supported for backwards compatibility."}},"schemas":{"AttachmentCreateResponse":{"title":"AttachmentCreateResponse","type":"object"},"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/tables/{tableId}/records/{recordId}/attachments":{"post":{"tags":["Attachments"],"summary":"Create an attachment for a record","description":"Create an attachment for a record. Requires `can_edit_attachments` permission on the table.","operationId":"create-attachment","parameters":[{"name":"tableId","in":"path","description":"","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"recordId","in":"path","description":"","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"description":"Upload file request","content":{"multipart/form-data":{"schema":{"required":["file"],"type":"object","properties":{"file":{"description":"The file to upload","format":"binary"},"tags":{"type":"array","items":{"type":"string"},"description":"Optional list of tags to associate with the uploaded file","format":"binary"}}}}},"required":true},"responses":{"201":{"description":"201","content":{"application/json;charset=UTF-8":{"schema":{"$ref":"#/components/schemas/AttachmentCreateResponse"}}}},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found – resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Delete an attachment from a record

> Delete an attachment from a record. Requires \`can\_edit\_attachments\` permission on the table.

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"}],"security":[{"organizationToken":[]},{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"organizationToken":{"type":"apiKey","in":"header","name":"Authorization","description":"Organization API token (tot_) — preferred authentication method. Pass the token directly without Bearer prefix."},"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Legacy JWT Bearer token — deprecated in favor of organization tokens (tot_). Still supported for backwards compatibility."}},"schemas":{"ErrorResponse":{"required":["errors","fingerprint"],"type":"object","properties":{"fingerprint":{"type":"string","description":"Unique identifier for this error instance"},"errors":{"type":"array","description":"List of error details","items":{"required":["code","message"],"properties":{"code":{"type":"string","description":"Error code representing the type of error"},"message":{"type":"string","description":"Error message providing more details about the error"}}}}}}}},"paths":{"/tables/{tableId}/records/{recordId}/attachments/{attachmentId}":{"delete":{"tags":["Attachments"],"summary":"Delete an attachment from a record","description":"Delete an attachment from a record. Requires `can_edit_attachments` permission on the table.","operationId":"delete-attachment","parameters":[{"name":"tableId","in":"path","description":"Table identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"recordId","in":"path","description":"Record identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"attachmentId","in":"path","description":"Attachment identifier","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Organization token (`tot_`) — preferred method, or legacy Bearer JWT token. Pass the `tot_` token directly without Bearer prefix; use `Bearer <jwt>` for legacy JWT auth.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"204"},"400":{"description":"Bad Request – invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized – JWT token missing or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden – insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found – resource does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error – unexpected server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.transactionlink.io/docs/transactionlink-api/api-reference/records/attachments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
