---
title: Create a Container
slug: test/create-a-container
createdAt: 2024-08-02T11:34:50.114Z
---

{
  "id": "O7osApav_CYATRqAScoRp",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{BaseURL}}/repository/container",
    "name": "",
    "description": "<h3>POST /repository/container</h3>\n<p>This endpoint is used to create a new container in the repository.</p>\n<h4>Request Body</h4>\n<ul>\n<li><code>containerType</code> (string, required): The type of the container.</li>\n<li><code>versionLabel</code> (string, required): The version label of the container.</li>\n<li><code>label</code> (string, required): The label of the container.</li>\n<li><code>name</code> (string, required): The name of the container.</li>\n<li><code>identifier</code> (string, required): The identifier of the container.</li>\n<li><code>therapeuticArea</code> (array of strings, required): The therapeutic areas associated with the container.</li>\n<li><code>sponsor</code> (string, required): The sponsor of the container.</li>\n<li><code>program</code> (string, required): The program of the container.</li>\n<li><code>protocolID</code> (string, required): The ID of the protocol associated with the container.</li>\n<li><code>protocolName</code> (string, required): The name of the protocol associated with the container.</li>\n<li><code>protocolTitle</code> (string, required): The title of the protocol associated with the container.</li>\n<li><code>owner</code> (string, required): The owner of the container.</li>\n</ul>\n<h4>Response</h4>\n<p>The response is a JSON object with the following schema:</p>\n<pre><code class=\"language-json\">{\n  \"aid\": \"\",\n  \"version\": 0\n}\n\n</code></pre>\n<p>The <code>aid</code> field represents the unique identifier of the newly created container, and the <code>version</code> field represents the version of the container.</p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<table><thead><tr><th>HTTP Status Code</th><th>Error Code</th><th>Description</th></tr></thead><tbody><tr><td>400</td><td>invalid_request</td><td>Authorization header is not in expected Bearer token format.</td></tr></tbody></table>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "BaseURL",
          "description": "",
          "default": "BaseURL",
          "value": "BaseURL",
          "type": "string"
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "description": "",
          "default": "{\r\n  \"containerType\": \"STANDARD\",\r\n  \"versionLabel\": \"1.1\",\r\n  \"label\": \"FWS Standard 1 Label\",\r\n  \"name\": \"FWS Standard 1 Name\",\r\n  \"identifier\": \"STD_100\",\r\n  \"therapeuticArea\": [\"Family Medicine\", \"Genetic Disease\"],\r\n  \"sponsor\": \"Sponsor Two\",\r\n  \"program\": \"Program One\",\r\n  \"protocolID\": \"pID\",\r\n  \"protocolName\": \"pN\",\r\n  \"protocolTitle\": \"pT\",\r\n  \"owner\": \"a25f6bfe-009e-4c7a-add8-28b70188e50c\" \r\n}\r\n",
          "value": "{\r\n  \"containerType\": \"STANDARD\",\r\n  \"versionLabel\": \"1.1\",\r\n  \"label\": \"FWS Standard 1 Label\",\r\n  \"name\": \"FWS Standard 1 Name\",\r\n  \"identifier\": \"STD_100\",\r\n  \"therapeuticArea\": [\"Family Medicine\", \"Genetic Disease\"],\r\n  \"sponsor\": \"Sponsor Two\",\r\n  \"program\": \"Program One\",\r\n  \"protocolID\": \"pID\",\r\n  \"protocolName\": \"pN\",\r\n  \"protocolTitle\": \"pT\",\r\n  \"owner\": \"a25f6bfe-009e-4c7a-add8-28b70188e50c\" \r\n}\r\n",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Create a Container",
        "jsonExample": "{\n    \"aid\": \"8a9a1f61-b032-42fc-a3a4-c0f7306910c3\",\n    \"version\": 1\n}"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{BaseURL}}/repository/container \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '\"{\\r\\n  \\\"containerType\\\": \\\"STANDARD\\\",\\r\\n  \\\"versionLabel\\\": \\\"1.1\\\",\\r\\n  \\\"label\\\": \\\"FWS Standard 1 Label\\\",\\r\\n  \\\"name\\\": \\\"FWS Standard 1 Name\\\",\\r\\n  \\\"identifier\\\": \\\"STD_100\\\",\\r\\n  \\\"therapeuticArea\\\": [\\\"Family Medicine\\\", \\\"Genetic Disease\\\"],\\r\\n  \\\"sponsor\\\": \\\"Sponsor Two\\\",\\r\\n  \\\"program\\\": \\\"Program One\\\",\\r\\n  \\\"protocolID\\\": \\\"pID\\\",\\r\\n  \\\"protocolName\\\": \\\"pN\\\",\\r\\n  \\\"protocolTitle\\\": \\\"pT\\\",\\r\\n  \\\"owner\\\": \\\"a25f6bfe-009e-4c7a-add8-28b70188e50c\\\" \\r\\n}\\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  \\\"containerType\\\": \\\"STANDARD\\\",\\r\\n  \\\"versionLabel\\\": \\\"1.1\\\",\\r\\n  \\\"label\\\": \\\"FWS Standard 1 Label\\\",\\r\\n  \\\"name\\\": \\\"FWS Standard 1 Name\\\",\\r\\n  \\\"identifier\\\": \\\"STD_100\\\",\\r\\n  \\\"therapeuticArea\\\": [\\\"Family Medicine\\\", \\\"Genetic Disease\\\"],\\r\\n  \\\"sponsor\\\": \\\"Sponsor Two\\\",\\r\\n  \\\"program\\\": \\\"Program One\\\",\\r\\n  \\\"protocolID\\\": \\\"pID\\\",\\r\\n  \\\"protocolName\\\": \\\"pN\\\",\\r\\n  \\\"protocolTitle\\\": \\\"pT\\\",\\r\\n  \\\"owner\\\": \\\"a25f6bfe-009e-4c7a-add8-28b70188e50c\\\" \\r\\n}\\r\\n\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{BaseURL}}/repository/container\", 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\")\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  \\\"containerType\\\": \\\"STANDARD\\\",\\r\\n  \\\"versionLabel\\\": \\\"1.1\\\",\\r\\n  \\\"label\\\": \\\"FWS Standard 1 Label\\\",\\r\\n  \\\"name\\\": \\\"FWS Standard 1 Name\\\",\\r\\n  \\\"identifier\\\": \\\"STD_100\\\",\\r\\n  \\\"therapeuticArea\\\": [\\\"Family Medicine\\\", \\\"Genetic Disease\\\"],\\r\\n  \\\"sponsor\\\": \\\"Sponsor Two\\\",\\r\\n  \\\"program\\\": \\\"Program One\\\",\\r\\n  \\\"protocolID\\\": \\\"pID\\\",\\r\\n  \\\"protocolName\\\": \\\"pN\\\",\\r\\n  \\\"protocolTitle\\\": \\\"pT\\\",\\r\\n  \\\"owner\\\": \\\"a25f6bfe-009e-4c7a-add8-28b70188e50c\\\" \\r\\n}\\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\"\n\npayload = json.dumps(\"{\\r\\n  \\\"containerType\\\": \\\"STANDARD\\\",\\r\\n  \\\"versionLabel\\\": \\\"1.1\\\",\\r\\n  \\\"label\\\": \\\"FWS Standard 1 Label\\\",\\r\\n  \\\"name\\\": \\\"FWS Standard 1 Name\\\",\\r\\n  \\\"identifier\\\": \\\"STD_100\\\",\\r\\n  \\\"therapeuticArea\\\": [\\\"Family Medicine\\\", \\\"Genetic Disease\\\"],\\r\\n  \\\"sponsor\\\": \\\"Sponsor Two\\\",\\r\\n  \\\"program\\\": \\\"Program One\\\",\\r\\n  \\\"protocolID\\\": \\\"pID\\\",\\r\\n  \\\"protocolName\\\": \\\"pN\\\",\\r\\n  \\\"protocolTitle\\\": \\\"pT\\\",\\r\\n  \\\"owner\\\": \\\"a25f6bfe-009e-4c7a-add8-28b70188e50c\\\" \\r\\n}\\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": "{\n    \"aid\": \"8a9a1f61-b032-42fc-a3a4-c0f7306910c3\",\n    \"version\": 1\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}