---
title: Assign a form to a profile
slug: andrei/assign-a-form-to-a-profile
createdAt: 2026-10-05T10:36:01.732Z
---

{
  "id": "qrzCzlQHBkqx57RIajFwb",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://api.detected.app/api/v2/public/profiles/{uuid}/forms",
    "servers": [
      {
        "url": "https://api.detected.app/api/v2/public/profiles/{uuid}/forms",
        "description": "Production"
      }
    ],
    "name": "Assign a form to a profile",
    "description": "<p>Assigns a form to a profile. Send a single form ID in the request body. The latest version of the form is assigned. If that version is already assigned to the profile, it is skipped, so there are no duplicates.</p>\n<p>The response lists all the forms currently assigned to the profile, including the one you just assigned.</p>\n<h3>Restrictions</h3>\n<ul>\n<li>Only forms of type <code>internal_forms</code> can be assigned.</li>\n<li>The form must belong to the same list as the profile.</li>\n<li>If the form does not exist or is not an allowed type, a validation error is returned.</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "uuid",
          "type": "string",
          "description": "<p>UUID of the item named in the path, for example the profile in <code>/profiles/{uuid}</code> or the representative in <code>/representatives/{uuid}</code>.</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "AssignFormToProfileRequest",
          "schema": [
            {
              "name": "id",
              "kind": "required",
              "type": "number",
              "description": "ID of the form to assign."
            }
          ],
          "modelRef": "#/components/schemas/AssignFormToProfileRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "AccessToken",
          "name": "AccessToken",
          "kind": "optional",
          "type": "http",
          "description": "<p>The API uses OAuth 2.0. Request an access token from <code>POST /oauth/token</code> with the client ID and client secret of your integration client, and your account slug. Send the access token in the <code>Authorization</code> header of every request, in the format <code>Authorization: Bearer &#x3C;access_token></code>. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.</p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "X-RateLimit-Limit",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "X-RateLimit-Remaining",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "x-ratelimit-reset",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "retry-after",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "array",
                "description": "List of forms assigned to profile",
                "modelRef": "#/components/schemas/ShortFormResource",
                "customType": "ShortFormResource[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "number",
                    "description": "Form ID."
                  },
                  {
                    "name": "label",
                    "kind": "required",
                    "type": "string",
                    "description": "Label of the form."
                  },
                  {
                    "name": "reference",
                    "kind": "optional",
                    "type": "string",
                    "description": "Reference of the form."
                  },
                  {
                    "name": "version",
                    "kind": "required",
                    "type": "number",
                    "description": "Latest version of the form."
                  },
                  {
                    "name": "provider",
                    "kind": "required",
                    "type": "string<vueform>",
                    "description": "Form provider.",
                    "enum": [
                      "vueform"
                    ]
                  },
                  {
                    "name": "archived",
                    "kind": "required",
                    "type": "boolean",
                    "description": "Whether the form is archived.",
                    "enum": [
                      "false",
                      "true"
                    ]
                  },
                  {
                    "name": "updated_at",
                    "kind": "required",
                    "type": "string",
                    "description": "Date and time the form was last updated."
                  },
                  {
                    "name": "created_at",
                    "kind": "required",
                    "type": "string",
                    "description": "Date and time the form was created."
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized. The access token is missing, invalid or has expired.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              },
              {
                "name": "example_field",
                "kind": "optional",
                "type": "array",
                "description": "<p>Validation errors for one field of the request body. The property name is the name of the field that failed validation (<code>example_field</code> is a placeholder).</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "429",
        "description": "<p>Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the <code>Retry-After</code> header before trying again.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://api.detected.app/api/v2/public/profiles/{uuid}/forms \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"id\": \"\"\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({\n   \"id\": \"\"\n});\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.detected.app/api/v2/public/profiles/{uuid}/forms\", 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(\"https://api.detected.app/api/v2/public/profiles/{uuid}/forms\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"id\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.detected.app/api/v2/public/profiles/{uuid}/forms\"\n\npayload = json.dumps({\n   \"id\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"data\": [\n    {\n      \"id\": 0,\n      \"label\": \"\",\n      \"reference\": \"\",\n      \"version\": 0,\n      \"provider\": \"\",\n      \"archived\": false,\n      \"updated_at\": \"\",\n      \"created_at\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Unauthorized. The access token is missing, invalid or has expired.\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "response-2-422",
          "language": "422",
          "code": "// Unprocessable Content. The request was understood but failed validation. The response lists the fields that failed and why.\n{\n  \"message\": \"\",\n  \"example_field\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "response-3-429",
          "language": "429",
          "code": "// Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the Retry-After header before trying again.\n{\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}