> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.athenaintel.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.athenaintel.com/_mcp/server.

# Turn an uploaded HTML file into a user interface

POST https://api.athenaintel.com/api/v0/assets/{asset_id}/convert-to-user-interface

Turn an uploaded HTML file into a user interface (an app) under its own id — the conversion the Athena app's Convert to user interface performs. The asset keeps its id, folder, links and sharing (its title drops the .html extension), and no second asset is created. An uploaded HTML file stays a file until a request like this one asks: nothing converts on its own. The switch is one-way; the original upload stays downloadable from the asset's Versions pane. Requires edit access to the file. Idempotent: an asset that already is a user interface is answered as it is, with converted false. A refused conversion answers with a detail object: code CONVERSION_REFUSED, the reason, and a message saying why.

Reference: https://docs.athenaintel.com/api-reference/assets/convert-to-user-interface

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `asset_id` (string, required) — ID of the uploaded HTML file to turn into a user interface

## Response

### 200

The asset is a user interface under its own id

- `asset_id` (string, required) — ID of the user interface: the HTML file's own id, which it keeps (no second asset is created)
- `asset_type` (string, required) — Type of the asset after the request: user_interface
- `converted` (boolean, required) — True when this request converted the file; false when the asset already was a user interface, in which case nothing changed
- `title` (string, required) — Title of the user interface
- `parent_folder_id` (string, optional, nullable) — ID of the asset's parent folder, which the conversion keeps
- `workspace_id` (string, optional, nullable) — ID of the workspace that owns the asset

## Errors

### 400 Bad Request Error

The file cannot take the conversion as it is (detail.reason not_a_source, live_file, archived, protected, no_content, too_large or shared_across_workspaces); asking again will not help

- `map from string to any`

### 403 Forbidden Error

Caller cannot read the file, lacks edit access to convert it, or user interfaces are disabled in this environment (detail.code ENVIRONMENT_FEATURE_DISABLED)

- `message` (string, required)

### 404 Not Found Error

Asset not found

- `message` (string, required)

### 409 Conflict Error

The file is changing (detail.reason busy, in_progress or replaced); nothing was converted, so ask again shortly

- `map from string to any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 503 Service Unavailable Error

The conversion could not run (detail.reason unavailable or interrupted); nothing was converted, so retry shortly

- `map from string to any`

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "asset_id": "asset_92492920-d118-42d3-95b4-00eccfe0754f",
  "asset_type": "user_interface",
  "converted": true,
  "title": "landing",
  "parent_folder_id": "asset_folder_12345",
  "workspace_id": "workspace_abc123"
}
```

**SDK Code**

```python
import requests

url = "https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface"

headers = {"X-API-KEY": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface';
const options = {method: 'POST', headers: {'X-API-KEY': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("X-API-KEY", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface")
  .header("X-API-KEY", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface', [
  'headers' => [
    'X-API-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.athenaintel.com/api/v0/assets/asset_id/convert-to-user-interface")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```