For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/fr/api/latest/forms/create-or-update-a-form-version.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create or update a form version

WARNINGNote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/forms/{form_id}/versionshttps://api.us3.datadoghq.com/api/v2/forms/{form_id}/versionshttps://api.us5.datadoghq.com/api/v2/forms/{form_id}/versionshttps://api.datadoghq.eu/api/v2/forms/{form_id}/versionshttps://api.ap1.datadoghq.com/api/v2/forms/{form_id}/versionshttps://api.ap2.datadoghq.com/api/v2/forms/{form_id}/versionshttps://api.uk1.datadoghq.com/api/v2/forms/{form_id}/versionshttps://api.ddog-gov.com/api/v2/forms/{form_id}/versionshttps://api.us2.ddog-gov.com/api/v2/forms/{form_id}/versions

Présentation

Create or update the latest draft version of a form. The upsert_params field controls optimistic concurrency behavior.

Arguments

Paramètres du chemin

Name
Type
Description
form_id [required]
string

The ID of the form.

Requête

Body Data (required)

Champ
Type
Description
data [required]
object

The data for creating or updating a form version.

Réponse

OK

A response containing a single form version.

Champ
Type
Description
data [required]
object

A form version resource object.

Exemple de code

Create or update a form version returns "OK" response
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF
# Path parameters
export form_id="22f6006a-2302-4926-9396-d2dfcf7b0b34"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/forms/${form_id}/versions" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "data_definition": {
        "description": "Welcome to the Engineering Experience Survey.",
        "required": [],
        "title": "Developer Experience Survey",
        "type": "object"
      },
      "state": "frozen",
      "ui_definition": {
        "ui:order": [],
        "ui:theme": {
          "primaryColor": "gray"
        }
      },
      "upsert_params": {
        "etag": "b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d",
        "insert_only": false,
        "match_policy": "none"
      }
    },
    "type": "form_versions"
  }
}
EOF