> For the complete documentation index, see [llms.txt](https://docs.usepylon.com/pylon-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usepylon.com/pylon-docs/developer/api/api-reference/attachments.md).

# Attachments

## Create an attachment

> Uploads a file as an attachment. The returned URL can be used when creating issues or messages. Files up to 100 MB (104,857,600 bytes) are supported. Larger files may be rejected and should be shared using an externally hosted link. This applies to direct uploads and files fetched through file\_url. Downstream delivery channels may impose smaller limits.\
> \
> \*\*Rate limit:\*\* 30 requests per minute

```json
{"openapi":"3.0.3","info":{"title":"Pylon API.","version":"1.0.0"},"servers":[{"description":"US region","url":"https://api.usepylon.com"},{"description":"EU region","url":"https://api.eu.usepylon.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"description":"Authorization: Bearer <token>","scheme":"bearer","type":"http"}},"responses":{"CreateAttachmentResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttachmentResponseBody"}}},"description":""},"BadRequestApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The request was invalid or could not be completed."},"ForbiddenApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The authenticated caller or organization is not allowed to access this endpoint or operation."},"PayloadTooLargeApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"The uploaded file is too large."},"InternalServerErrorApiResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorApiResponseBody"}}},"description":"An unexpected internal error occurred."}},"schemas":{"CreateAttachmentResponseBody":{"properties":{"data":{"$ref":"#/components/schemas/Attachment"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"},"Attachment":{"properties":{"description":{"description":"The description of the attachment.","type":"string"},"id":{"description":"The ID of the attachment.","type":"string"},"name":{"description":"The name of the attachment.","type":"string"},"url":{"description":"The URL of the attachment.","type":"string"}},"type":"object"},"ErrorApiResponseBody":{"properties":{"code":{"description":"A stable machine-readable identifier for this failure, safe to branch on\ninstead of the message text. Omitted when the failure has no assigned code.","enum":["recipients_suppressed","email_bounced","internal_issue_reply_not_allowed","duplicate_object","invalid_authorization_header","invalid_api_token","invalid_oauth_token","wrong_region_token","organization_deactivated","organization_suspended","permission_denied","oauth_not_permitted","rate_limited","not_found","method_not_allowed","payload_too_large","invalid_request_body","internal_error","invalid_webhook_credentials","organization_inactive"],"type":"string"},"errors":{"description":"The list of errors.","items":{"type":"string"},"type":"array"},"exists_id":{"description":"The ID of the object that already exists if this is a duplicate object error.","type":"string"},"request_id":{"description":"The request ID for tracking.","type":"string"}},"type":"object"}}},"paths":{"/attachments":{"post":{"description":"Uploads a file as an attachment. The returned URL can be used when creating issues or messages. Files up to 100 MB (104,857,600 bytes) are supported. Larger files may be rejected and should be shared using an externally hosted link. This applies to direct uploads and files fetched through file_url. Downstream delivery channels may impose smaller limits.\n\n**Rate limit:** 30 requests per minute","operationId":"CreateAttachment","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"description":{"description":"The description of the file.","type":"string"},"file":{"description":"The file to upload. Files up to 100 MB (104,857,600 bytes) are supported. Larger files may be rejected and should be shared using an externally hosted link.","format":"binary","type":"string"},"file_url":{"description":"The URL to fetch the file from, if the file is not provided. Fetched files up to 100 MB (104,857,600 bytes) are supported. Larger files may be rejected and should be shared using an externally hosted link.","type":"string"}},"type":"object"}}}},"responses":{"200":{"$ref":"#/components/responses/CreateAttachmentResponse"},"400":{"$ref":"#/components/responses/BadRequestApiResponse"},"403":{"$ref":"#/components/responses/ForbiddenApiResponse"},"413":{"$ref":"#/components/responses/PayloadTooLargeApiResponse"},"500":{"$ref":"#/components/responses/InternalServerErrorApiResponse"}},"summary":"Create an attachment","tags":["attachments"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.usepylon.com/pylon-docs/developer/api/api-reference/attachments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
