Saltar al contenido principal
PUT
/
marketing
/
v3
/
forms
/
{formId}
Actualizar una definición de formulario
curl --request PUT \
  --url https://api.hubapi.com/marketing/v3/forms/{formId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "archived": true,
  "configuration": {
    "allowLinkToResetKnownValues": true,
    "archivable": true,
    "cloneable": true,
    "createNewContactForNewEmail": true,
    "editable": true,
    "lifecycleStages": [
      {
        "objectTypeId": "<string>",
        "value": "<string>"
      }
    ],
    "notifyContactOwner": true,
    "notifyRecipients": [
      "<string>"
    ],
    "postSubmitAction": {
      "value": "<string>"
    },
    "prePopulateKnownValues": true,
    "recaptchaEnabled": true
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "displayOptions": {
    "renderRawHtml": true,
    "style": {
      "backgroundWidth": "<string>",
      "fontFamily": "<string>",
      "helpTextColor": "<string>",
      "helpTextSize": "<string>",
      "labelTextColor": "<string>",
      "labelTextSize": "<string>",
      "legalConsentTextColor": "<string>",
      "legalConsentTextSize": "<string>",
      "submitColor": "<string>",
      "submitFontColor": "<string>",
      "submitSize": "<string>"
    },
    "submitButtonText": "<string>",
    "cssClass": "<string>"
  },
  "fieldGroups": [
    {
      "fields": [
        {
          "dependentFields": [
            {
              "dependentCondition": {
                "rangeEnd": "<string>",
                "rangeStart": "<string>",
                "value": "<string>",
                "values": [
                  "<string>"
                ]
              },
              "dependentField": "<unknown>"
            }
          ],
          "fieldType": "email",
          "hidden": true,
          "label": "<string>",
          "name": "<string>",
          "objectTypeId": "<string>",
          "required": true,
          "validation": {
            "blockedEmailDomains": [
              "<string>"
            ],
            "useDefaultBlockList": true
          },
          "defaultValue": "<string>",
          "description": "<string>",
          "placeholder": "<string>"
        }
      ],
      "richText": "<string>"
    }
  ],
  "formType": "hubspot",
  "id": "<string>",
  "legalConsentOptions": {
    "type": "none"
  },
  "name": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z"
}
'
import requests

url = "https://api.hubapi.com/marketing/v3/forms/{formId}"

payload = {
"archived": True,
"configuration": {
"allowLinkToResetKnownValues": True,
"archivable": True,
"cloneable": True,
"createNewContactForNewEmail": True,
"editable": True,
"lifecycleStages": [
{
"objectTypeId": "<string>",
"value": "<string>"
}
],
"notifyContactOwner": True,
"notifyRecipients": ["<string>"],
"postSubmitAction": { "value": "<string>" },
"prePopulateKnownValues": True,
"recaptchaEnabled": True
},
"createdAt": "2023-11-07T05:31:56Z",
"displayOptions": {
"renderRawHtml": True,
"style": {
"backgroundWidth": "<string>",
"fontFamily": "<string>",
"helpTextColor": "<string>",
"helpTextSize": "<string>",
"labelTextColor": "<string>",
"labelTextSize": "<string>",
"legalConsentTextColor": "<string>",
"legalConsentTextSize": "<string>",
"submitColor": "<string>",
"submitFontColor": "<string>",
"submitSize": "<string>"
},
"submitButtonText": "<string>",
"cssClass": "<string>"
},
"fieldGroups": [
{
"fields": [
{
"dependentFields": [
{
"dependentCondition": {
"rangeEnd": "<string>",
"rangeStart": "<string>",
"value": "<string>",
"values": ["<string>"]
},
"dependentField": "<unknown>"
}
],
"fieldType": "email",
"hidden": True,
"label": "<string>",
"name": "<string>",
"objectTypeId": "<string>",
"required": True,
"validation": {
"blockedEmailDomains": ["<string>"],
"useDefaultBlockList": True
},
"defaultValue": "<string>",
"description": "<string>",
"placeholder": "<string>"
}
],
"richText": "<string>"
}
],
"formType": "hubspot",
"id": "<string>",
"legalConsentOptions": { "type": "none" },
"name": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
archived: true,
configuration: {
allowLinkToResetKnownValues: true,
archivable: true,
cloneable: true,
createNewContactForNewEmail: true,
editable: true,
lifecycleStages: [{objectTypeId: '<string>', value: '<string>'}],
notifyContactOwner: true,
notifyRecipients: ['<string>'],
postSubmitAction: {value: '<string>'},
prePopulateKnownValues: true,
recaptchaEnabled: true
},
createdAt: '2023-11-07T05:31:56Z',
displayOptions: {
renderRawHtml: true,
style: {
backgroundWidth: '<string>',
fontFamily: '<string>',
helpTextColor: '<string>',
helpTextSize: '<string>',
labelTextColor: '<string>',
labelTextSize: '<string>',
legalConsentTextColor: '<string>',
legalConsentTextSize: '<string>',
submitColor: '<string>',
submitFontColor: '<string>',
submitSize: '<string>'
},
submitButtonText: '<string>',
cssClass: '<string>'
},
fieldGroups: [
{
fields: [
{
dependentFields: [
{
dependentCondition: {
rangeEnd: '<string>',
rangeStart: '<string>',
value: '<string>',
values: ['<string>']
},
dependentField: '<unknown>'
}
],
fieldType: 'email',
hidden: true,
label: '<string>',
name: '<string>',
objectTypeId: '<string>',
required: true,
validation: {blockedEmailDomains: ['<string>'], useDefaultBlockList: true},
defaultValue: '<string>',
description: '<string>',
placeholder: '<string>'
}
],
richText: '<string>'
}
],
formType: 'hubspot',
id: '<string>',
legalConsentOptions: {type: 'none'},
name: '<string>',
updatedAt: '2023-11-07T05:31:56Z',
archivedAt: '2023-11-07T05:31:56Z'
})
};

