# AutoWiki API

Generate and manage AutoWiki runs: create runs, browse pages, search, and export.

## List the latest wiki runs

`GET /api/v0/wiki`

Returns the most recent wiki generation runs available to the authenticated organization.

```bash
curl 'https://api.factory.ai/api/v0/wiki' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Create a wiki run

`POST /api/v0/wiki`

Starts a wiki generation run for a connected repository.

```bash
curl -X POST 'https://api.factory.ai/api/v0/wiki' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## List wiki run history for a repository

`GET /api/v0/wiki/history/{repoUrl}`

Returns wiki generation history for the repository identified by its URL.

```bash
curl 'https://api.factory.ai/api/v0/wiki/history/{repoUrl}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `repoUrl` (`string`, required) - Path parameter

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Check whether the caller can upload a wiki for a repository

`GET /api/v0/wiki/upload-access`

Check whether the caller can upload a wiki for a repository.

```bash
curl 'https://api.factory.ai/api/v0/wiki/upload-access' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `repoUrl` (`string`, required) - Query parameter. Repository URL that will be passed to POST /api/v0/wiki

**Response:** `200` - Response for status 200

```json
{
  "type": "object",
  "properties": {
    "allowed": {
      "type": "boolean",
      "enum": [
        true
      ]
    }
  },
  "required": [
    "allowed"
  ],
  "additionalProperties": false
}
```

**Response:** `400` - Response for status 400

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `403` - Response for status 403

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `503` - Response for status 503

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Create a wiki video upload URL

`POST /api/v0/wiki/video-upload-url`

Creates a temporary upload URL for a generated wiki video.

```bash
curl -X POST 'https://api.factory.ai/api/v0/wiki/video-upload-url' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Get a wiki run

`GET /api/v0/wiki/{wikiRunId}`

Returns the status and output metadata for a wiki generation run.

```bash
curl 'https://api.factory.ai/api/v0/wiki/{wikiRunId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `wikiRunId` (`string`, required) - Path parameter

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Delete a wiki run

`DELETE /api/v0/wiki/{wikiRunId}`

Deletes the wiki generation run identified by its ID.

```bash
curl -X DELETE 'https://api.factory.ai/api/v0/wiki/{wikiRunId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `wikiRunId` (`string`, required) - Path parameter

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Export a wiki run as a zip

`GET /api/v0/wiki/{wikiRunId}/export`

Downloads the generated wiki files for a run as a ZIP archive.

```bash
curl 'https://api.factory.ai/api/v0/wiki/{wikiRunId}/export' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `wikiRunId` (`string`, required) - Path parameter

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Get a wiki page

`GET /api/v0/wiki/{wikiRunId}/pages/{pageId}`

Returns one generated page from a wiki run.

```bash
curl 'https://api.factory.ai/api/v0/wiki/{wikiRunId}/pages/{pageId}' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `wikiRunId` (`string`, required) - Path parameter
- `pageId` (`string`, required) - Path parameter

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Update wiki run privacy level

`POST /api/v0/wiki/{wikiRunId}/privacy`

Updates the privacy level for a generated wiki.

```bash
curl -X POST 'https://api.factory.ai/api/v0/wiki/{wikiRunId}/privacy' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `wikiRunId` (`string`, required) - Path parameter

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

## Search a wiki run

`GET /api/v0/wiki/{wikiRunId}/search`

Searches the generated pages in a wiki run.

```bash
curl 'https://api.factory.ai/api/v0/wiki/{wikiRunId}/search' \
  -H 'Authorization: Bearer $FACTORY_API_KEY'
```

**Parameters**

- `wikiRunId` (`string`, required) - Path parameter

**Response:** `200` - Response for status 200

```json
{}
```

**Response:** `401` - Response for status 401

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```

**Response:** `500` - Response for status 500

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": false
}
```
