---
title: Create an Asset (File)
slug: test/create-an-asset-file
createdAt: 2024-08-02T11:34:50.115Z
---

{
  "id": "b4C6eWLGFpoP7D02nKCmU",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset",
    "name": "",
    "description": "",
    "contentType": "application/json",
    "request": {
      "headerParameters": [],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "BaseURL",
          "description": "",
          "default": "BaseURL",
          "value": "BaseURL",
          "type": "string"
        },
        {
          "name": "containerAID",
          "description": "",
          "default": "containerAID",
          "value": "containerAID",
          "type": "string"
        },
        {
          "name": "containerVersion",
          "description": "",
          "default": "containerVersion",
          "value": "containerVersion",
          "type": "string"
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "description": "",
          "default": "{\r\n   \"assetType\":\"FILE\",\r\n   \"label\":\"File Label\",\r\n   \"name\":\"File Name\",\r\n   \"identifier\":\"FIL_2\",\r\n   \"description\":[\r\n      {\r\n         \"locale\":\"\",\r\n         \"text\":\"File description\"\r\n      },\r\n      {\r\n         \"locale\":\"fr-FR\",\r\n         \"text\":\"File French description\"\r\n      }\r\n   ],\r\n   \"clinicalStage\":[\r\n      \"Study setup\", \r\n      \"Study conduct\"\r\n   ],\r\n   \"therapeuticArea\":[\r\n      \"Devices\",\r\n      \"Hematology\"\r\n   ],\r\n   \"aliases\":[\r\n      {\r\n         \"context\":\"RAVE\",\r\n         \"name\":\"File Rave Alias\",\r\n         \"orderNumber\": 0\r\n      },\r\n      {\r\n         \"context\":\"SDTM\",\r\n         \"name\":\"File SDTM Alias\",\r\n         \"orderNumber\": 1\r\n      }\r\n   ],\r\n   \"fileReferences\": [\r\n    {\r\n      \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n      \"path\": \"odm.fdx\"\r\n    }\r\n  ],\r\n  \"entryPoint\": {\r\n    \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n    \"path\": \"odm.fdx\"\r\n  },\r\n  \"source\": \"Source is this\"\r\n}",
          "value": "{\r\n   \"assetType\":\"FILE\",\r\n   \"label\":\"File Label\",\r\n   \"name\":\"File Name\",\r\n   \"identifier\":\"FIL_2\",\r\n   \"description\":[\r\n      {\r\n         \"locale\":\"\",\r\n         \"text\":\"File description\"\r\n      },\r\n      {\r\n         \"locale\":\"fr-FR\",\r\n         \"text\":\"File French description\"\r\n      }\r\n   ],\r\n   \"clinicalStage\":[\r\n      \"Study setup\", \r\n      \"Study conduct\"\r\n   ],\r\n   \"therapeuticArea\":[\r\n      \"Devices\",\r\n      \"Hematology\"\r\n   ],\r\n   \"aliases\":[\r\n      {\r\n         \"context\":\"RAVE\",\r\n         \"name\":\"File Rave Alias\",\r\n         \"orderNumber\": 0\r\n      },\r\n      {\r\n         \"context\":\"SDTM\",\r\n         \"name\":\"File SDTM Alias\",\r\n         \"orderNumber\": 1\r\n      }\r\n   ],\r\n   \"fileReferences\": [\r\n    {\r\n      \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n      \"path\": \"odm.fdx\"\r\n    }\r\n  ],\r\n  \"entryPoint\": {\r\n    \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n    \"path\": \"odm.fdx\"\r\n  },\r\n  \"source\": \"Source is this\"\r\n}",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "",
        "jsonExample": ""
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '\"{\\r\\n   \\\"assetType\\\":\\\"FILE\\\",\\r\\n   \\\"label\\\":\\\"File Label\\\",\\r\\n   \\\"name\\\":\\\"File Name\\\",\\r\\n   \\\"identifier\\\":\\\"FIL_2\\\",\\r\\n   \\\"description\\\":[\\r\\n      {\\r\\n         \\\"locale\\\":\\\"\\\",\\r\\n         \\\"text\\\":\\\"File description\\\"\\r\\n      },\\r\\n      {\\r\\n         \\\"locale\\\":\\\"fr-FR\\\",\\r\\n         \\\"text\\\":\\\"File French description\\\"\\r\\n      }\\r\\n   ],\\r\\n   \\\"clinicalStage\\\":[\\r\\n      \\\"Study setup\\\", \\r\\n      \\\"Study conduct\\\"\\r\\n   ],\\r\\n   \\\"therapeuticArea\\\":[\\r\\n      \\\"Devices\\\",\\r\\n      \\\"Hematology\\\"\\r\\n   ],\\r\\n   \\\"aliases\\\":[\\r\\n      {\\r\\n         \\\"context\\\":\\\"RAVE\\\",\\r\\n         \\\"name\\\":\\\"File Rave Alias\\\",\\r\\n         \\\"orderNumber\\\": 0\\r\\n      },\\r\\n      {\\r\\n         \\\"context\\\":\\\"SDTM\\\",\\r\\n         \\\"name\\\":\\\"File SDTM Alias\\\",\\r\\n         \\\"orderNumber\\\": 1\\r\\n      }\\r\\n   ],\\r\\n   \\\"fileReferences\\\": [\\r\\n    {\\r\\n      \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n      \\\"path\\\": \\\"odm.fdx\\\"\\r\\n    }\\r\\n  ],\\r\\n  \\\"entryPoint\\\": {\\r\\n    \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n    \\\"path\\\": \\\"odm.fdx\\\"\\r\\n  },\\r\\n  \\\"source\\\": \\\"Source is this\\\"\\r\\n}\"'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify(\"{\\r\\n   \\\"assetType\\\":\\\"FILE\\\",\\r\\n   \\\"label\\\":\\\"File Label\\\",\\r\\n   \\\"name\\\":\\\"File Name\\\",\\r\\n   \\\"identifier\\\":\\\"FIL_2\\\",\\r\\n   \\\"description\\\":[\\r\\n      {\\r\\n         \\\"locale\\\":\\\"\\\",\\r\\n         \\\"text\\\":\\\"File description\\\"\\r\\n      },\\r\\n      {\\r\\n         \\\"locale\\\":\\\"fr-FR\\\",\\r\\n         \\\"text\\\":\\\"File French description\\\"\\r\\n      }\\r\\n   ],\\r\\n   \\\"clinicalStage\\\":[\\r\\n      \\\"Study setup\\\", \\r\\n      \\\"Study conduct\\\"\\r\\n   ],\\r\\n   \\\"therapeuticArea\\\":[\\r\\n      \\\"Devices\\\",\\r\\n      \\\"Hematology\\\"\\r\\n   ],\\r\\n   \\\"aliases\\\":[\\r\\n      {\\r\\n         \\\"context\\\":\\\"RAVE\\\",\\r\\n         \\\"name\\\":\\\"File Rave Alias\\\",\\r\\n         \\\"orderNumber\\\": 0\\r\\n      },\\r\\n      {\\r\\n         \\\"context\\\":\\\"SDTM\\\",\\r\\n         \\\"name\\\":\\\"File SDTM Alias\\\",\\r\\n         \\\"orderNumber\\\": 1\\r\\n      }\\r\\n   ],\\r\\n   \\\"fileReferences\\\": [\\r\\n    {\\r\\n      \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n      \\\"path\\\": \\\"odm.fdx\\\"\\r\\n    }\\r\\n  ],\\r\\n  \\\"entryPoint\\\": {\\r\\n    \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n    \\\"path\\\": \\\"odm.fdx\\\"\\r\\n  },\\r\\n  \\\"source\\\": \\\"Source is this\\\"\\r\\n}\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump(\"{\\r\\n   \\\"assetType\\\":\\\"FILE\\\",\\r\\n   \\\"label\\\":\\\"File Label\\\",\\r\\n   \\\"name\\\":\\\"File Name\\\",\\r\\n   \\\"identifier\\\":\\\"FIL_2\\\",\\r\\n   \\\"description\\\":[\\r\\n      {\\r\\n         \\\"locale\\\":\\\"\\\",\\r\\n         \\\"text\\\":\\\"File description\\\"\\r\\n      },\\r\\n      {\\r\\n         \\\"locale\\\":\\\"fr-FR\\\",\\r\\n         \\\"text\\\":\\\"File French description\\\"\\r\\n      }\\r\\n   ],\\r\\n   \\\"clinicalStage\\\":[\\r\\n      \\\"Study setup\\\", \\r\\n      \\\"Study conduct\\\"\\r\\n   ],\\r\\n   \\\"therapeuticArea\\\":[\\r\\n      \\\"Devices\\\",\\r\\n      \\\"Hematology\\\"\\r\\n   ],\\r\\n   \\\"aliases\\\":[\\r\\n      {\\r\\n         \\\"context\\\":\\\"RAVE\\\",\\r\\n         \\\"name\\\":\\\"File Rave Alias\\\",\\r\\n         \\\"orderNumber\\\": 0\\r\\n      },\\r\\n      {\\r\\n         \\\"context\\\":\\\"SDTM\\\",\\r\\n         \\\"name\\\":\\\"File SDTM Alias\\\",\\r\\n         \\\"orderNumber\\\": 1\\r\\n      }\\r\\n   ],\\r\\n   \\\"fileReferences\\\": [\\r\\n    {\\r\\n      \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n      \\\"path\\\": \\\"odm.fdx\\\"\\r\\n    }\\r\\n  ],\\r\\n  \\\"entryPoint\\\": {\\r\\n    \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n    \\\"path\\\": \\\"odm.fdx\\\"\\r\\n  },\\r\\n  \\\"source\\\": \\\"Source is this\\\"\\r\\n}\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset\"\n\npayload = json.dumps(\"{\\r\\n   \\\"assetType\\\":\\\"FILE\\\",\\r\\n   \\\"label\\\":\\\"File Label\\\",\\r\\n   \\\"name\\\":\\\"File Name\\\",\\r\\n   \\\"identifier\\\":\\\"FIL_2\\\",\\r\\n   \\\"description\\\":[\\r\\n      {\\r\\n         \\\"locale\\\":\\\"\\\",\\r\\n         \\\"text\\\":\\\"File description\\\"\\r\\n      },\\r\\n      {\\r\\n         \\\"locale\\\":\\\"fr-FR\\\",\\r\\n         \\\"text\\\":\\\"File French description\\\"\\r\\n      }\\r\\n   ],\\r\\n   \\\"clinicalStage\\\":[\\r\\n      \\\"Study setup\\\", \\r\\n      \\\"Study conduct\\\"\\r\\n   ],\\r\\n   \\\"therapeuticArea\\\":[\\r\\n      \\\"Devices\\\",\\r\\n      \\\"Hematology\\\"\\r\\n   ],\\r\\n   \\\"aliases\\\":[\\r\\n      {\\r\\n         \\\"context\\\":\\\"RAVE\\\",\\r\\n         \\\"name\\\":\\\"File Rave Alias\\\",\\r\\n         \\\"orderNumber\\\": 0\\r\\n      },\\r\\n      {\\r\\n         \\\"context\\\":\\\"SDTM\\\",\\r\\n         \\\"name\\\":\\\"File SDTM Alias\\\",\\r\\n         \\\"orderNumber\\\": 1\\r\\n      }\\r\\n   ],\\r\\n   \\\"fileReferences\\\": [\\r\\n    {\\r\\n      \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n      \\\"path\\\": \\\"odm.fdx\\\"\\r\\n    }\\r\\n  ],\\r\\n  \\\"entryPoint\\\": {\\r\\n    \\\"uuid\\\": \\\"5f395559-e3f8-42cc-bc7b-946c1b0119e7\\\",\\r\\n    \\\"path\\\": \\\"odm.fdx\\\"\\r\\n  },\\r\\n  \\\"source\\\": \\\"Source is this\\\"\\r\\n}\")\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": ""
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}