---
title: "Create a blob"
method: POST
path: "/repos/{owner}/{repo}/git/blobs"
tags: ["git"]
---

# Create a blob

`POST /repos/{owner}/{repo}/git/blobs`

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- object
  - `content` string, required — The new blob's content.
  - `encoding` string — The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported.

## Response `201`

Response

- ShortBlob — Short Blob
  - `url` string, required
  - `sha` string, required

## Other responses

- `403` — Forbidden
- `404` — Resource not found
- `409` — Conflict
- `422` — Validation failed

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
