---
id: asset-create
title: "Create an asset"
description: "Creates a new asset."
sidebar_label: "Create an asset"
hide_title: true
hide_table_of_contents: true
api: eJzdWG1v4zYS/isEP7WA4rzYKQoBKeDmWjQFug02WVyBJAjG5FjihiK1JJWs1zBwv+V+2v2Sw5CSLcXOrrvY3h6aD4qiDGceDp954Sy5RC+cqoOyhuf83CEE9AyYwScG3mMY8YwHKDzPb/iUPvC7jNsaHdCaC8lzHuVyEdfyjHsUjVNhwfObJZ8hOHTTJpQ8v7lb3WXc4bsGffjRygXPl1xYE9AEeoW61kpEvYdvPQFaci9KrIDewqJGnnM7e4si8KRHOZQEbNYoLe+V5Bk3UBGIKJ3xxmme9RWT0F3Ga0dbCAr9RvXahA9OmYJnz5xzXSIjCWbnLJS4cQ+apiIU0ooHdAeqgoJsa6hmEnjGZ42RGsksvoeq1mRjILtKQHcgmFtXQeA5b5zaCahxeojn1tyaH9h//vVv9rN1rG8mCfiMhVJ55kvbaMlmGNdqK0CzAEWBkiVp69oX8ujo1vzQ15v29jGNc6WR1RDKDl67pAbxAAUp5H1/lCHUPj88bL+MhK0Oq8VB2tPbuiAfxaPd65hIcvuY1sZ+W6SvpHRNnY1iZQIW6HZqvvhHpzcuZKGEsDHDZqitKTwLdmBxPDldbdHwzxrsLd/T7Ml4ssq4sFWlwoEvYT/nJXl29cv0uZkn8HHbgc2drYY+PT4ZT8ifFQaQEHaG7LatTpppCxIle1QQ7a2/CwigbcGmlxcDe0v+gAue80fQTQygYUTHf+6z2QdcdP7tbA73RZpWWWtnL5VR9KNKTaM18UFKRetA3+/KRy/5bbpetnHTZn3GlBG6kcoULCVPz8BIim1PIIaWWomeUXAOFjv39evV76/WKndsTwWsdsBfrboC8ikbUHgimhUKAkr2pEK5r5E9z3//Y91ItgxLPxkPKqQc0oI6t1VtDVUwIqGGQCl7P6J00i8WlPfff3f/3YQKmKvoZVBB2m99TFFBquE8oXXoa2t8csrJ0TH92gayLucxwn0jBHo/bzRh+SL1OVbmXpHuVeetYvw5mX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/O7eusm7FVAisw0dl73ocvvz96ppOrx1iVzF/cQdPlJPhieec05ScVkdaxm9LrsEUTQxOnnQS22BI1mfkjLvq5iZm0UO4XCaJa/uAZrXiWbuVQH/z1d1qtfovbmw0wQ==
sidebar_class_name: "post api-method"
info_path: docs/api/asset
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Create an asset"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/asset"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Creates a new asset.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={undefined}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"type":"object","required":["build_id","name","type","url","application_id"],"properties":{"type":{"type":"string","description":"The type of the asset.","enum":["docker-image","lambda","bundle"],"example":"docker-image"},"url":{"type":"string","format":"uri","description":"The url of the asset.\n\n> • For docker-image assets, this should be the local tagged image or image name.\n>\n> • For lambda assets, this should be the file path of the lambda package.\n","example":"https://example.com/my-asset.jpg"},"name":{"type":"string","description":"The name of the asset.","example":"My asset"},"build_id":{"type":"integer","description":"The ID of the build that the asset belongs to.","example":345},"application_id":{"type":"integer","description":"The ID of the application that the asset belongs to.","example":234},"commit-sha":{"type":"string","description":"The commit SHA that the asset was built from.","example":"1234"},"metadata":{"type":"object","description":"The metadata loaded via the metadata catalog API.","example":{"key":"value"},"properties":{"key":{"type":"string","description":"The key of the metadata.","example":"key"},"value":{"type":"string","description":"The value of the metadata.","example":null},"additional_properties":{"type":"object","description":"Additional metadata properties, including schemas and tags.","properties":{"schemas":{"type":"array","description":"The JSON schemas of the metadata.","items":{"type":"object"}},"tags":{"type":"array","description":"Tags associated with the metadata.","items":{"type":"object","properties":{"key":{"type":"string","example":"key"},"value":{"type":"string","example":"value"}}}}}}},"title":"MetadataComponent"},"platform":{"type":"string","description":"The platform of the asset.","enum":["x86_64","arm_64"],"example":"arm_64"}},"title":"assetCreate"}}}}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"201":{"description":"The operation was successful.","content":{"application/json":{"schema":{"type":"object","required":["id","build_id","type","url"],"properties":{"id":{"type":"integer","description":"The ID of the asset.","example":123},"name":{"type":"string","description":"The name of the asset.","example":"My Asset"},"build_id":{"type":"integer","description":"The ID of the build that the asset belongs to.","example":345},"type":{"type":"string","description":"The type of the asset.","enum":["docker-image","lambda","bundle"],"example":"docker-image"},"platform":{"type":"string","description":"The platform of the asset.","enum":["x86_64","arm_64"],"example":"arm_64"},"url":{"type":"string","format":"uri","description":"The url of the asset.\n\n> •For docker-image assets, this should be the local tagged image or image name.\n> \n> •For lambda assets, this should be the file path of the lambda package.\n","example":"https://example.com/my-asset.jpg"},"nrn":{"type":"string","description":"The resource name (NRN) uniquely identifying the asset.","example":"organization=1:account=2:namespace=4:application=4:build=345:asset=123"},"branch":{"type":"string","description":"The branch that the asset was built from.","example":"main"},"commit":{"type":"object","properties":{"id":{"type":"integer","description":"The ID of the commit that the asset was built from.","example":234},"permalink":{"type":"string","description":"The permalink to the commit that the asset was built from.","example":"https://example.com/1234"}}}},"title":"assetResponse"}}}},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific client error (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"bad_request"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Bad Request\", \"Unauthorized\").","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error (e.g., 500, 502, 503).","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Internal Server Error\", \"Service Unavailable\").","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred. Please try again later."}}}}}}}}
>
  
</StatusCodes>


      