# Factory

> Create and manage Droid sessions, read messages, computers, environments, organization usage and AutoWiki content.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/factory

## Actions

### Add a message to a session

Add a message to a session.

**Inputs**

- SessionId (`sessionId`, text, required): Sessionid
- Text (`text`, text, required): Message text content
- Images (`images`, list): Optional base64-encoded images
- Files (`files`, list): Optional file attachments (PDFs, text files)
- ComputerId (`computerId`, text): Computer ID to route the message to; falls back to the session.computerId if omitted
- Sender (`sender`, object): The mission session sending this message (the orchestrator, or an agent by name), stored on the message so clients can attribute it and the model sees a [From …] header. Omit for human messages.

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "messageId": "example",
    "recipientDroidStatus": "idle",
    "status": "idle"
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Create a session

Create a session.

**Inputs**

- ComputerId (`computerId`, text, required): Computer ID to connect
- Cwd (`cwd`, text): Working directory for the session on the computer.
- SessionSettings (`sessionSettings`, object): Sessionsettings

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "artifacts": [],
    "completedAt": 0,
    "computerId": "example",
    "createdAt": 0,
    "factoryCredits": 0,
    "messageCount": 0,
    "parent_session_id": "example",
    "sessionId": "example",
    "sessionSettings": {
      "allowSubagentsInScripts": false,
      "apiProviderLock": "bedrock",
      "archivedAt": "example",
      "autonomyLevel": "off",
      "autonomyMode": "normal",
      "compactionModel": "example",
      "compactionThresholdCheckEnabled": false,
      "disabledToolIds": [],
      "enabledToolIds": [],
      "interactionMode": "auto",
      "model": "example",
      "providerLock": "anthropic",
      "providerLockTimestamp": "example",
      "reasoningEffort": "none",
      "restrictToolIds": [],
      "specModeModel": "example",
      "specModeReasoningEffort": "none",
      "tags": [],
      "toolExecutionMode": "direct_only",
      "worktree": {
        "branch": "example",
        "lifecycle": "ephemeral",
        "parentWorktreePath": "example",
        "path": "example",
        "removedAt": "example",
        "repoRoot": "example",
        "setupProfileId": "example"
      }
    },
    "status": "idle",
    "title": "example",
    "updatedAt": 0
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Delete a session

Delete a session.

**Inputs**

- SessionId (`sessionId`, text, required): Session ID
- ComputerId (`computerId`, text): Computer ID to query directly

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": "example"
}
```

### Get a computer

Get a computer.

**Inputs**

- ComputerId (`computerId`, text, required): Computer ID

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "clonedRepoDirectories": [],
    "computerIdentity": {
      "algorithm": "X25519",
      "keyId": "example",
      "publicKey": "example",
      "updatedAt": 0
    },
    "computerSource": {
      "kind": "template",
      "templateId": "example"
    },
    "createdAt": 0,
    "hostId": "11111111-1111-4111-8111-111111111111",
    "id": "example",
    "isListed": false,
    "name": "example",
    "ownerId": "example",
    "ownerPrincipalKind": "example",
    "providerType": "example",
    "provisioningSteps": [],
    "relayAgentUrl": "example",
    "relayClientUrl": "example",
    "remoteUser": "example",
    "status": "provisioning"
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Get a message by ID

Get a message by ID.

**Inputs**

- SessionId (`sessionId`, text, required): Session ID
- MessageId (`messageId`, text, required): Message ID
- ComputerId (`computerId`, text): Computer ID to query directly

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "apiProvider": "bedrock",
    "chatCompletionReasoningContent": "example",
    "chatCompletionReasoningField": "reasoning",
    "content": [],
    "createdAt": 0,
    "geminiThoughtSignature": "example",
    "hiddenFromUserViews": false,
    "hookCommands": [],
    "hookEndTime": 0,
    "hookEventName": "example",
    "hookMatcher": "example",
    "hookOrder": 0,
    "hookParentId": "example",
    "hookPreventedAction": false,
    "hookResults": [],
    "hookStartTime": 0,
    "hookStatus": "executing",
    "hookToolCallId": "example",
    "id": "example",
    "interactionMode": "auto",
    "isError": false,
    "isParallelExecution": false,
    "isUserVisible": false,
    "modelId": "example",
    "openaiEncryptedContent": "example",
    "openaiMessageId": "example",
    "openaiPhase": "commentary",
    "openaiReasoningId": "example",
    "openaiReasoningSummary": "example",
    "parallelGroupId": "example",
    "parentId": "example",
    "reasoningEffort": "none",
    "role": "user",
    "routerId": "example",
    "sender": {
      "kind": "orchestrator",
      "sessionId": "example"
    },
    "seq": 0,
    "updatedAt": 0,
    "userMessageSource": "web",
    "visibility": "both"
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Get a session

Get a session.

**Inputs**

- SessionId (`sessionId`, text, required): Session ID
- ComputerId (`computerId`, text): Computer ID to query directly

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "artifacts": [],
    "completedAt": 0,
    "computerId": "example",
    "createdAt": 0,
    "factoryCredits": 0,
    "messageCount": 0,
    "parent_session_id": "example",
    "sessionId": "example",
    "sessionSettings": {
      "allowSubagentsInScripts": false,
      "apiProviderLock": "bedrock",
      "archivedAt": "example",
      "autonomyLevel": "off",
      "autonomyMode": "normal",
      "compactionModel": "example",
      "compactionThresholdCheckEnabled": false,
      "disabledToolIds": [],
      "enabledToolIds": [],
      "interactionMode": "auto",
      "model": "example",
      "providerLock": "anthropic",
      "providerLockTimestamp": "example",
      "reasoningEffort": "none",
      "restrictToolIds": [],
      "specModeModel": "example",
      "specModeReasoningEffort": "none",
      "tags": [],
      "toolExecutionMode": "direct_only",
      "worktree": {
        "branch": "example",
        "lifecycle": "ephemeral",
        "parentWorktreePath": "example",
        "path": "example",
        "removedAt": "example",
        "repoRoot": "example",
        "setupProfileId": "example"
      }
    },
    "status": "idle",
    "title": "example",
    "updatedAt": 0
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Get a wiki page

Get a wiki page.

**Inputs**

- WikiRunId (`wikiRunId`, text, required): Wikirunid
- PageId (`pageId`, text, required): Pageid

**Outputs**

- `data` (object): AutoWiki response; its shape is not specified by the published contract.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": "example"
}
```

