Create a view for a user-owned project
Create a new view in a user-owned project. Views allow you to customize how items in a project are displayed and filtered.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The unique identifier of the user.
The project’s number.
Request Body required
Section titled “ Request Body required ”object
The name of the view.
The layout of the view.
The filter query for the view. See Filtering projects for more information.
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.
Examples
Create a table view
{ "name": "All Issues", "layout": "table", "filter": "is:issue", "visible_fields": [ 123, 456, 789 ]}Create a board view with filter
{ "name": "Sprint Board", "layout": "board", "filter": "is:issue is:open label:sprint", "visible_fields": [ 123, 456, 789 ]}Create a roadmap view
{ "name": "Product Roadmap", "layout": "roadmap"}Responses
Section titled “ Responses ”Response for creating a view in a user-owned project.
A view inside a projects v2 project
object
The unique identifier of the view.
The number of the view within the project.
The name of the view.
The layout of the view.
The node ID of the view.
The API URL of the project that contains the view.
The web URL of the view.
object
The time when the view was created.
The time when the view was last updated.
The filter query for the view.
The list of field IDs that are visible in the view.
The sorting configuration for the view. Each element is a tuple of [field_id, direction] where direction is “asc” or “desc”.
The list of field IDs used for horizontal grouping.
The list of field IDs used for vertical grouping (board layout).
Examples
Response for creating a table view
{ "value": { "id": 1, "number": 1, "name": "Sprint Board", "layout": "board", "node_id": "PVTV_lADOANN5s84ACbL0zgBueEI", "project_url": "https://api.github.com/orgs/octocat/projectsV2/1", "html_url": "https://github.com/orgs/octocat/projects/1/views/1", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "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": false }, "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z", "filter": "is:issue is:open", "visible_fields": [ 123, 456, 789 ], "sort_by": [ [ 123, "asc" ], [ 456, "desc" ] ], "group_by": [ 123 ], "vertical_group_by": [ 456 ] }}Response for creating a board view with filter
{ "value": { "id": 1, "number": 1, "name": "Sprint Board", "layout": "board", "node_id": "PVTV_lADOANN5s84ACbL0zgBueEI", "project_url": "https://api.github.com/orgs/octocat/projectsV2/1", "html_url": "https://github.com/orgs/octocat/projects/1/views/1", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "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": false }, "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z", "filter": "is:issue is:open", "visible_fields": [ 123, 456, 789 ], "sort_by": [ [ 123, "asc" ], [ 456, "desc" ] ], "group_by": [ 123 ], "vertical_group_by": [ 456 ] }}Response for creating a roadmap view
{ "value": { "id": 1, "number": 1, "name": "Sprint Board", "layout": "board", "node_id": "PVTV_lADOANN5s84ACbL0zgBueEI", "project_url": "https://api.github.com/orgs/octocat/projectsV2/1", "html_url": "https://github.com/orgs/octocat/projects/1/views/1", "creator": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "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": false }, "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z", "filter": "is:issue is:open", "visible_fields": [ 123, 456, 789 ], "sort_by": [ [ 123, "asc" ], [ 456, "desc" ] ], "group_by": [ 123 ], "vertical_group_by": [ 456 ] }}Not modified
Requires authentication
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Forbidden
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Resource not found
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Validation failed, or the endpoint has been spammed.
Validation Error
object
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ { "resource": "example", "field": "example", "message": "example", "code": "example", "index": 1, "value": [ "example" ] } ]}Service unavailable
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}