Skip to content

Requests

The typed input models. Each LinearClient method takes exactly one of these.

Typed request models for each :class:~linear_python_client.client.LinearClient call.

Every client method takes exactly one of these. They carry snake_case fields with camelCase aliases, and expose helpers (to_variables, to_input) that serialise them into the GraphQL variables the API expects.

IssueRequest

Bases: LinearModel

Fetch a single issue by id or human identifier (e.g. "ENG-123").

UserRequest

Bases: LinearModel

Fetch a single user by UUID.

TeamRequest

Bases: LinearModel

Fetch a single team by UUID.

ProjectRequest

Bases: LinearModel

Fetch a single project by UUID.

CommentRequest

Bases: LinearModel

Fetch a single comment by UUID.

PaginatedRequest

Bases: LinearModel

Base for list requests: cursor pagination plus an optional filter.

Attributes:

Name Type Description
first int | None

Maximum number of results to return (Linear defaults to 50).

after str | None

Pagination cursor; pass the previous page's end_cursor.

filter dict[str, Any] | None

A Linear filter dict.

to_variables

to_variables() -> dict[str, Any]

Serialise to GraphQL variables (camelCase, omitting unset values).

Source code in src/linear_python_client/models/requests.py
def to_variables(self) -> dict[str, Any]:
    """Serialise to GraphQL variables (camelCase, omitting unset values)."""
    return self.model_dump(by_alias=True, exclude_none=True)

IssuesRequest

Bases: PaginatedRequest

List issues, optionally filtered and ordered.

Attributes:

Name Type Description
order_by str | None

Sort order, either "createdAt" (default) or "updatedAt".

UsersRequest

Bases: PaginatedRequest

List users in the workspace.

TeamsRequest

Bases: PaginatedRequest

List teams in the workspace.

ProjectsRequest

Bases: PaginatedRequest

List projects in the workspace.

IssueLabelsRequest

Bases: PaginatedRequest

List issue labels in the workspace.

CommentsRequest

Bases: PaginatedRequest

List comments, optionally scoped to a single issue.

Attributes:

Name Type Description
issue_id str | None

When set, only comments on this issue are returned (merged into filter). Not sent as a raw variable.

WorkflowStatesRequest

Bases: PaginatedRequest

List workflow states, optionally scoped to a single team.

Attributes:

Name Type Description
team_id str | None

When set, only states belonging to this team are returned (merged into filter). Not sent as a raw variable.

IssueCreateRequest

Bases: LinearModel

Input for creating an issue.

Any field accepted by Linear's IssueCreateInput may also be passed as an extra keyword argument using its camelCase API name (e.g. dueDate="2026-01-01").

Attributes:

Name Type Description
team_id str

UUID of the team the issue belongs to (required).

title str

The issue title (required).

description str | None

Markdown body for the issue.

assignee_id str | None

UUID of the user to assign.

state_id str | None

UUID of the workflow state to set.

priority int | None

Priority from 0 (none) to 4 (low); 1 is urgent.

label_ids list[str] | None

UUIDs of labels to attach.

project_id str | None

UUID of the project to add the issue to.

to_input

to_input() -> dict[str, Any]

Serialise to an IssueCreateInput dict (camelCase, omitting unset values).

Source code in src/linear_python_client/models/requests.py
def to_input(self) -> dict[str, Any]:
    """Serialise to an `IssueCreateInput` dict (camelCase, omitting unset values)."""
    return self.model_dump(by_alias=True, exclude_none=True)

IssueUpdateRequest

Bases: LinearModel

Input for updating an issue.

At least one field other than id must be set. Any field accepted by Linear's IssueUpdateInput may also be passed as an extra keyword argument using its camelCase API name.

Attributes:

Name Type Description
id str

UUID of the issue to update (required).

title str | None

New title.

description str | None

New markdown body.

assignee_id str | None

UUID of the user to assign.

state_id str | None

UUID of the workflow state to set.

priority int | None

Priority from 0 (none) to 4 (low); 1 is urgent.

label_ids list[str] | None

UUIDs of labels to set.

project_id str | None

UUID of the project to move the issue to.

to_input

to_input() -> dict[str, Any]

Serialise the update fields to an IssueUpdateInput dict (excluding id).

Source code in src/linear_python_client/models/requests.py
def to_input(self) -> dict[str, Any]:
    """Serialise the update fields to an `IssueUpdateInput` dict (excluding `id`)."""
    data = self.model_dump(by_alias=True, exclude_none=True)
    data.pop("id", None)
    return data

IssueArchiveRequest