### Get a wiki run

Get a wiki run.

**Inputs**

- WikiRunId (`wikiRunId`, text, required): Wikirunid

**Outputs**

- `data` (object): AutoWiki response; its shape is not specified by the published contract.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": "example"
}
```

### Get an Environment

Get an Environment.

**Inputs**

- EnvironmentId (`environmentId`, text, required): Environmentid

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "activeRepositories": [],
    "activeSource": {
      "id": "example",
      "name": "example",
      "provider": {
        "id": "example",
        "name": "example"
      },
      "supportsRepositories": false,
      "supportsSetupScripts": false,
      "unavailable": true
    },
    "createdAt": 0,
    "failureReason": "example",
    "id": "example",
    "isDefault": false,
    "lastSuccessfulBuildAt": 0,
    "latestBuild": {
      "createdAt": 0,
      "excerpt": "example",
      "failureCategory": "source-resolution",
      "failureReason": "example",
      "finishedAt": 0,
      "id": "example",
      "promotedAt": 0,
      "repositories": [],
      "startedAt": 0,
      "status": "queued",
      "trigger": "create",
      "truncated": false,
      "withheld": false
    },
    "name": "example",
    "repositories": [],
    "scope": "user",
    "setupScript": "example",
    "source": {
      "id": "example",
      "name": "example",
      "provider": {
        "id": "example",
        "name": "example"
      },
      "supportsRepositories": false,
      "supportsSetupScripts": false,
      "unavailable": true
    },
    "status": "building",
    "updatedAt": 0
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Get computer metrics

Get computer metrics.

**Inputs**

- ComputerId (`computerId`, text, required): Computer ID
- Start (`start`, date and time): Start of time range (ISO 8601)

**Outputs**

- `data` (list): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": "example"
}
```

### Get Factory Environment Build Diagnostics

Get Factory Environment Build Diagnostics.

**Inputs**

- EnvironmentId (`environmentId`, text, required): Environmentid

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "buildId": "example",
    "excerpt": "example",
    "status": "building",
    "truncated": false,
    "withheld": false
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Get global user credits limit

Get global user credits limit.

**Inputs**: None.

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "limit": null
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Get session messages

Get session messages.

**Inputs**

- SessionId (`sessionId`, text, required): Sessionid
- Limit (`limit`, text): Maximum number of items to return (1-100)
- Cursor (`cursor`, text): Cursor for pagination
- ComputerId (`computerId`, text): Computer ID to query directly
- Role (`role`, text): Filter messages by role. One of: `user`, `assistant`, `tool`.

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "messages": [],
    "pagination": {
      "hasMore": false,
      "nextCursor": null
    }
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### Interrupt a session

