Update Schema
curl --request PATCH \
--url https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated description",
"fields": [
{
"id": "fld-order-id",
"name": "orderId",
"type": "string",
"required": true
},
{
"id": "fld-amount",
"name": "amountCents",
"type": "number",
"required": true
},
{
"id": "fld-currency",
"name": "currency",
"type": "enum",
"required": true,
"enumValues": [
"USD",
"EUR",
"GBP"
]
}
]
}
'import requests
url = "https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}"
payload = {
"description": "Updated description",
"fields": [
{
"id": "fld-order-id",
"name": "orderId",
"type": "string",
"required": True
},
{
"id": "fld-amount",
"name": "amountCents",
"type": "number",
"required": True
},
{
"id": "fld-currency",
"name": "currency",
"type": "enum",
"required": True,
"enumValues": ["USD", "EUR", "GBP"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Updated description',
fields: [
{id: 'fld-order-id', name: 'orderId', type: 'string', required: true},
{id: 'fld-amount', name: 'amountCents', type: 'number', required: true},
{
id: 'fld-currency',
name: 'currency',
type: 'enum',
required: true,
enumValues: ['USD', 'EUR', 'GBP']
}
]
})
};
fetch('https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}",
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([
'description' => 'Updated description',
'fields' => [
[
'id' => 'fld-order-id',
'name' => 'orderId',
'type' => 'string',
'required' => true
],
[
'id' => 'fld-amount',
'name' => 'amountCents',
'type' => 'number',
'required' => true
],
[
'id' => 'fld-currency',
'name' => 'currency',
'type' => 'enum',
'required' => true,
'enumValues' => [
'USD',
'EUR',
'GBP'
]
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}"
payload := strings.NewReader("{\n \"description\": \"Updated description\",\n \"fields\": [\n {\n \"id\": \"fld-order-id\",\n \"name\": \"orderId\",\n \"type\": \"string\",\n \"required\": true\n },\n {\n \"id\": \"fld-amount\",\n \"name\": \"amountCents\",\n \"type\": \"number\",\n \"required\": true\n },\n {\n \"id\": \"fld-currency\",\n \"name\": \"currency\",\n \"type\": \"enum\",\n \"required\": true,\n \"enumValues\": [\n \"USD\",\n \"EUR\",\n \"GBP\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated description\",\n \"fields\": [\n {\n \"id\": \"fld-order-id\",\n \"name\": \"orderId\",\n \"type\": \"string\",\n \"required\": true\n },\n {\n \"id\": \"fld-amount\",\n \"name\": \"amountCents\",\n \"type\": \"number\",\n \"required\": true\n },\n {\n \"id\": \"fld-currency\",\n \"name\": \"currency\",\n \"type\": \"enum\",\n \"required\": true,\n \"enumValues\": [\n \"USD\",\n \"EUR\",\n \"GBP\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}")
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 \"description\": \"Updated description\",\n \"fields\": [\n {\n \"id\": \"fld-order-id\",\n \"name\": \"orderId\",\n \"type\": \"string\",\n \"required\": true\n },\n {\n \"id\": \"fld-amount\",\n \"name\": \"amountCents\",\n \"type\": \"number\",\n \"required\": true\n },\n {\n \"id\": \"fld-currency\",\n \"name\": \"currency\",\n \"type\": \"enum\",\n \"required\": true,\n \"enumValues\": [\n \"USD\",\n \"EUR\",\n \"GBP\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"appId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventName": "<string>",
"description": "<string>",
"fields": [
{
"id": "<string>",
"name": "<string>",
"required": false,
"enumValues": [
"<string>"
]
}
],
"metadataFields": [
{
"id": "<string>",
"name": "<string>",
"required": false,
"enumValues": [
"<string>"
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}Schemas
Update Schema
Updates an existing event schema. All fields are optional. The fields array replaces existing fields entirely.
PATCH
/
apps
/
{appId}
/
schemas
/
{schemaId}
Update Schema
curl --request PATCH \
--url https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Updated description",
"fields": [
{
"id": "fld-order-id",
"name": "orderId",
"type": "string",
"required": true
},
{
"id": "fld-amount",
"name": "amountCents",
"type": "number",
"required": true
},
{
"id": "fld-currency",
"name": "currency",
"type": "enum",
"required": true,
"enumValues": [
"USD",
"EUR",
"GBP"
]
}
]
}
'import requests
url = "https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}"
payload = {
"description": "Updated description",
"fields": [
{
"id": "fld-order-id",
"name": "orderId",
"type": "string",
"required": True
},
{
"id": "fld-amount",
"name": "amountCents",
"type": "number",
"required": True
},
{
"id": "fld-currency",
"name": "currency",
"type": "enum",
"required": True,
"enumValues": ["USD", "EUR", "GBP"]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Updated description',
fields: [
{id: 'fld-order-id', name: 'orderId', type: 'string', required: true},
{id: 'fld-amount', name: 'amountCents', type: 'number', required: true},
{
id: 'fld-currency',
name: 'currency',
type: 'enum',
required: true,
enumValues: ['USD', 'EUR', 'GBP']
}
]
})
};
fetch('https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}",
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([
'description' => 'Updated description',
'fields' => [
[
'id' => 'fld-order-id',
'name' => 'orderId',
'type' => 'string',
'required' => true
],
[
'id' => 'fld-amount',
'name' => 'amountCents',
'type' => 'number',
'required' => true
],
[
'id' => 'fld-currency',
'name' => 'currency',
'type' => 'enum',
'required' => true,
'enumValues' => [
'USD',
'EUR',
'GBP'
]
]
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}"
payload := strings.NewReader("{\n \"description\": \"Updated description\",\n \"fields\": [\n {\n \"id\": \"fld-order-id\",\n \"name\": \"orderId\",\n \"type\": \"string\",\n \"required\": true\n },\n {\n \"id\": \"fld-amount\",\n \"name\": \"amountCents\",\n \"type\": \"number\",\n \"required\": true\n },\n {\n \"id\": \"fld-currency\",\n \"name\": \"currency\",\n \"type\": \"enum\",\n \"required\": true,\n \"enumValues\": [\n \"USD\",\n \"EUR\",\n \"GBP\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated description\",\n \"fields\": [\n {\n \"id\": \"fld-order-id\",\n \"name\": \"orderId\",\n \"type\": \"string\",\n \"required\": true\n },\n {\n \"id\": \"fld-amount\",\n \"name\": \"amountCents\",\n \"type\": \"number\",\n \"required\": true\n },\n {\n \"id\": \"fld-currency\",\n \"name\": \"currency\",\n \"type\": \"enum\",\n \"required\": true,\n \"enumValues\": [\n \"USD\",\n \"EUR\",\n \"GBP\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vela.dev/v1/apps/{appId}/schemas/{schemaId}")
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 \"description\": \"Updated description\",\n \"fields\": [\n {\n \"id\": \"fld-order-id\",\n \"name\": \"orderId\",\n \"type\": \"string\",\n \"required\": true\n },\n {\n \"id\": \"fld-amount\",\n \"name\": \"amountCents\",\n \"type\": \"number\",\n \"required\": true\n },\n {\n \"id\": \"fld-currency\",\n \"name\": \"currency\",\n \"type\": \"enum\",\n \"required\": true,\n \"enumValues\": [\n \"USD\",\n \"EUR\",\n \"GBP\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"appId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"eventName": "<string>",
"description": "<string>",
"fields": [
{
"id": "<string>",
"name": "<string>",
"required": false,
"enumValues": [
"<string>"
]
}
],
"metadataFields": [
{
"id": "<string>",
"name": "<string>",
"required": false,
"enumValues": [
"<string>"
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}Authorizations
Client secret for management API access. Format: vela_cs_...
Body
application/json
Response
Updated schema
Schema identifier
Associated app
Event name (unique per app)
Human-readable description
Event data field definitions
Show child attributes
Show child attributes
Metadata field definitions
Show child attributes
Show child attributes
⌘I