# Reorder your pinned projects

> Put your pins in a workspace in a new order: projects names every pinned project's slug, once, in the order you want them.

<div class="g1t-endpoint"><span class="g1t-method" data-method="put">PUT</span><code>/user/pinned_projects/{workspace}</code></div>

Returns your pins, in order.

Name every pinned project once; anything else is refused with `422 invalid`.

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`workspace`](/reference/mcp/#workspace) with `action` `reorder_pinned_projects`, and the same inputs
- **Scope:** An access token needs [`account:write`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace` | string | Yes | The workspace's slug, e.g. "flagon-io". |

## Body parameters

Send a JSON object. Names are `snake_case`, as in responses; the `camelCase` spelling is accepted too.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `projects` | array of strings | Yes | Every pinned project's slug, once, in the order you want them. |

## Example request

```sh
curl -X PUT https://api.g1t.sh/user/pinned_projects/flagon-io \
  -H "Authorization: Bearer $G1T_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "projects": [
      "lab-api",
      "g1t",
      "hello"
    ]
  }'
```

## Example response

A successful request answers `200` with:

```json
[
  {
    "position": 0,
    "id": "prj_01kkq0c4d9h2w7rn5f8t3k6p2z",
    "workspace": "flagon-io",
    "slug": "lab-api",
    "name": "lab-api",
    "description": null,
    "private": true,
    "archived": false,
    "kind": "app",
    "url": "https://g1t.sh/flagon-io/lab-api",
    "pushed_at": "2026-10-06T18:40:00.000Z",
    "updated_at": "2026-10-01T09:12:00.000Z"
  },
  {
    "position": 1,
    "id": "prj_01kkp3m8w2f6t9qh4c7d1r5n0x",
    "workspace": "flagon-io",
    "slug": "g1t",
    "name": "g1t",
    "description": null,
    "private": false,
    "archived": false,
    "kind": "app",
    "url": "https://g1t.sh/flagon-io/g1t",
    "pushed_at": "2026-10-07T10:00:00.000Z",
    "updated_at": "2026-10-01T09:12:00.000Z"
  },
  {
    "position": 2,
    "id": "prj_01kkp3n2a7e5v8sk3b6g9j4m1y",
    "workspace": "flagon-io",
    "slug": "hello",
    "name": "hello",
    "description": "Greets people from the command line.",
    "private": false,
    "archived": false,
    "kind": "library",
    "url": "https://g1t.sh/flagon-io/hello",
    "pushed_at": null,
    "updated_at": "2026-10-01T09:12:00.000Z"
  }
]
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 409 | `conflict` | The request conflicts with the current state. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
