---
title: "Create a GitHub Pages deployment"
method: POST
path: "/repos/{owner}/{repo}/pages/deployment"
tags: ["repos"]
---

# Create a GitHub Pages deployment

`POST /repos/{owner}/{repo}/pages/deployment`

Create a GitHub Pages deployment for a repository.

Users must have write permissions. GitHub Apps must have the `pages:write` permission to use this endpoint.

## Path parameters

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

## Request body

- object — The object used to create GitHub Pages deployment
  - `artifact_url` string, required — The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository.
  - `environment` string — The target environment for this GitHub Pages deployment.
  - `pages_build_version` string, required — A unique string that represents the version of the build for this deployment.
  - `oidc_token` string, required — The OIDC token issued by GitHub Actions certifying the origin of the deployment.

## Response `200`

Response

- PageDeployment — The GitHub Pages deployment status.
  - `status_url` string, uri, required — The URI to monitor GitHub Pages deployment status.
  - `page_url` string, uri, required — The URI to the deployed GitHub Pages.
  - `preview_url` string, uri — The URI to the deployed GitHub Pages preview.

## Other responses

- `400` — Bad Request
- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

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