Passer au contenu principal
PATCH
https://{tenantDomain}/api/v2
/
forms
/
{id}
Go
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.UpdateFormRequestContent{}
    client.Forms.Update(
        context.TODO(),
        "id",
        request,
    )
}
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.forms.update("id", {});
}
main();
import { ManagementClient } from "auth0";

async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.forms.update("id", {});
}
main();
curl --request PATCH \
--url https://{tenantDomain}/api/v2/forms/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"messages": {
"errors": {},
"custom": {}
},
"languages": {
"primary": "<string>",
"default": "<string>"
},
"translations": {},
"nodes": [
{
"id": "<string>",
"type": "FLOW",
"config": {
"flow_id": "<string>",
"next_node": "<string>"
},
"alias": "<string>"
}
],
"start": {
"hidden_fields": [
{
"key": "<string>",
"value": "<string>"
}
],
"next_node": "<string>"
},
"ending": {
"after_submit": {
"flow_id": "<string>"
},
"resume_flow": true
},
"style": {
"css": "<string>"
}
}
'
import requests

url = "https://{tenantDomain}/api/v2/forms/{id}"

payload = {
"name": "<string>",
"messages": {
"errors": {},
"custom": {}
},
"languages": {
"primary": "<string>",
"default": "<string>"
},
"translations": {},
"nodes": [
{
"id": "<string>",
"type": "FLOW",
"config": {
"flow_id": "<string>",
"next_node": "<string>"
},
"alias": "<string>"
}
],
"start": {
"hidden_fields": [
{
"key": "<string>",
"value": "<string>"
}
],
"next_node": "<string>"
},
"ending": {
"after_submit": { "flow_id": "<string>" },
"resume_flow": True
},
"style": { "css": "<string>" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/forms/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'messages' => [
'errors' => [

],
'custom' => [

]
],
'languages' => [
'primary' => '<string>',
'default' => '<string>'
],
'translations' => [

],
'nodes' => [
[
'id' => '<string>',
'type' => 'FLOW',
'config' => [
'flow_id' => '<string>',
'next_node' => '<string>'
],
'alias' => '<string>'
]
],
'start' => [
'hidden_fields' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'next_node' => '<string>'
],
'ending' => [
'after_submit' => [
'flow_id' => '<string>'
],
'resume_flow' => true
],
'style' => [
'css' => '<string>'
]
]),
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;
}
HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/forms/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"messages\": {\n \"errors\": {},\n \"custom\": {}\n },\n \"languages\": {\n \"primary\": \"<string>\",\n \"default\": \"<string>\"\n },\n \"translations\": {},\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"type\": \"FLOW\",\n \"config\": {\n \"flow_id\": \"<string>\",\n \"next_node\": \"<string>\"\n },\n \"alias\": \"<string>\"\n }\n ],\n \"start\": {\n \"hidden_fields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"next_node\": \"<string>\"\n },\n \"ending\": {\n \"after_submit\": {\n \"flow_id\": \"<string>\"\n },\n \"resume_flow\": true\n },\n \"style\": {\n \"css\": \"<string>\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/forms/{id}")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"messages\": {\n \"errors\": {},\n \"custom\": {}\n },\n \"languages\": {\n \"primary\": \"<string>\",\n \"default\": \"<string>\"\n },\n \"translations\": {},\n \"nodes\": [\n {\n \"id\": \"<string>\",\n \"type\": \"FLOW\",\n \"config\": {\n \"flow_id\": \"<string>\",\n \"next_node\": \"<string>\"\n },\n \"alias\": \"<string>\"\n }\n ],\n \"start\": {\n \"hidden_fields\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"next_node\": \"<string>\"\n },\n \"ending\": {\n \"after_submit\": {\n \"flow_id\": \"<string>\"\n },\n \"resume_flow\": true\n },\n \"style\": {\n \"css\": \"<string>\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "messages": {
    "errors": {},
    "custom": {}
  },
  "languages": {
    "primary": "<string>",
    "default": "<string>"
  },
  "translations": {},
  "nodes": [
    {
      "id": "<string>",
      "type": "FLOW",
      "config": {
        "flow_id": "<string>",
        "next_node": "<string>"
      },
      "coordinates": {
        "x": 0,
        "y": 0
      },
      "alias": "<string>"
    }
  ],
  "start": {
    "hidden_fields": [
      {
        "key": "<string>",
        "value": "<string>"
      }
    ],
    "next_node": "<string>",
    "coordinates": {
      "x": 0,
      "y": 0
    }
  },
  "ending": {
    "redirection": {
      "target": "<string>",
      "delay": 5
    },
    "after_submit": {
      "flow_id": "<string>"
    },
    "coordinates": {
      "x": 0,
      "y": 0
    },
    "resume_flow": true
  },
  "style": {
    "css": "<string>"
  },
  "embedded_at": "2023-12-25",
  "submitted_at": "2023-12-25"
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Paramètres de chemin

id
string
requis

The ID of the form to update.

Maximum string length: 30

Corps

name
string
Required string length: 1 - 150
messages
object | null
languages
object | null
translations
object | null
nodes
object[] | null
start
object | null
ending
object | null
style
object | null

Réponse

Form successfully updated.

id
string<form-id>
requis
Maximum string length: 30
name
string
requis
Required string length: 1 - 150
created_at
string<date-time>
requis
updated_at
string<date-time>
requis
messages
object
languages
object
translations
object
nodes
object[]
start
object
ending
object
style
object
embedded_at
string<date>
submitted_at
string<date>