fetch('https://api.hubapi.com/marketing/v3/forms/{formId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/marketing/v3/forms/{formId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'archived' => true,
'configuration' => [
'allowLinkToResetKnownValues' => true,
'archivable' => true,
'cloneable' => true,
'createNewContactForNewEmail' => true,
'editable' => true,
'lifecycleStages' => [
[
'objectTypeId' => '<string>',
'value' => '<string>'
]
],
'notifyContactOwner' => true,
'notifyRecipients' => [
'<string>'
],
'postSubmitAction' => [
'value' => '<string>'
],
'prePopulateKnownValues' => true,
'recaptchaEnabled' => true
],
'createdAt' => '2023-11-07T05:31:56Z',
'displayOptions' => [
'renderRawHtml' => true,
'style' => [
'backgroundWidth' => '<string>',
'fontFamily' => '<string>',
'helpTextColor' => '<string>',
'helpTextSize' => '<string>',
'labelTextColor' => '<string>',
'labelTextSize' => '<string>',
'legalConsentTextColor' => '<string>',
'legalConsentTextSize' => '<string>',
'submitColor' => '<string>',
'submitFontColor' => '<string>',
'submitSize' => '<string>'
],
'submitButtonText' => '<string>',
'cssClass' => '<string>'
],
'fieldGroups' => [
[
'fields' => [
[
'dependentFields' => [
[
'dependentCondition' => [
'rangeEnd' => '<string>',
'rangeStart' => '<string>',
'value' => '<string>',
'values' => [
'<string>'
]
],
'dependentField' => '<unknown>'
]
],
'fieldType' => 'email',
'hidden' => true,
'label' => '<string>',
'name' => '<string>',
'objectTypeId' => '<string>',
'required' => true,
'validation' => [
'blockedEmailDomains' => [
'<string>'
],
'useDefaultBlockList' => true
],
'defaultValue' => '<string>',
'description' => '<string>',
'placeholder' => '<string>'
]
],
'richText' => '<string>'
]
],
'formType' => 'hubspot',
'id' => '<string>',
'legalConsentOptions' => [
'type' => 'none'
],
'name' => '<string>',
'updatedAt' => '2023-11-07T05:31:56Z',
'archivedAt' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.hubapi.com/marketing/v3/forms/{formId}"

payload := strings.NewReader("{\n \"archived\": true,\n \"configuration\": {\n \"allowLinkToResetKnownValues\": true,\n \"archivable\": true,\n \"cloneable\": true,\n \"createNewContactForNewEmail\": true,\n \"editable\": true,\n \"lifecycleStages\": [\n {\n \"objectTypeId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"notifyContactOwner\": true,\n \"notifyRecipients\": [\n \"<string>\"\n ],\n \"postSubmitAction\": {\n \"value\": \"<string>\"\n },\n \"prePopulateKnownValues\": true,\n \"recaptchaEnabled\": true\n },\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"displayOptions\": {\n \"renderRawHtml\": true,\n \"style\": {\n \"backgroundWidth\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"helpTextColor\": \"<string>\",\n \"helpTextSize\": \"<string>\",\n \"labelTextColor\": \"<string>\",\n \"labelTextSize\": \"<string>\",\n \"legalConsentTextColor\": \"<string>\",\n \"legalConsentTextSize\": \"<string>\",\n \"submitColor\": \"<string>\",\n \"submitFontColor\": \"<string>\",\n \"submitSize\": \"<string>\"\n },\n \"submitButtonText\": \"<string>\",\n \"cssClass\": \"<string>\"\n },\n \"fieldGroups\": [\n {\n \"fields\": [\n {\n \"dependentFields\": [\n {\n \"dependentCondition\": {\n \"rangeEnd\": \"<string>\",\n \"rangeStart\": \"<string>\",\n \"value\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n },\n \"dependentField\": \"<unknown>\"\n }\n ],\n \"fieldType\": \"email\",\n \"hidden\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"required\": true,\n \"validation\": {\n \"blockedEmailDomains\": [\n \"<string>\"\n ],\n \"useDefaultBlockList\": true\n },\n \"defaultValue\": \"<string>\",\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"richText\": \"<string>\"\n }\n ],\n \"formType\": \"hubspot\",\n \"id\": \"<string>\",\n \"legalConsentOptions\": {\n \"type\": \"none\"\n },\n \"name\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"archivedAt\": \"2023-11-07T05:31:56Z\"\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.hubapi.com/marketing/v3/forms/{formId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"archived\": true,\n \"configuration\": {\n \"allowLinkToResetKnownValues\": true,\n \"archivable\": true,\n \"cloneable\": true,\n \"createNewContactForNewEmail\": true,\n \"editable\": true,\n \"lifecycleStages\": [\n {\n \"objectTypeId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"notifyContactOwner\": true,\n \"notifyRecipients\": [\n \"<string>\"\n ],\n \"postSubmitAction\": {\n \"value\": \"<string>\"\n },\n \"prePopulateKnownValues\": true,\n \"recaptchaEnabled\": true\n },\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"displayOptions\": {\n \"renderRawHtml\": true,\n \"style\": {\n \"backgroundWidth\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"helpTextColor\": \"<string>\",\n \"helpTextSize\": \"<string>\",\n \"labelTextColor\": \"<string>\",\n \"labelTextSize\": \"<string>\",\n \"legalConsentTextColor\": \"<string>\",\n \"legalConsentTextSize\": \"<string>\",\n \"submitColor\": \"<string>\",\n \"submitFontColor\": \"<string>\",\n \"submitSize\": \"<string>\"\n },\n \"submitButtonText\": \"<string>\",\n \"cssClass\": \"<string>\"\n },\n \"fieldGroups\": [\n {\n \"fields\": [\n {\n \"dependentFields\": [\n {\n \"dependentCondition\": {\n \"rangeEnd\": \"<string>\",\n \"rangeStart\": \"<string>\",\n \"value\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n },\n \"dependentField\": \"<unknown>\"\n }\n ],\n \"fieldType\": \"email\",\n \"hidden\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"required\": true,\n \"validation\": {\n \"blockedEmailDomains\": [\n \"<string>\"\n ],\n \"useDefaultBlockList\": true\n },\n \"defaultValue\": \"<string>\",\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"richText\": \"<string>\"\n }\n ],\n \"formType\": \"hubspot\",\n \"id\": \"<string>\",\n \"legalConsentOptions\": {\n \"type\": \"none\"\n },\n \"name\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"archivedAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hubapi.com/marketing/v3/forms/{formId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"archived\": true,\n \"configuration\": {\n \"allowLinkToResetKnownValues\": true,\n \"archivable\": true,\n \"cloneable\": true,\n \"createNewContactForNewEmail\": true,\n \"editable\": true,\n \"lifecycleStages\": [\n {\n \"objectTypeId\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"notifyContactOwner\": true,\n \"notifyRecipients\": [\n \"<string>\"\n ],\n \"postSubmitAction\": {\n \"value\": \"<string>\"\n },\n \"prePopulateKnownValues\": true,\n \"recaptchaEnabled\": true\n },\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"displayOptions\": {\n \"renderRawHtml\": true,\n \"style\": {\n \"backgroundWidth\": \"<string>\",\n \"fontFamily\": \"<string>\",\n \"helpTextColor\": \"<string>\",\n \"helpTextSize\": \"<string>\",\n \"labelTextColor\": \"<string>\",\n \"labelTextSize\": \"<string>\",\n \"legalConsentTextColor\": \"<string>\",\n \"legalConsentTextSize\": \"<string>\",\n \"submitColor\": \"<string>\",\n \"submitFontColor\": \"<string>\",\n \"submitSize\": \"<string>\"\n },\n \"submitButtonText\": \"<string>\",\n \"cssClass\": \"<string>\"\n },\n \"fieldGroups\": [\n {\n \"fields\": [\n {\n \"dependentFields\": [\n {\n \"dependentCondition\": {\n \"rangeEnd\": \"<string>\",\n \"rangeStart\": \"<string>\",\n \"value\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n },\n \"dependentField\": \"<unknown>\"\n }\n ],\n \"fieldType\": \"email\",\n \"hidden\": true,\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"required\": true,\n \"validation\": {\n \"blockedEmailDomains\": [\n \"<string>\"\n ],\n \"useDefaultBlockList\": true\n },\n \"defaultValue\": \"<string>\",\n \"description\": \"<string>\",\n \"placeholder\": \"<string>\"\n }\n ],\n \"richText\": \"<string>\"\n }\n ],\n \"formType\": \"hubspot\",\n \"id\": \"<string>\",\n \"legalConsentOptions\": {\n \"type\": \"none\"\n },\n \"name\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"archivedAt\": \"2023-11-07T05:31:56Z\"\n}"

response = http.request(request)
puts response.read_body
{
  "archived": true,
  "configuration": {
    "allowLinkToResetKnownValues": true,
    "archivable": true,
    "cloneable": true,
    "createNewContactForNewEmail": true,
    "editable": true,
    "lifecycleStages": [
      {
        "objectTypeId": "<string>",
        "value": "<string>"
      }
    ],
    "notifyContactOwner": true,
    "notifyRecipients": [
      "<string>"
    ],
    "postSubmitAction": {
      "value": "<string>"
    },
    "prePopulateKnownValues": true,
    "recaptchaEnabled": true
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "displayOptions": {
    "renderRawHtml": true,
    "style": {
      "backgroundWidth": "<string>",
      "fontFamily": "<string>",
      "helpTextColor": "<string>",
      "helpTextSize": "<string>",
      "labelTextColor": "<string>",
      "labelTextSize": "<string>",
      "legalConsentTextColor": "<string>",
      "legalConsentTextSize": "<string>",
      "submitColor": "<string>",
      "submitFontColor": "<string>",
      "submitSize": "<string>"
    },
    "submitButtonText": "<string>",
    "cssClass": "<string>"
  },
  "fieldGroups": [
    {
      "fields": [
        {
          "dependentFields": [
            {
              "dependentCondition": {
                "rangeEnd": "<string>",
                "rangeStart": "<string>",
                "value": "<string>",
                "values": [
                  "<string>"
                ]
              },
              "dependentField": "<unknown>"
            }
          ],
          "fieldType": "email",
          "hidden": true,
          "label": "<string>",
          "name": "<string>",
          "objectTypeId": "<string>",
          "required": true,
          "validation": {
            "blockedEmailDomains": [
              "<string>"
            ],
            "useDefaultBlockList": true
          },
          "defaultValue": "<string>",
          "description": "<string>",
          "placeholder": "<string>"
        }
      ],
      "richText": "<string>"
    }
  ],
  "formType": "hubspot",
  "id": "<string>",
  "legalConsentOptions": {
    "type": "none"
  },
  "name": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z",
  "archivedAt": "2023-11-07T05:31:56Z"
}
{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}

Supported products

Autorizaciones

Authorization
string
header
requerido

The access token received from the authorization server in the OAuth 2.0 flow.

Parámetros de ruta

formId
string
requerido

Cuerpo

application/json
archived
boolean
requerido
configuration
object
requerido
createdAt
string<date-time>
requerido
displayOptions
object
requerido
fieldGroups
object[]
requerido
formType
enum<string>
predeterminado:hubspot
requerido
Opciones disponibles:
hubspot
id
string
requerido
name
string
requerido
updatedAt
string<date-time>
requerido
archivedAt
string<date-time>

Respuesta

successful operation

archived
boolean
requerido
configuration
object
requerido
createdAt
string<date-time>
requerido
displayOptions
object
requerido
fieldGroups
object[]
requerido
formType
enum<string>
predeterminado:hubspot
requerido
Opciones disponibles:
hubspot
id
string
requerido
name
string
requerido
updatedAt
string<date-time>
requerido
archivedAt
string<date-time>
Última modificación el 3 de abril de 2026