apicheats.dev github/llms.txt Raw .md
POST

POST /users/{user_id}/projectsV2/{project_number}/views — GitHub API

GitHub token (required); https://api.github.com

GitHub API

Create a view for a user-owned project

Base URL
https://api.github.com
Auth
Authorization: Bearer <GITHUB_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 355 tokens · Vary: Accept

Critical gotchas

GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.

Fine-grained tokens only authorize repositories and permissions selected when the token is created.

cURL

curl -X POST 'https://api.github.com/users/user-id/projectsV2/10/views' \  -H "Authorization: Bearer $GITHUB_TOKEN" \  -H 'Accept: application/vnd.github+json' \  -H 'X-GitHub-Api-Version: 2026-03-10' \  -H 'Content-Type: application/json' \  -d '{  "name": "Sprint Board",  "layout": "board"}'

Parameters

Name In Type Required Description
user_id path string Yes The unique identifier of the user.
project_number path integer Yes The project's number.
name body string Yes The name of the view.
layout body string Yes The layout of the view.
filter body string No The filter query for the view. See [Filtering projects](https://docs.github.com/issues/planning-and-tracking-with-projects/customizing-views-in-your-project/filtering-projects) for more information.
visible_fields body integer[] No `visible_fields` is not applicable to `roadmap` layout views. For `table` and `board` layouts, this represents the field IDs that should be visible in the view. If not provided, the default visible fields will be used.
sort_by body integer[][] No Sorting configuration for the view. Each element is a two-element array of `[field_id, direction]` where `direction` is `"asc"` or `"desc"`. Supports multiple sort criteria applied in order.
group_by body integer[] No The field IDs to group items by (horizontal grouping). Supports a single field. The field must support grouping; fields such as `Title`, `Reviewers`, `Linked pull requests`, `Sub-issues progress`, `Tracked by`, and `Tracks` cannot be grouped on.
vertical_group_by body integer[] No The field IDs to use as columns in `board` layout (vertical grouping). Supports a single field. The field must support grouping; fields such as `Title`, `Reviewers`, `Linked pull requests`, `Sub-issues progress`, `Tracked by`, and `Tracks` cannot be grouped on.

Response 200 OK

{
  "id": 0,
  "number": 0,
  "name": "string",
  "layout": "table",
  "node_id": "string",
  "project_url": "https://api.github.com/orgs/octocat/projectsV2/1",
  "html_url": "https://github.com/orgs/octocat/projects/1/views/1",
  "creator": {
    "name": "string",
    "email": "string",
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "https://github.com/images/error/octocat_happy.gif",
    "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
    "url": "https://api.github.com/users/octocat",
    "html_url": "https://github.com/octocat",
    "followers_url": "https://api.github.com/users/octocat/followers",
    "following_url": "https://api.github.com/users/octocat/following{/other_user}",
    "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
    "organizations_url": "https://api.github.com/users/octocat/orgs",
    "repos_url": "https://api.github.com/users/octocat/repos",
    "events_url": "https://api.github.com/users/octocat/events{/privacy}",
    "received_events_url": "https://api.github.com/users/octocat/received_events",
    "type": "User",
    "site_admin": true,
    "starred_at": "\"2020-07-09T00:17:55Z\"",
    "user_view_type": "public"
  },
  "created_at": "2022-04-28T12:00:00Z",
  "updated_at": "2022-04-28T12:00:00Z",
  "filter": "is:issue is:open",
  "visible_fields": [
    0
  ],
  "sort_by": [
    [
      0
    ]
  ],
  "group_by": [
    0
  ],
  "vertical_group_by": [
    0
  ]
}
Get a free GitHub API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.