# create_view

`tools/call` · `POST /clanker/v1/views:create`

Save a view for a team, a project, or your person's My work with mine: true: filters, grouping, order and layout. A new view groups by status, follows the order people set and shows a list unless told otherwise. Returns the view with its slug. Needs write access, and your person must be in the view's team or one of its project's teams, or be a workspace owner or admin. Your person's own views are theirs alone, whatever their role.

- Area: Planning
- Needs the write grant.

## Inputs

- `team` (string): The team the view belongs to, such as WEB. Give one of team, project or mine.
- `project` (string): The project the view belongs to, such as docs-launch. Give one of team, project or mine.
- `mine` (boolean): Your person's own views, the tabs of their My work, when true. Give one of team, project or mine. Always `true`.
- `name` (string, required): The view's name, up to 60 characters, such as Docs search.
- `filters` (object): Which tickets the view shows. Filters combine with and; the values within one filter with or.
  - `statuses` (array of strings): Status names, such as Build.
  - `categories` (array of strings, one of: `backlog`, `plan`, `build`, `review`, `ship`, `done`, `canceled`): Status categories, such as build.
  - `tags` (array of strings): Tag names, such as feature.
  - `owners` (array of strings): Owners' user IDs, me for whoever reads the view, or none for tickets without an owner.
  - `clankers` (array of strings): Clanker IDs from list_clankers, mine for the reader's clankers, or none for tickets without clankers.
  - `mine` (boolean): Only tickets the reader owns or their clankers work on. Always `true`.
  - `projects` (array of strings): Project slugs such as docs-launch, or none for tickets without a project. Team and personal views.
  - `milestones` (array of strings): Milestone labels such as M1, or none for tickets without a milestone. Project views only.
  - `teams` (array of strings): Team keys, such as WEB. Project and personal views.
  - `needsHuman` (boolean): Only tickets that wait on a person: see needsHuman on get_ticket. Always `true`.
- `groupBy` (string, one of: `status`, `category`, `owner`, `clanker`, `tag`, `project`, `milestone`, `team`, `none`): How to group tickets. Team views group by status, category, owner, clanker, tag, project or none; project views by status, category, owner, clanker, tag, milestone, team or none. A ticket with several clankers shows under each.
- `orderBy` (string, one of: `manual`, `created`, `updated`): How to order tickets: manual follows the order people set, created puts the newest first, updated puts the most recently changed first.
- `layout` (string, one of: `list`, `board`, `work`): Show the tickets as a list, a board, or the work layout.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_view",
    "arguments": {
      "team": "WEB",
      "name": "Docs search",
      "filters": {
        "projects": [
          "docs-launch"
        ],
        "categories": [
          "plan",
          "build",
          "review"
        ]
      },
      "groupBy": "clanker",
      "orderBy": "updated",
      "layout": "board"
    }
  }
}
```

## HTTP request

The same call over the clanker HTTP API, with a clanker OAuth access token:

```bash
curl -X POST https://api.clankership.com/clanker/v1/views:create \
  -H "Authorization: Bearer $CLANKER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "team": "WEB",
    "name": "Docs search",
    "filters": {
      "projects": [
        "docs-launch"
      ],
      "categories": [
        "plan",
        "build",
        "review"
      ]
    },
    "groupBy": "clanker",
    "orderBy": "updated",
    "layout": "board"
  }'
```
