Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 207 additions & 5 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39804,7 +39804,9 @@ components:
nullable: true
type: string
has_submitted:
description: Whether the current user has already submitted this form. Only present for forms with `single_response` set to `true`.
description: |-
Whether the current user has already submitted this form. Only present for forms with
`single_response` set to `true`.
nullable: true
type: boolean
idp_survey:
Expand Down Expand Up @@ -40119,6 +40121,10 @@ components:
example: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d
nullable: true
type: string
has_ever_been_published:
description: Whether this version number has ever appeared in the form's publication history.
example: true
type: boolean
id:
description: The ID of the form version.
example: "126"
Expand Down Expand Up @@ -40175,6 +40181,15 @@ components:
- type
- attributes
type: object
FormVersionListType:
default: form_version_lists
description: The resource type for a list of form versions.
enum:
- form_version_lists
example: form_version_lists
type: string
x-enum-varnames:
- FORM_VERSION_LISTS
FormVersionResponse:
description: A response containing a single form version.
properties:
Expand Down Expand Up @@ -58917,6 +58932,41 @@ components:
- data
- meta
type: object
ListFormVersionsData:
description: A list-of-form-versions resource object.
properties:
attributes:
$ref: "#/components/schemas/ListFormVersionsDataAttributes"
id:
description: The ID of the form.
example: 22f6006a-2302-4926-9396-d2dfcf7b0b34
type: string
type:
$ref: "#/components/schemas/FormVersionListType"
required:
- id
- type
- attributes
type: object
ListFormVersionsDataAttributes:
description: The attributes for a list of form versions.
properties:
versions:
description: The list of versions for the form.
items:
$ref: "#/components/schemas/FormVersionAttributes"
type: array
required:
- versions
type: object
ListFormVersionsResponse:
description: A response containing the list of versions for a form.
properties:
data:
$ref: "#/components/schemas/ListFormVersionsData"
required:
- data
type: object
ListHistoricalJobsResponse:
description: List of historical jobs.
properties:
Expand Down Expand Up @@ -139326,7 +139376,9 @@ paths:
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: 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.
description: |-
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.
operationId: CreateForm
requestBody:
content:
Expand Down Expand Up @@ -139400,7 +139452,9 @@ paths:
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/forms/create_and_publish:
post:
description: Creates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form.
description: |-
Creates a new form and immediately publishes its initial version. This also creates a new datastore for
form responses and links it to the form.
operationId: CreateAndPublishForm
requestBody:
content:
Expand Down Expand Up @@ -139530,7 +139584,9 @@ paths:
schema:
format: uuid
type: string
- description: The version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the last published version, or a specific version number.
- description: |-
The version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the
last published version, or a specific version number.
in: query
name: version
required: false
Expand Down Expand Up @@ -139837,6 +139893,72 @@ paths:
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/forms/{form_id}/versions:
get:
description: List all versions of a form.
operationId: ListFormVersions
parameters:
- description: The ID of the form.
example: 22f6006a-2302-4926-9396-d2dfcf7b0b34
in: path
name: form_id
required: true
schema:
format: uuid
type: string
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
versions:
- created_at: "2026-05-29T20:06:14.895921Z"
data_definition: {}
definition_signature: >-
{"signature":"b7f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545", "version":1}
etag: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d
has_ever_been_published: true
id: "126"
modified_at: "2026-05-29T20:06:14.949163Z"
state: draft
ui_definition: {}
user_id: 10001
user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978
version: 2
id: 22f6006a-2302-4926-9396-d2dfcf7b0b34
type: form_version_lists
schema:
$ref: "#/components/schemas/ListFormVersionsResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: List form versions
tags:
- Forms
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
post:
description: |-
Create or update the latest draft version of a form. The `upsert_params` field controls
Expand Down Expand Up @@ -139880,7 +140002,8 @@ paths:
created_at: "2026-05-29T20:06:14.895921Z"
data_definition:
$ref: "#/components/schemas/FormDataDefinition"
definition_signature: '{"signature":"b7f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545","version":1}'
definition_signature: >-
{"signature":"b7f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545", "version":1}
etag: b51f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d
modified_at: "2026-05-29T20:06:14.949163Z"
state: draft
Expand Down Expand Up @@ -139919,6 +140042,85 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/forms/{form_id}/versions/revert:
post:
description: Revert a form to a prior version by creating a new draft version copied from it.
operationId: RevertFormVersion
parameters:
- description: The ID of the form.
example: 22f6006a-2302-4926-9396-d2dfcf7b0b34
in: path
name: form_id
required: true
schema:
format: uuid
type: string
- description: The version number to revert to.
example: 1
in: query
name: version
required: true
schema:
format: int64
type: integer
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
created_at: "2026-05-29T20:10:14.895921Z"
data_definition:
$ref: "#/components/schemas/FormDataDefinition"
definition_signature: >-
{"signature":"c8f312957a80cea2c8c9950532b205a90a3f8a7ebb7e52fc25437a25d903d545", "version":1}
etag: c61f08b698d88d8027a935d9db649774949f5fb41a0c559bfee6a9a13225c72d
modified_at: "2026-05-29T20:10:14.949163Z"
state: draft
ui_definition: {}
user_id: 10001
user_uuid: 1fc709aa-be19-4539-a47d-52a30d78a978
version: 3
id: "127"
type: form_versions
schema:
$ref: "#/components/schemas/FormVersionResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"401":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unauthorized
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"409":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Conflict
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Revert a form to a prior version
tags:
- Forms
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/forms/{form_id}/versions/upsert_and_publish:
post:
description: Upsert the latest form version and publish it in a single atomic transaction.
Expand Down
27 changes: 27 additions & 0 deletions examples/v2/forms/ListFormVersions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// List form versions returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FormsApi;
import com.datadog.api.client.v2.model.ListFormVersionsResponse;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.listFormVersions", true);
FormsApi apiInstance = new FormsApi(defaultClient);

try {
ListFormVersionsResponse result =
apiInstance.listFormVersions(UUID.fromString("22f6006a-2302-4926-9396-d2dfcf7b0b34"));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FormsApi#listFormVersions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
28 changes: 28 additions & 0 deletions examples/v2/forms/RevertFormVersion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Revert a form to a prior version returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FormsApi;
import com.datadog.api.client.v2.model.FormVersionResponse;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.revertFormVersion", true);
FormsApi apiInstance = new FormsApi(defaultClient);

try {
FormVersionResponse result =
apiInstance.revertFormVersion(
UUID.fromString("22f6006a-2302-4926-9396-d2dfcf7b0b34"), 1L);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling FormsApi#revertFormVersion");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,9 @@ public class ApiClient {
put("v2.deleteForm", false);
put("v2.getForm", false);
put("v2.listForms", false);
put("v2.listFormVersions", false);
put("v2.publishForm", false);
put("v2.revertFormVersion", false);
put("v2.updateForm", false);
put("v2.upsertAndPublishFormVersion", false);
put("v2.upsertFormVersion", false);
Expand Down
Loading
Loading