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

# Create a GitHub Pages deployment

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

Create a GitHub Pages deployment for a repository.

The authenticated user must have write permission to the repository.

## Path parameters

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

## Request body

- object — The object used to create GitHub Pages deployment
  - `artifact_id` number — The ID of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.
  - `artifact_url` string — The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. Either `artifact_id` or `artifact_url` are required.
  - `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.
  - `id` union, required — The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit.
    - integer
    - string
  - `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.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api/versions/a367f7028301/schema)
