# client.flows.pinned

> client.flows.pinned — the flows.pinned operations.

`client.flows.pinned` — the `flows.pinned` operations.

On `AsyncKindgi` every method is the same, awaited.

## `client.flows.pinned.resolve()`

```python signature
resolve(
    flow_id: str | UUID,
    /,
    *,
    project_id: str | UUID | None = None,
    org_id: str | UUID | None = None,
    timeout: float | None = None,
) -> PinnedVersionResolution
```

The version in use for a project. `GET /v1/flows/{flowId}/pinned`

Resolves the version in use for a project (or an org, or the whole workspace): the most specific pin covering it (the project, its org, then the workspace) whose version is still active, else the newest version the project reaches, as a run that names no version takes it. A pin whose version doesn't reach the project is passed over, as a run passes it over. `via` says which; `pinnedScope` names the pin that matched.

## `client.flows.pinned.list()`

```python signature
list(flow_id: str | UUID, /, *, timeout: float | None = None) -> PinnedVersionList
```

List a flow's pinned versions. `GET /v1/flows/{flowId}/pinned-versions`

Every scope with a version pinned, and the change that set it.

## `client.flows.pinned.pin()`

```python signature
pin(
    flow_id: str | UUID,
    body: PinVersionBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> PinnedVersionChange
```

Pin a version for a scope. `POST /v1/flows/{flowId}/pinned/pin`

Pins `version` for `scope` (the workspace, an org or a project), or moves the scope's pin to it. A run that names no flow version takes the version pinned for its project (the project's own pin, then its org's, then the workspace's), else the newest version the project reaches. A run that names its version isn't affected, and a run already started keeps its version. The version must be registered and active. Pinning the version the scope already pins changes nothing and answers the change that set it. Every change is recorded, with who asked and why. Needs `pin` on the flow.

## `client.flows.pinned.unpin()`

```python signature
unpin(
    flow_id: str | UUID,
    body: UnpinVersionBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> PinnedVersionChange
```

Remove a scope's pin. `POST /v1/flows/{flowId}/pinned/unpin`

Removes the scope's own pin: the scope then follows the next scope up (its org's pin, then the workspace's), or, with none above, takes what it would if it had never been pinned. Recorded like a pin. Needs `pin` on the flow.

## `client.flows.pinned.history()`

```python signature
history(
    flow_id: str | UUID,
    /,
    *,
    limit: int | None = None,
    cursor: str | None = None,
    timeout: float | None = None,
) -> PinnedVersionChangePage
```

List a flow's pin changes. `GET /v1/flows/{flowId}/pin-history`

Every pin and unpin of the item, newest first: what each scope pinned before and after, who asked and why.