Interrupt a session.

**Inputs**

- SessionId (`sessionId`, text, required): Sessionid

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "status": "idle"
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List a session's child sessions

List a session's child sessions.

**Inputs**

- SessionId (`sessionId`, text, required): The parent session id
- IncludeArtifacts (`includeArtifacts`, text): Whether to include each child session’s integration artifacts (pull requests, issues, pages). One of: `true`, `false`.
- IncludeAttention (`includeAttention`, text): Whether to include what each child session is waiting on (a permission prompt or a question). One of: `true`, `false`.

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "sessions": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List available computer providers

List available computer providers.

**Inputs**: None.

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "providers": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List available Factory Environment sources

List available Factory Environment sources.

**Inputs**: None.

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "providers": [],
    "unavailableProviders": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List computers

List computers.

**Inputs**

- HostId (`hostId`, text): Hostid
- ServiceAccountId (`serviceAccountId`, text): Look up a service account’s Computers (requires human Manager+).
- IncludeProvisioningSteps (`includeProvisioningSteps`, text): Whether to include provisioning step details. One of: `true`, `false`.
- IncludeUnlisted (`includeUnlisted`, text): Whether to include Computers hidden from normal listings. One of: `true`, `false`.

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "computers": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List current Factory Environment build statuses

List current Factory Environment build statuses.

**Inputs**

- EnvironmentIds (`environmentIds`, list, required): Environmentids
- ServiceAccountId (`serviceAccountId`, text): Serviceaccountid

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "builds": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List Factory Environments visible to the caller

List Factory Environments visible to the caller.

**Inputs**

- ServiceAccountId (`serviceAccountId`, text): Serviceaccountid

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "defaultEnvironmentId": "example",
    "environments": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List organization users

List organization users.

**Inputs**

- Limit (`limit`, text): Maximum number of items to return (1-100)
- Cursor (`cursor`, text): Cursor for pagination

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "pagination": {
      "hasMore": false,
      "nextCursor": null
    },
    "users": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List sessions

List sessions.

**Inputs**

- Limit (`limit`, text): Maximum number of items to return (1-100)
- Cursor (`cursor`, text): Cursor for pagination
- ComputerId (`computerId`, text): Computer ID to query directly

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "pagination": {
      "hasMore": false,
      "nextCursor": null
    },
    "sessions": []
  },
  "has_more": false,
  "next_cursor": "example"
}
```

### List the latest wiki runs

List the latest wiki runs.

**Inputs**: None.

**Outputs**

- `data` (object): AutoWiki response; its shape is not specified by the published contract.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": "example"
}
```

### Search a wiki run

Search a wiki run.

**Inputs**

- WikiRunId (`wikiRunId`, text, required): Wikirunid

**Outputs**

- `data` (object): AutoWiki response; its shape is not specified by the published contract.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": "example"
}
```

### Update a session

Update a session.

**Inputs**

- SessionId (`sessionId`, text, required): Session ID
- SessionSettings (`sessionSettings`, object): Sessionsettings

**Outputs**

- `data` (object): The response returned by the service.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Continuation token for the next page.

**Example output**

```json
{
  "data": {
    "artifacts": [],
    "completedAt": 0,
    "computerId": "example",
    "createdAt": 0,
    "factoryCredits": 0,
    "messageCount": 0,
    "parent_session_id": "example",
    "sessionId": "example",
    "sessionSettings": {
      "allowSubagentsInScripts": false,
      "apiProviderLock": "bedrock",
      "archivedAt": "example",
      "autonomyLevel": "off",
      "autonomyMode": "normal",
      "compactionModel": "example",
      "compactionThresholdCheckEnabled": false,
      "disabledToolIds": [],
      "enabledToolIds": [],
      "interactionMode": "auto",
      "model": "example",
      "providerLock": "anthropic",
      "providerLockTimestamp": "example",
      "reasoningEffort": "none",
      "restrictToolIds": [],
      "specModeModel": "example",
      "specModeReasoningEffort": "none",
      "tags": [],
      "toolExecutionMode": "direct_only",
      "worktree": {
        "branch": "example",
        "lifecycle": "ephemeral",
        "parentWorktreePath": "example",
        "path": "example",
        "removedAt": "example",
        "repoRoot": "example",
        "setupProfileId": "example"
      }
    },
    "status": "idle",
    "title": "example",
    "updatedAt": 0
  },
  "has_more": false,
  "next_cursor": "example"
}
```
