# Pin a file, directory view or commit

Source: https://docs.wabe.sh/api-reference/operations/pinstate/

`PUT https://api.wabe.sh/v1/disks/{disk}/labels`

## Authorization

Project API key from the Wabe Dashboard or actor runtime access token for the disk URL supplied by the broker.

## Parameters

- `disk` (path, string, required) — Project disk name, or the disk ID in the actor runtime disk URL.

- `branch` (query, string)

- `commit` (query, string)

- `label` (query, string)

## Request body

`application/json`

Example

```json
{
  "name": "daily",
  "commit": "7bdd0f94-3d70-4367-8d5d-1cdbec118598"
}
```

Schema

```json
{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "path": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "path"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "commit": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "name",
        "commit"
      ],
      "additionalProperties": false
    }
  ]
}
```

## Responses

### 200

Pin metadata.

`application/json`

Schema

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "target": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "commit"
            },
            "id": {
              "type": "string",
              "format": "uuid"
            }
          },
          "required": [
            "kind",
            "id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "object"
            },
            "version": {
              "type": "string",
              "format": "uuid"
            },
            "directory": {
              "type": "boolean"
            }
          },
          "required": [
            "kind",
            "version",
            "directory"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "name",
    "target"
  ],
  "additionalProperties": false
}
```

### 400

Invalid input.

`text/plain`

Schema

```json
{
  "type": "string"
}
```

### 401

Missing, invalid or revoked project API key, or an invalid runtime access token.

`application/json`

Schema

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### 403

Actor runtime token does not authorize this disk or instance generation.

`application/json`

Schema

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```

### 404

Object was not found.

`text/plain`

Schema

```json
{
  "type": "string"
}
```

### 409

Conflict, nonempty destination or referenced object.

`text/plain`

Schema

```json
{
  "type": "string"
}
```

### 500

Storage, I/O or corruption failure.

`text/plain`

Schema

```json
{
  "type": "string"
}
```

### 503

Disk unavailable.

`application/json`

Schema

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}
```