Bases: LinearModel

Archive an issue by UUID.

IssueAddLabelRequest

Bases: LinearModel

Add a single label to an issue, leaving its other labels untouched.

Attributes:

Name Type Description
id str

UUID of the issue.

label_id str

UUID of the label to add.

IssueRemoveLabelRequest

Bases: LinearModel

Remove a single label from an issue, leaving its other labels untouched.

Attributes:

Name Type Description
id str

UUID of the issue.

label_id str

UUID of the label to remove.

IssueSetStateRequest

Bases: LinearModel

Move an issue to a workflow state (status).

Attributes:

Name Type Description
id str

UUID of the issue.

state_id str

UUID of the target workflow state. Resolve one by name with find_workflow_state.

FindWorkflowStateRequest

Bases: LinearModel

Resolve a workflow state by name within a team.

Attributes:

Name Type Description
team_id str

UUID of the team that owns the state.

name str

State name to match, case-insensitively (e.g. "In Progress").

FindTeamRequest

Bases: LinearModel

Resolve a team by its display name or key.

Provide at least one of name / key. Matching is case-insensitive for the name and exact for the key.

Attributes:

Name Type Description
name str | None

Team display name (e.g. "Ravens").

key str | None

Team key (e.g. "RAV").

to_filter

to_filter() -> dict[str, Any]

Build the TeamFilter for this lookup.

Source code in src/linear_python_client/models/requests.py
def to_filter(self) -> dict[str, Any]:
    """Build the `TeamFilter` for this lookup."""
    filter_: dict[str, Any] = {}
    if self.key:
        filter_["key"] = {"eq": self.key}
    if self.name:
        filter_["name"] = {"eqIgnoreCase": self.name}
    return filter_

FindUserRequest

Bases: LinearModel

Resolve a user by name, display name, or email.

Provide at least one of name / email. The name value is matched (case-insensitively) against both the full name and the display name.

Attributes:

Name Type Description
name str | None

Full name or display name (e.g. "Elijah Winter").

email str | None

Email address.

to_filter

to_filter() -> dict[str, Any]

Build the UserFilter for this lookup.

Source code in src/linear_python_client/models/requests.py
def to_filter(self) -> dict[str, Any]:
    """Build the `UserFilter` for this lookup."""
    clauses: list[dict[str, Any]] = []
    if self.name:
        clauses.append(
            {
                "or": [
                    {"name": {"eqIgnoreCase": self.name}},
                    {"displayName": {"eqIgnoreCase": self.name}},
                ]
            }
        )
    if self.email:
        clauses.append({"email": {"eqIgnoreCase": self.email}})
    return clauses[0] if len(clauses) == 1 else {"and": clauses}

FindProjectRequest

Bases: LinearModel

Resolve a project by name.

Attributes:

Name Type Description
name str

Project name to match, case-insensitively.

to_filter

to_filter() -> dict[str, Any]

Build the ProjectFilter for this lookup.

Source code in src/linear_python_client/models/requests.py
def to_filter(self) -> dict[str, Any]:
    """Build the `ProjectFilter` for this lookup."""
    return {"name": {"eqIgnoreCase": self.name}}

FindLabelRequest

Bases: LinearModel

Resolve an issue label by name, optionally scoped to a team.

Attributes:

Name Type Description
name str

Label name to match, case-insensitively (e.g. "bug").

team_id str | None

Optional team UUID to disambiguate team-scoped labels.

to_filter

to_filter() -> dict[str, Any]

Build the IssueLabelFilter for this lookup.

Source code in src/linear_python_client/models/requests.py
def to_filter(self) -> dict[str, Any]:
    """Build the `IssueLabelFilter` for this lookup."""
    filter_: dict[str, Any] = {"name": {"eqIgnoreCase": self.name}}
    if self.team_id:
        filter_["team"] = {"id": {"eq": self.team_id}}
    return filter_

CommentCreateRequest

Bases: LinearModel

Input for adding a comment to an issue.

Any field accepted by Linear's CommentCreateInput may also be passed as an extra keyword argument using its camelCase API name.

Attributes:

Name Type Description
issue_id str

UUID of the issue to comment on (required).

body str

Markdown body of the comment (required).

to_input

to_input() -> dict[str, Any]

Serialise to a CommentCreateInput dict (camelCase, omitting unset values).

Source code in src/linear_python_client/models/requests.py
def to_input(self) -> dict[str, Any]:
    """Serialise to a `CommentCreateInput` dict (camelCase, omitting unset values)."""
    return self.model_dump(by_alias=True, exclude_none=True)