---
title: prefactor_http.models.agent module
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

# prefactor_http.models.agent module

Agent data models.

### *class* prefactor_http.models.agent.Agent(, type: Literal['agent'], id: str, name: str, description: str | None = None, external_identifier: str | None = None, status: Literal['pending', 'active', 'dormant', 'retired'], owner_person_id: str | None = None, risk_profile_id: str | None = None, team_id: str | None = None, instance_counts: [AgentInstanceCounts](#prefactor_http.models.agent.AgentInstanceCounts) | None = None, available_actions: [AgentAvailableActions](#prefactor_http.models.agent.AgentAvailableActions) | None = None, inserted_at: datetime | None = None, updated_at: datetime | None = None)

Bases: `BaseModel`

Full agent details.

#### type

Resource type (always “agent”).

* **Type:**
  Literal[‘agent’]

#### id

Agent ID.

* **Type:**
  str

#### name

Agent name.

* **Type:**
  str

#### description

Optional agent description.

* **Type:**
  str | None

#### external_identifier

Optional external identifier (unique per account).

* **Type:**
  str | None

#### status

Agent status (pending, active, dormant, retired).

* **Type:**
  Literal[‘pending’, ‘active’, ‘dormant’, ‘retired’]

#### owner_person_id

Optional owner person ID.

* **Type:**
  str | None

#### risk_profile_id

Optional risk profile ID.

* **Type:**
  str | None

#### team_id

Optional team ID.

* **Type:**
  str | None

#### instance_counts

Instance counts for this agent.

