For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/es/api/latest/forms/create-a-form.md. A documentation index is available at /llms.txt.
Language
Datadog site

Create a form

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

Descripción general

Create a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form.

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
object

The data for creating a form.

Respuesta

OK

A response containing a single form.

Campo
Type
Descripción
data [required]
object

A form resource object.

Ejemplo de código

# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF
# 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" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "anonymous": false,
      "data_definition": {},
      "description": "A form to collect user feedback.",
      "idp_survey": false,
      "name": "User Feedback Form",
      "single_response": false,
      "ui_definition": {}
    },
    "type": "forms"
  }
}
EOF