Update an action
curl --request PUT \
--url https://api.flowent.chat/api/v1/gateway/actions/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated: Send an email to a specified recipient",
"webhook_url": "https://your-server.com/v2/actions/send_email",
"json_schema": {
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high"
],
"description": "Email priority level"
}
},
"required": [
"recipient",
"subject",
"body"
]
}
}
'import requests
url = "https://api.flowent.chat/api/v1/gateway/actions/{name}"
payload = {
"description": "Updated: Send an email to a specified recipient",
"webhook_url": "https://your-server.com/v2/actions/send_email",
"json_schema": {
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
},
"priority": {
"type": "string",
"enum": ["low", "normal", "high"],
"description": "Email priority level"
}
},
"required": ["recipient", "subject", "body"]
}
}
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({
description: 'Updated: Send an email to a specified recipient',
webhook_url: 'https://your-server.com/v2/actions/send_email',
json_schema: {
type: 'object',
properties: {
recipient: {type: 'string', description: 'Email address of the recipient'},
subject: {type: 'string', description: 'Email subject line'},
body: JSON.stringify({type: 'string', description: 'Email body content'}),
priority: {
type: 'string',
enum: ['low', 'normal', 'high'],
description: 'Email priority level'
}
},
required: ['recipient', 'subject', 'body']
}
})
};
fetch('https://api.flowent.chat/api/v1/gateway/actions/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"action": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"tenant_id": "123e4567-e89b-12d3-a456-426614174001",
"name": "send_email",
"description": "Send an email to a specified recipient",
"json_schema": {
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
}
},
"required": [
"recipient",
"subject",
"body"
]
},
"webhook_url": "https://your-server.com/actions/send_email",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-01T12:00:00Z"
}
}{
"error": "Invalid request format",
"details": "Field 'name' is required"
}{
"error": "Invalid token"
}{
"error": "Action not found"
}Actions
Update an action
Update an existing action’s properties
PUT
/
actions
/
{name}
Update an action
curl --request PUT \
--url https://api.flowent.chat/api/v1/gateway/actions/{name} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated: Send an email to a specified recipient",
"webhook_url": "https://your-server.com/v2/actions/send_email",
"json_schema": {
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
},
"priority": {
"type": "string",
"enum": [
"low",
"normal",
"high"
],
"description": "Email priority level"
}
},
"required": [
"recipient",
"subject",
"body"
]
}
}
'import requests
url = "https://api.flowent.chat/api/v1/gateway/actions/{name}"
payload = {
"description": "Updated: Send an email to a specified recipient",
"webhook_url": "https://your-server.com/v2/actions/send_email",
"json_schema": {
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
},
"priority": {
"type": "string",
"enum": ["low", "normal", "high"],
"description": "Email priority level"
}
},
"required": ["recipient", "subject", "body"]
}
}
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({
description: 'Updated: Send an email to a specified recipient',
webhook_url: 'https://your-server.com/v2/actions/send_email',
json_schema: {
type: 'object',
properties: {
recipient: {type: 'string', description: 'Email address of the recipient'},
subject: {type: 'string', description: 'Email subject line'},
body: JSON.stringify({type: 'string', description: 'Email body content'}),
priority: {
type: 'string',
enum: ['low', 'normal', 'high'],
description: 'Email priority level'
}
},
required: ['recipient', 'subject', 'body']
}
})
};
fetch('https://api.flowent.chat/api/v1/gateway/actions/{name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"action": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"tenant_id": "123e4567-e89b-12d3-a456-426614174001",
"name": "send_email",
"description": "Send an email to a specified recipient",
"json_schema": {
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
}
},
"required": [
"recipient",
"subject",
"body"
]
},
"webhook_url": "https://your-server.com/actions/send_email",
"created_at": "2023-01-01T12:00:00Z",
"updated_at": "2023-01-01T12:00:00Z"
}
}{
"error": "Invalid request format",
"details": "Field 'name' is required"
}{
"error": "Invalid token"
}{
"error": "Action not found"
}Authorizations
JWT token obtained from token exchange
Path Parameters
Action name
Pattern:
^[a-z0-9_]+$Example:
"send_email"
Body
application/json
Human-readable description of the action
Required string length:
1 - 500Example:
"Updated: Send an email to a specified recipient"
URL where the action will be executed
Example:
"https://your-server.com/v2/actions/send_email"
JSON Schema defining the action's parameters
Example:
{
"type": "object",
"properties": {
"recipient": {
"type": "string",
"description": "Email address of the recipient"
},
"subject": {
"type": "string",
"description": "Email subject line"
},
"body": {
"type": "string",
"description": "Email body content"
},
"priority": {
"type": "string",
"enum": ["low", "normal", "high"],
"description": "Email priority level"
}
},
"required": ["recipient", "subject", "body"]
}
Response
Action updated successfully
Show child attributes
Show child attributes