Create a custom automation endpoint
curl --request POST \
--url https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"method": "<string>",
"response_template": {},
"request_schema": {},
"rpa_run_id": "<string>",
"parameter_mapping": {}
}
'import requests
url = "https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints"
payload = {
"slug": "<string>",
"method": "<string>",
"response_template": {},
"request_schema": {},
"rpa_run_id": "<string>",
"parameter_mapping": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
method: '<string>',
response_template: {},
request_schema: {},
rpa_run_id: '<string>',
parameter_mapping: {}
})
};
fetch('https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints', 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.getgranite.ai/api/organizations/{organization_id}/automations/endpoints",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'method' => '<string>',
'response_template' => [
],
'request_schema' => [
],
'rpa_run_id' => '<string>',
'parameter_mapping' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.getgranite.ai/api/organizations/{organization_id}/automations/endpoints"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"method\": \"<string>\",\n \"response_template\": {},\n \"request_schema\": {},\n \"rpa_run_id\": \"<string>\",\n \"parameter_mapping\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"method\": \"<string>\",\n \"response_template\": {},\n \"request_schema\": {},\n \"rpa_run_id\": \"<string>\",\n \"parameter_mapping\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"method\": \"<string>\",\n \"response_template\": {},\n \"request_schema\": {},\n \"rpa_run_id\": \"<string>\",\n \"parameter_mapping\": {}\n}"
response = http.request(request)
puts response.read_body{
"endpoint": {
"endpoint_id": "<string>",
"slug": "<string>",
"method": "<string>",
"response_template": {},
"request_schema": {},
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>",
"rpa_run_id": "<string>",
"parameter_mapping": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Organization Automations
Create Endpoint
Create a new REST endpoint for the organization’s automations
POST
/
api
/
organizations
/
{organization_id}
/
automations
/
endpoints
Create a custom automation endpoint
curl --request POST \
--url https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"method": "<string>",
"response_template": {},
"request_schema": {},
"rpa_run_id": "<string>",
"parameter_mapping": {}
}
'import requests
url = "https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints"
payload = {
"slug": "<string>",
"method": "<string>",
"response_template": {},
"request_schema": {},
"rpa_run_id": "<string>",
"parameter_mapping": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
slug: '<string>',
method: '<string>',
response_template: {},
request_schema: {},
rpa_run_id: '<string>',
parameter_mapping: {}
})
};
fetch('https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints', 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.getgranite.ai/api/organizations/{organization_id}/automations/endpoints",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'slug' => '<string>',
'method' => '<string>',
'response_template' => [
],
'request_schema' => [
],
'rpa_run_id' => '<string>',
'parameter_mapping' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.getgranite.ai/api/organizations/{organization_id}/automations/endpoints"
payload := strings.NewReader("{\n \"slug\": \"<string>\",\n \"method\": \"<string>\",\n \"response_template\": {},\n \"request_schema\": {},\n \"rpa_run_id\": \"<string>\",\n \"parameter_mapping\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints")
.header("Content-Type", "application/json")
.body("{\n \"slug\": \"<string>\",\n \"method\": \"<string>\",\n \"response_template\": {},\n \"request_schema\": {},\n \"rpa_run_id\": \"<string>\",\n \"parameter_mapping\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getgranite.ai/api/organizations/{organization_id}/automations/endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"slug\": \"<string>\",\n \"method\": \"<string>\",\n \"response_template\": {},\n \"request_schema\": {},\n \"rpa_run_id\": \"<string>\",\n \"parameter_mapping\": {}\n}"
response = http.request(request)
puts response.read_body{
"endpoint": {
"endpoint_id": "<string>",
"slug": "<string>",
"method": "<string>",
"response_template": {},
"request_schema": {},
"is_active": true,
"created_at": "<string>",
"updated_at": "<string>",
"rpa_run_id": "<string>",
"parameter_mapping": {}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
Body
application/json
Request to create a custom automation endpoint
URL-friendly endpoint identifier
HTTP method (GET, POST, PUT, PATCH, DELETE)
Response template JSON
Request schema JSON
RPA run_id to link for automation execution
Mapping of endpoint parameters to script parameters
Response
Successful Response
Response containing a single endpoint
Endpoint information
Show child attributes
Show child attributes
⌘I