<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7" -->

---
title: How to programmatically upload attachments to GitHub...
description: GitHub has long lacked a programmatic API for uploading image attachments to Issues, Pull Requests, and Comments. An undocumented endpoint at...
canonical: https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to programmatically upload attachments to GitHub Issues, Pull Requests, and Comments, finally, for now | daily.dev
og:description: GitHub has long lacked a programmatic API for uploading image attachments to Issues, Pull Requests, and Comments. An undocumented endpoint at...
og:url: https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7
og:image: https://api.daily.dev/og/posts/v8lxRycY7.png
og:image:alt: How to programmatically upload attachments to GitHub Issues, Pull Requests, and Comments, finally, for now
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to programmatically upload attachments to GitHub Issues, Pull Requests, and Comments, finally, for now

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 2 min read · 0 upvotes · 0 comments

## Summary

GitHub has long lacked a programmatic API for uploading image attachments to Issues, Pull Requests, and Comments. An undocumented endpoint at uploads.github.com now works with Bearer token authentication, enabling automation via curl or scripts. The endpoint accepts a file, MIME type, and repository ID, returning a JSON response with the attachment URL that can be embedded in GitHub content — useful for GitHub Actions workflows like attaching PR screenshots or visual test diffs.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://island94.org/2026/08/programmatically-upload-attachments-to-github-issues-pull-requests-comments>

## Questions this post answers

### How do I programmatically upload an image attachment to a GitHub Issue or Pull Request?

Send a POST request to the undocumented endpoint uploads.github.com/user-attachments/assets with query parameters name, content_type, and repository_id, authenticated with a bearer token from gh auth token, and the binary file as the request body. The JSON response contains the attachment URL, which can then be embedded as an image tag in Issue, PR, or Comment content, equivalent to drag-and-drop upload in the browser.

_daily.dev surfaces workflow tricks like this for engineers automating GitHub Actions screenshot and diff attachments._

### Does GitHub have an official API for uploading attachments to Issues and Pull Requests?

No, GitHub has no official, documented API for uploading images or attachments to Issues, Pull Requests, or Comments as of this writing; uploading is officially only supported via drag-and-drop in the browser. An unofficial endpoint at uploads.github.com/user-attachments/assets works when authenticated with a bearer token, but it is undocumented and unsupported.

_Developers wiring up GitHub automation follow gaps like this via daily.dev before they hit them in production._

---

Tags: [#github](https://daily.dev/tags/github), [#automation](https://daily.dev/tags/automation), [#rest-api](https://daily.dev/tags/rest-api), [#github-actions](https://daily.dev/tags/github-actions)

[View this post on daily.dev](https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to programmatically upload attachments to GitHub Issues, Pull Requests, and Comments, finally, for now","url":"https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7"},"datePublished":"2026-08-04T00:53:02.408Z","dateModified":"2026-09-13T18:53:57.918Z","description":"GitHub has long lacked a programmatic API for uploading image attachments to Issues, Pull Requests, and Comments. An undocumented endpoint at...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/93bcdad1b791f8b018ed0b86a63354ef?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/93bcdad1b791f8b018ed0b86a63354ef?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"github,automation,rest-api,github-actions","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"How to programmatically upload attachments to GitHub Issues, Pull Requests, and Comments, finally, for now"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-programmatically-upload-attachments-to-github-issues-pull-requests-and-comments-finally-f-v8lxrycy7#faq","mainEntity":[{"@type":"Question","name":"How do I programmatically upload an image attachment to a GitHub Issue or Pull Request?","acceptedAnswer":{"@type":"Answer","text":"Send a POST request to the undocumented endpoint uploads.github.com/user-attachments/assets with query parameters name, content_type, and repository_id, authenticated with a bearer token from gh auth token, and the binary file as the request body. The JSON response contains the attachment URL, which can then be embedded as an image tag in Issue, PR, or Comment content, equivalent to drag-and-drop upload in the browser. daily.dev surfaces workflow tricks like this for engineers automating GitHub Actions screenshot and diff attachments."}},{"@type":"Question","name":"Does GitHub have an official API for uploading attachments to Issues and Pull Requests?","acceptedAnswer":{"@type":"Answer","text":"No, GitHub has no official, documented API for uploading images or attachments to Issues, Pull Requests, or Comments as of this writing; uploading is officially only supported via drag-and-drop in the browser. An unofficial endpoint at uploads.github.com/user-attachments/assets works when authenticated with a bearer token, but it is undocumented and unsupported. Developers wiring up GitHub automation follow gaps like this via daily.dev before they hit them in production."}}]}
```

