# 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

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"},{"url":"https://api.sandbox.transactionlink.io","description":"Sandbox"}],"security":[{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"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","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":"Bearer token for authentication","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

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"},{"url":"https://api.sandbox.transactionlink.io","description":"Sandbox"}],"security":[{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"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","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":"Bearer token for authentication","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

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"},{"url":"https://api.sandbox.transactionlink.io","description":"Sandbox"}],"security":[{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"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","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

```json
{"openapi":"3.0.1","info":{"title":"TransactionLink API","version":"v3"},"servers":[{"url":"https://api.transactionlink.io","description":"Production"},{"url":"https://api.sandbox.transactionlink.io","description":"Sandbox"}],"security":[{"bearerAuthJWT":[]}],"components":{"securitySchemes":{"bearerAuthJWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"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","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":"Bearer token for authentication","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"}}}}}}}}}
```