* **Type:**
  [AgentInstanceCounts](#prefactor_http.models.agent.AgentInstanceCounts) | None

#### available_actions

Available actions based on current status.

* **Type:**
  [AgentAvailableActions](#prefactor_http.models.agent.AgentAvailableActions) | None

#### inserted_at

When the agent was created.

* **Type:**
  datetime | None

#### updated_at

When the agent was last updated.

* **Type:**
  datetime | None

#### available_actions *: [AgentAvailableActions](#prefactor_http.models.agent.AgentAvailableActions) | None*

#### description *: str | None*

#### external_identifier *: str | None*

#### id *: str*

#### inserted_at *: datetime | None*

#### instance_counts *: [AgentInstanceCounts](#prefactor_http.models.agent.AgentInstanceCounts) | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### name *: str*

#### owner_person_id *: str | None*

#### risk_profile_id *: str | None*

#### status *: Literal['pending', 'active', 'dormant', 'retired']*

#### team_id *: str | None*

#### type *: Literal['agent']*

#### updated_at *: datetime | None*

### *class* prefactor_http.models.agent.AgentAvailableActions(, update: bool = False, retire: bool = False, reinstate: bool = False, delete: bool = False)

Bases: `BaseModel`

Available actions for an agent based on its status.

#### update

Whether the agent can be updated.

* **Type:**
  bool

#### retire

Whether the agent can be retired.

* **Type:**
  bool

#### reinstate

Whether the agent can be reinstated from retired.

* **Type:**
  bool

#### delete

Whether the agent can be deleted.

* **Type:**
  bool

#### delete *: bool*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### reinstate *: bool*

#### retire *: bool*

#### update *: bool*

### *class* prefactor_http.models.agent.AgentForCreate(, name: str, description: str | None = None, external_identifier: str | None = None, id: str | None = None, owner_person_id: str | None = None, risk_profile_id: str | None = None, team_id: str | None = None)

Bases: `BaseModel`

Parameters for creating a new agent.

#### name

Agent name (required).

* **Type:**
  str

#### description

Optional agent description.

* **Type:**
  str | None

#### external_identifier

Optional external identifier (unique per account).

* **Type:**
  str | None

#### id

Optional custom ID (PFID with matching partition).

* **Type:**
  str | None

#### owner_person_id

Optional owner person ID.

* **Type:**
  str | None

#### risk_profile_id

Optional risk profile ID.

* **Type:**
  str | None

#### team_id

Optional team ID.

* **Type:**
  str | None

#### description *: str | None*

#### external_identifier *: str | None*

#### id *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### name *: str*

#### owner_person_id *: str | None*

#### risk_profile_id *: str | None*

#### team_id *: str | None*

### *class* prefactor_http.models.agent.AgentForUpdate(, name: str | None = None, description: str | None = None, owner_person_id: str | None = None, risk_profile_id: str | None = None, team_id: str | None = None)

Bases: `BaseModel`

Parameters for updating an agent.

Note: `external_identifier` cannot be updated via the API — it is only
settable at create time.

#### name

Agent name (omit to keep current).

* **Type:**
  str | None

#### description

Agent description (omit to keep current).

* **Type:**
  str | None

#### owner_person_id

Owner person ID (omit to keep current; null to clear).

* **Type:**
  str | None

#### risk_profile_id

Risk profile ID (omit to keep current; null to clear).

* **Type:**
  str | None

#### team_id

Team ID (omit to keep current; null to clear).

* **Type:**
  str | None

#### description *: str | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### name *: str | None*

#### owner_person_id *: str | None*

#### risk_profile_id *: str | None*

#### team_id *: str | None*

### *class* prefactor_http.models.agent.AgentInstanceCounts(, total: int = 0, pending: int = 0, active: int = 0, complete: int = 0, failed: int = 0, cancelled: int = 0, terminated: int = 0, finished: int = 0)

Bases: `BaseModel`

Instance counts for an agent.

#### total

Total number of agent instances.

* **Type:**
  int

#### pending

Number of instances with status pending.

* **Type:**
  int

#### active

Number of instances with status active (running).

* **Type:**
  int

#### complete

Number of instances with status complete.

* **Type:**
  int

#### failed

Number of instances with status failed.

* **Type:**
  int

#### cancelled

Number of instances with status cancelled.

* **Type:**
  int

#### terminated

Number of instances with status terminated.

* **Type:**
  int

#### finished

Number of instances in a finished state.

* **Type:**
  int

#### active *: int*

#### cancelled *: int*

#### complete *: int*

#### failed *: int*

#### finished *: int*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### pending *: int*

#### terminated *: int*

#### total *: int*

### *class* prefactor_http.models.agent.AgentSummary(, type: Literal['agent'], id: str, name: str, description: str | None = None, external_identifier: str | None = None, status: Literal['pending', 'active', 'dormant', 'retired'], owner_person_id: str | None = None, team_id: str | None = None, available_actions: [AgentAvailableActions](#prefactor_http.models.agent.AgentAvailableActions) | None = None, inserted_at: datetime | None = None, updated_at: datetime | None = None)

Bases: `BaseModel`

Agent summary for list responses.

#### type

Resource type (always “agent”).

* **Type:**
  Literal[‘agent’]

#### id

Agent ID.

* **Type:**
  str

#### name

Agent name.

* **Type:**
  str

#### description

Optional agent description.

* **Type:**
  str | None

#### external_identifier

Optional external identifier (unique per account).

* **Type:**
  str | None

#### status

Agent status.

* **Type:**
  Literal[‘pending’, ‘active’, ‘dormant’, ‘retired’]

#### owner_person_id

Optional owner person ID.

* **Type:**
  str | None

#### team_id

Optional team ID.

* **Type:**
  str | None

#### available_actions

Available actions based on current status.

* **Type:**
  [AgentAvailableActions](#prefactor_http.models.agent.AgentAvailableActions) | None

#### inserted_at

When the agent was created.

* **Type:**
  datetime | None

#### updated_at

When the agent was last updated.

* **Type:**
  datetime | None

#### available_actions *: [AgentAvailableActions](#prefactor_http.models.agent.AgentAvailableActions) | None*

#### description *: str | None*

#### external_identifier *: str | None*

#### id *: str*

#### inserted_at *: datetime | None*

#### model_config *= {}*

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

#### name *: str*

#### owner_person_id *: str | None*

#### status *: Literal['pending', 'active', 'dormant', 'retired']*

#### team_id *: str | None*

#### type *: Literal['agent']*

#### updated_at *: datetime | None*