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

# Convert media asset

POST https://api.aventure.vc/v1/media/convert

Reprocesses an external source URL, existing managed source path, or the current attached entity/person/news image through imgproxy, stores the normalized asset, and attaches it to the selected media slot.

Reference: https://docs.aventure.vc/api-reference/a-venture-api/media/convert-media

## Authentication

- `Authorization` header (bearer token, required) — User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key
- `X-API-Key` header (required) — Admin API key for system-to-system write operations

## Request

### Query parameters

- `mediaType` (enum, required) — Media target type.
  - Allowed values: `ENTITY`, `PERSON`, `NEWS`, `BLOG`
- `id` (string, optional) — Target UUID for entity/person or integer id for news.
- `slug` (string, optional) — Target slug.
- `logoType` (enum, optional) — Entity logo variant.
  - Allowed values: `SQUARE`, `STANDARD`
- `sourceUrl` (string, optional) — External http(s) image URL to fetch through the backend image-fetch guard before imgproxy normalization.
- `sourcePath` (string, optional) — Existing managed storage path or API CDN URL to reprocess through imgproxy. This may point at a legacy raw object; the converted result must satisfy the configured final media profile before attachment.
- `permitWide` (boolean, optional, default: false) — Fallback that permits a wide (non-square) logo or photo into the square slot, used only after confirming no square or near-square source exists. Default false rejects wide wordmark/banner content. Ignored for news thumbnails (wide by design). Blank or invisible images are always rejected regardless of this flag.
- `permitNearFloorWordmark` (boolean, optional, default: false) — For entity logos, permits a high-confidence page wordmark slightly below the minimum square icon dimensions, matching the near-floor exception granted at initial import. Ignored for person photos and news thumbnails. Default false rejects below-minimum images. Blank or invisible images are always rejected regardless of this flag.
- `sourceType` (enum, required) — Write provenance source type.
  - Allowed values: `requestChangeForm`, `newsArticle`, `blogArticle`, `firstPartyWebsite`, `relatedPartyWebsite`, `thirdPartyWebsite`, `llm`, `aventureStaff`
- `sourceDetail` (string, required) — Source detail or reviewer reference for the write.
- `sourceProvider` (string, optional) — Provider name for provider-native IDs or slugs.
- `sourceProviderId` (string, optional) — Provider-native source ID.
- `sourceProviderSlug` (string, optional) — Provider-native source slug.
- `actorType` (enum, optional) — Actor type; inferred as agent when agentChassis and agentModel are supplied, or as employee from an authenticated user JWT session.
  - Allowed values: `agent`, `employee`
- `agentChassis` (string, optional) — Agent chassis token for agent-authored writes.
- `agentModel` (string, optional) — Agent model id for agent-authored writes.

## Response

### 200

OK

- `cdnUrl` (string, required) — Resolved API CDN URL
- `mediaType` (enum, required) — Target media domain
  - Allowed values: `ENTITY`, `PERSON`, `NEWS`, `BLOG`
- `path` (string, required) — Attached managed storage path; never an external image URL
- `firstUploadedAt` (datetime, optional, nullable) — Earliest recorded write timestamp for this media asset slot from res_provenance_event (when this entity/person/news first received any image in this slot).
- `provenance` (object, optional, nullable) — Latest write source for this media asset slot from res_provenance_event. `changedAt` is the last-modified timestamp of the current attached file.
  - `changedAt` (datetime, optional, nullable)
  - `dataSourceUpdatedAt` (datetime, optional, nullable)
  - `detail` (string, optional, nullable)
  - `kind` (string, optional, nullable)
  - `pendingApproval` (integer, optional, nullable)
  - `sourceId` (string, optional, nullable)
  - `status` (string, optional, nullable)
- `targetId` (string, optional, nullable) — Attached entity/person/news target id, when known

## Examples

**Response**

```json
{
  "cdnUrl": "string",
  "mediaType": "ENTITY",
  "path": "string",
  "firstUploadedAt": "2024-01-15T09:30:00Z",
  "provenance": {
    "changedAt": "2024-01-15T09:30:00Z",
    "dataSourceUpdatedAt": "2024-01-15T09:30:00Z",
    "detail": "string",
    "kind": "string",
    "pendingApproval": 1,
    "sourceId": "string",
    "status": "string"
  },
  "targetId": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.aventure.vc/v1/media/convert"

querystring = {"actorType":"agent","agentChassis":"codex-cli","mediaType":"ENTITY","sourceDetail":"aventure.vc","sourceProvider":"TechCrunch","sourceProviderId":"tc-2026-05-20-example-round","sourceProviderSlug":"example-round","sourceType":"requestChangeForm"}

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript
const url = 'https://api.aventure.vc/v1/media/convert?actorType=agent&agentChassis=codex-cli&mediaType=ENTITY&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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.aventure.vc/v1/media/convert?actorType=agent&agentChassis=codex-cli&mediaType=ENTITY&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm"

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

	req.Header.Add("Authorization", "Bearer <token>")

	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.aventure.vc/v1/media/convert?actorType=agent&agentChassis=codex-cli&mediaType=ENTITY&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

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.aventure.vc/v1/media/convert?actorType=agent&agentChassis=codex-cli&mediaType=ENTITY&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.aventure.vc/v1/media/convert?actorType=agent&agentChassis=codex-cli&mediaType=ENTITY&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.aventure.vc/v1/media/convert?actorType=agent&agentChassis=codex-cli&mediaType=ENTITY&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.aventure.vc/v1/media/convert?actorType=agent&agentChassis=codex-cli&mediaType=ENTITY&sourceDetail=aventure.vc&sourceProvider=TechCrunch&sourceProviderId=tc-2026-05-20-example-round&sourceProviderSlug=example-round&sourceType=requestChangeForm")! 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()
```