Create Max Code Project Asset
POST /v1/max-code/projects/{project_id}/assets
This operation can change data. Use resources you control.
Request fields
| Field | Location | Type | Required |
|---|---|---|---|
project_id | path | string | Required |
api_key_id | body | string | null | Optional |
api_key_name | body | string | null | Optional |
asset_key | body | string | Required |
content_base64 | body | string | Required |
expected_revision | body | integer | null | Optional |
kind | body | string | Required |
metadata | body | object | null | Optional |
mime_type | body | string | Required |
Examples
Use the environment settings from Quickstart. Replace sample resource IDs with your own. The examples show the required request shape.
import { MaxClient } from "@elmax/api";
const max = new MaxClient({
baseURL: process.env.MAX_API_URL,
apiKey: process.env.MAX_API_KEY,
});
const result = await max.api.postV1MaxCodeProjectsProjectIdAssets({
"path": {
"project_id": "icp_example"
},
"body": {
"asset_key": "icons/help.svg",
"kind": "example",
"mime_type": "text/plain",
"content_base64": "SGVsbG8hCg=="
}
});
console.log(result);import os
from elmax_ai import MaxClient
with MaxClient(base_url=os.environ["MAX_API_URL"], api_key=os.environ["MAX_API_KEY"]) as max:
result = max.api.post_v1_max_code_projects_project_id_assets(**{'path': {'project_id': 'icp_example'},
'body': {'asset_key': 'icons/help.svg',
'kind': 'example',
'mime_type': 'text/plain',
'content_base64': 'SGVsbG8hCg=='}})
print(result)