curl --request POST \
--url https://api.effectiveai.app/api/v2/procedures/procedures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"source": "<string>",
"sourceName": "<string>",
"fragments": {},
"documents": {},
"tests": [
{
"path": "<string>",
"source": "<string>"
}
],
"expectedLatestVersion": 4503599627370495,
"access": "organization"
}
'import requests
url = "https://api.effectiveai.app/api/v2/procedures/procedures"
payload = {
"source": "<string>",
"sourceName": "<string>",
"fragments": {},
"documents": {},
"tests": [
{
"path": "<string>",
"source": "<string>"
}
],
"expectedLatestVersion": 4503599627370495,
"access": "organization"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: '<string>',
sourceName: '<string>',
fragments: {},
documents: {},
tests: [{path: '<string>', source: '<string>'}],
expectedLatestVersion: 4503599627370495,
access: 'organization'
})
};
fetch('https://api.effectiveai.app/api/v2/procedures/procedures', 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.effectiveai.app/api/v2/procedures/procedures",
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([
'source' => '<string>',
'sourceName' => '<string>',
'fragments' => [
],
'documents' => [
],
'tests' => [
[
'path' => '<string>',
'source' => '<string>'
]
],
'expectedLatestVersion' => 4503599627370495,
'access' => 'organization'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.effectiveai.app/api/v2/procedures/procedures"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"fragments\": {},\n \"documents\": {},\n \"tests\": [\n {\n \"path\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expectedLatestVersion\": 4503599627370495,\n \"access\": \"organization\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.effectiveai.app/api/v2/procedures/procedures")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"fragments\": {},\n \"documents\": {},\n \"tests\": [\n {\n \"path\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expectedLatestVersion\": 4503599627370495,\n \"access\": \"organization\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.effectiveai.app/api/v2/procedures/procedures")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"fragments\": {},\n \"documents\": {},\n \"tests\": [\n {\n \"path\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expectedLatestVersion\": 4503599627370495,\n \"access\": \"organization\"\n}"
response = http.request(request)
puts response.read_body{
"procedureId": "<string>",
"version": 4503599627370495,
"outcome": "published",
"created": true,
"live": {
"outcome": "promoted",
"version": 4503599627370495
},
"diagnostics": [
{
"code": "<string>",
"severity": "error",
"message": "<string>",
"line": 1,
"column": 1
}
]
}{
"procedureId": "<string>",
"version": 4503599627370495,
"outcome": "published",
"created": true,
"live": {
"outcome": "promoted",
"version": 4503599627370495
},
"diagnostics": [
{
"code": "<string>",
"severity": "error",
"message": "<string>",
"line": 1,
"column": 1
}
]
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}Publish a procedure version
Compiles a procedure’s source and stores it as the next immutable version of the procedure its source names, creating the procedure on its first publish. A new procedure belongs to the caller, and only its owner can run it until access is granted, unless access is organization.
The new version goes live (runs that name live start it) when it keeps the live version’s inputs and result, or when it is the first; otherwise live.outcome is held_interface_mismatch and setProcedureLiveVersion moves it. Source that does not compile is refused with 422 invalid_procedure, whose details give each error’s line, column and message. Creating a procedure needs procedures:create; publishing a later version needs build access to it.
Idempotency-Key is required: a retry with the same key and request answers with the version that request published (outcome: already_published, 200); the same key with a different request is refused with 409 idempotency_conflict. Use a new key for corrected source.
curl --request POST \
--url https://api.effectiveai.app/api/v2/procedures/procedures \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"source": "<string>",
"sourceName": "<string>",
"fragments": {},
"documents": {},
"tests": [
{
"path": "<string>",
"source": "<string>"
}
],
"expectedLatestVersion": 4503599627370495,
"access": "organization"
}
'import requests
url = "https://api.effectiveai.app/api/v2/procedures/procedures"
payload = {
"source": "<string>",
"sourceName": "<string>",
"fragments": {},
"documents": {},
"tests": [
{
"path": "<string>",
"source": "<string>"
}
],
"expectedLatestVersion": 4503599627370495,
"access": "organization"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: '<string>',
sourceName: '<string>',
fragments: {},
documents: {},
tests: [{path: '<string>', source: '<string>'}],
expectedLatestVersion: 4503599627370495,
access: 'organization'
})
};
fetch('https://api.effectiveai.app/api/v2/procedures/procedures', 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.effectiveai.app/api/v2/procedures/procedures",
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([
'source' => '<string>',
'sourceName' => '<string>',
'fragments' => [
],
'documents' => [
],
'tests' => [
[
'path' => '<string>',
'source' => '<string>'
]
],
'expectedLatestVersion' => 4503599627370495,
'access' => 'organization'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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.effectiveai.app/api/v2/procedures/procedures"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"fragments\": {},\n \"documents\": {},\n \"tests\": [\n {\n \"path\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expectedLatestVersion\": 4503599627370495,\n \"access\": \"organization\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.effectiveai.app/api/v2/procedures/procedures")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"fragments\": {},\n \"documents\": {},\n \"tests\": [\n {\n \"path\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expectedLatestVersion\": 4503599627370495,\n \"access\": \"organization\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.effectiveai.app/api/v2/procedures/procedures")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"fragments\": {},\n \"documents\": {},\n \"tests\": [\n {\n \"path\": \"<string>\",\n \"source\": \"<string>\"\n }\n ],\n \"expectedLatestVersion\": 4503599627370495,\n \"access\": \"organization\"\n}"
response = http.request(request)
puts response.read_body{
"procedureId": "<string>",
"version": 4503599627370495,
"outcome": "published",
"created": true,
"live": {
"outcome": "promoted",
"version": 4503599627370495
},
"diagnostics": [
{
"code": "<string>",
"severity": "error",
"message": "<string>",
"line": 1,
"column": 1
}
]
}{
"procedureId": "<string>",
"version": 4503599627370495,
"outcome": "published",
"created": true,
"live": {
"outcome": "promoted",
"version": 4503599627370495
},
"diagnostics": [
{
"code": "<string>",
"severity": "error",
"message": "<string>",
"line": 1,
"column": 1
}
]
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}Authorizations
Headers
Body
Response
A retry: the version this request published before.