Create view
curl --request POST \
--url https://api.cx.stax.ai/library/view \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"_id": "<string>",
"activity": [
{
"_id": "<string>",
"action": "<string>",
"changes": [
{
"data": "<string>",
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"client": "<string>",
"on_id": "<string>",
"on_py": 123,
"on_type": "<string>",
"team": "<string>",
"timestamp": "<string>",
"user": "<string>"
}
],
"created_at": "<string>",
"default_for": {},
"deleted_at": "<string>",
"description": "<string>",
"elements": [
{
"content": "<string>",
"field": "<string>",
"type": "<string>"
}
],
"is_default": true,
"n_fields": 123,
"name": "<string>",
"on_type": "<string>",
"resource_type": "<string>",
"resources": 123,
"resources_used_in": 123,
"team": "<string>",
"templates": [
{
"_id": "<string>",
"title": "<string>"
}
]
}
'import requests
url = "https://api.cx.stax.ai/library/view"
payload = {
"_id": "<string>",
"activity": [
{
"_id": "<string>",
"action": "<string>",
"changes": [
{
"data": "<string>",
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"client": "<string>",
"on_id": "<string>",
"on_py": 123,
"on_type": "<string>",
"team": "<string>",
"timestamp": "<string>",
"user": "<string>"
}
],
"created_at": "<string>",
"default_for": {},
"deleted_at": "<string>",
"description": "<string>",
"elements": [
{
"content": "<string>",
"field": "<string>",
"type": "<string>"
}
],
"is_default": True,
"n_fields": 123,
"name": "<string>",
"on_type": "<string>",
"resource_type": "<string>",
"resources": 123,
"resources_used_in": 123,
"team": "<string>",
"templates": [
{
"_id": "<string>",
"title": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
activity: [
{
_id: '<string>',
action: '<string>',
changes: [{data: '<string>', field: '<string>', from: '<string>', to: '<string>'}],
client: '<string>',
on_id: '<string>',
on_py: 123,
on_type: '<string>',
team: '<string>',
timestamp: '<string>',
user: '<string>'
}
],
created_at: '<string>',
default_for: {},
deleted_at: '<string>',
description: '<string>',
elements: [{content: '<string>', field: '<string>', type: '<string>'}],
is_default: true,
n_fields: 123,
name: '<string>',
on_type: '<string>',
resource_type: '<string>',
resources: 123,
resources_used_in: 123,
team: '<string>',
templates: [{_id: '<string>', title: '<string>'}]
})
};
fetch('https://api.cx.stax.ai/library/view', 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.cx.stax.ai/library/view",
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([
'_id' => '<string>',
'activity' => [
[
'_id' => '<string>',
'action' => '<string>',
'changes' => [
[
'data' => '<string>',
'field' => '<string>',
'from' => '<string>',
'to' => '<string>'
]
],
'client' => '<string>',
'on_id' => '<string>',
'on_py' => 123,
'on_type' => '<string>',
'team' => '<string>',
'timestamp' => '<string>',
'user' => '<string>'
]
],
'created_at' => '<string>',
'default_for' => [
],
'deleted_at' => '<string>',
'description' => '<string>',
'elements' => [
[
'content' => '<string>',
'field' => '<string>',
'type' => '<string>'
]
],
'is_default' => true,
'n_fields' => 123,
'name' => '<string>',
'on_type' => '<string>',
'resource_type' => '<string>',
'resources' => 123,
'resources_used_in' => 123,
'team' => '<string>',
'templates' => [
[
'_id' => '<string>',
'title' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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.cx.stax.ai/library/view"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"activity\": [\n {\n \"_id\": \"<string>\",\n \"action\": \"<string>\",\n \"changes\": [\n {\n \"data\": \"<string>\",\n \"field\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ],\n \"client\": \"<string>\",\n \"on_id\": \"<string>\",\n \"on_py\": 123,\n \"on_type\": \"<string>\",\n \"team\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user\": \"<string>\"\n }\n ],\n \"created_at\": \"<string>\",\n \"default_for\": {},\n \"deleted_at\": \"<string>\",\n \"description\": \"<string>\",\n \"elements\": [\n {\n \"content\": \"<string>\",\n \"field\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"is_default\": true,\n \"n_fields\": 123,\n \"name\": \"<string>\",\n \"on_type\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resources\": 123,\n \"resources_used_in\": 123,\n \"team\": \"<string>\",\n \"templates\": [\n {\n \"_id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.cx.stax.ai/library/view")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"activity\": [\n {\n \"_id\": \"<string>\",\n \"action\": \"<string>\",\n \"changes\": [\n {\n \"data\": \"<string>\",\n \"field\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ],\n \"client\": \"<string>\",\n \"on_id\": \"<string>\",\n \"on_py\": 123,\n \"on_type\": \"<string>\",\n \"team\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user\": \"<string>\"\n }\n ],\n \"created_at\": \"<string>\",\n \"default_for\": {},\n \"deleted_at\": \"<string>\",\n \"description\": \"<string>\",\n \"elements\": [\n {\n \"content\": \"<string>\",\n \"field\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"is_default\": true,\n \"n_fields\": 123,\n \"name\": \"<string>\",\n \"on_type\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resources\": 123,\n \"resources_used_in\": 123,\n \"team\": \"<string>\",\n \"templates\": [\n {\n \"_id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/library/view")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"activity\": [\n {\n \"_id\": \"<string>\",\n \"action\": \"<string>\",\n \"changes\": [\n {\n \"data\": \"<string>\",\n \"field\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ],\n \"client\": \"<string>\",\n \"on_id\": \"<string>\",\n \"on_py\": 123,\n \"on_type\": \"<string>\",\n \"team\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user\": \"<string>\"\n }\n ],\n \"created_at\": \"<string>\",\n \"default_for\": {},\n \"deleted_at\": \"<string>\",\n \"description\": \"<string>\",\n \"elements\": [\n {\n \"content\": \"<string>\",\n \"field\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"is_default\": true,\n \"n_fields\": 123,\n \"name\": \"<string>\",\n \"on_type\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resources\": 123,\n \"resources_used_in\": 123,\n \"team\": \"<string>\",\n \"templates\": [\n {\n \"_id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"activity": [
{
"_id": "<string>",
"action": "<string>",
"changes": [
{
"data": "<string>",
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"client": "<string>",
"on_id": "<string>",
"on_py": 123,
"on_type": "<string>",
"team": "<string>",
"timestamp": "<string>",
"user": "<string>"
}
],
"created_at": "<string>",
"default_for": {},
"deleted_at": "<string>",
"description": "<string>",
"elements": [
{
"content": "<string>",
"field": "<string>",
"type": "<string>"
}
],
"is_default": true,
"n_fields": 123,
"name": "<string>",
"on_type": "<string>",
"resource_type": "<string>",
"resources": 123,
"resources_used_in": 123,
"team": "<string>",
"templates": [
{
"_id": "<string>",
"title": "<string>"
}
]
}{}{}library
Create view
Create a new view (name required). Supports automatic name deduplication. on_type may be client, plan, project, employee, or employee_census; employee/employee_census views can set default_for {"plan_type": "..."} for frontend default resolution by the client's plan types.
POST
/
library
/
view
Create view
curl --request POST \
--url https://api.cx.stax.ai/library/view \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"_id": "<string>",
"activity": [
{
"_id": "<string>",
"action": "<string>",
"changes": [
{
"data": "<string>",
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"client": "<string>",
"on_id": "<string>",
"on_py": 123,
"on_type": "<string>",
"team": "<string>",
"timestamp": "<string>",
"user": "<string>"
}
],
"created_at": "<string>",
"default_for": {},
"deleted_at": "<string>",
"description": "<string>",
"elements": [
{
"content": "<string>",
"field": "<string>",
"type": "<string>"
}
],
"is_default": true,
"n_fields": 123,
"name": "<string>",
"on_type": "<string>",
"resource_type": "<string>",
"resources": 123,
"resources_used_in": 123,
"team": "<string>",
"templates": [
{
"_id": "<string>",
"title": "<string>"
}
]
}
'import requests
url = "https://api.cx.stax.ai/library/view"
payload = {
"_id": "<string>",
"activity": [
{
"_id": "<string>",
"action": "<string>",
"changes": [
{
"data": "<string>",
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"client": "<string>",
"on_id": "<string>",
"on_py": 123,
"on_type": "<string>",
"team": "<string>",
"timestamp": "<string>",
"user": "<string>"
}
],
"created_at": "<string>",
"default_for": {},
"deleted_at": "<string>",
"description": "<string>",
"elements": [
{
"content": "<string>",
"field": "<string>",
"type": "<string>"
}
],
"is_default": True,
"n_fields": 123,
"name": "<string>",
"on_type": "<string>",
"resource_type": "<string>",
"resources": 123,
"resources_used_in": 123,
"team": "<string>",
"templates": [
{
"_id": "<string>",
"title": "<string>"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
activity: [
{
_id: '<string>',
action: '<string>',
changes: [{data: '<string>', field: '<string>', from: '<string>', to: '<string>'}],
client: '<string>',
on_id: '<string>',
on_py: 123,
on_type: '<string>',
team: '<string>',
timestamp: '<string>',
user: '<string>'
}
],
created_at: '<string>',
default_for: {},
deleted_at: '<string>',
description: '<string>',
elements: [{content: '<string>', field: '<string>', type: '<string>'}],
is_default: true,
n_fields: 123,
name: '<string>',
on_type: '<string>',
resource_type: '<string>',
resources: 123,
resources_used_in: 123,
team: '<string>',
templates: [{_id: '<string>', title: '<string>'}]
})
};
fetch('https://api.cx.stax.ai/library/view', 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.cx.stax.ai/library/view",
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([
'_id' => '<string>',
'activity' => [
[
'_id' => '<string>',
'action' => '<string>',
'changes' => [
[
'data' => '<string>',
'field' => '<string>',
'from' => '<string>',
'to' => '<string>'
]
],
'client' => '<string>',
'on_id' => '<string>',
'on_py' => 123,
'on_type' => '<string>',
'team' => '<string>',
'timestamp' => '<string>',
'user' => '<string>'
]
],
'created_at' => '<string>',
'default_for' => [
],
'deleted_at' => '<string>',
'description' => '<string>',
'elements' => [
[
'content' => '<string>',
'field' => '<string>',
'type' => '<string>'
]
],
'is_default' => true,
'n_fields' => 123,
'name' => '<string>',
'on_type' => '<string>',
'resource_type' => '<string>',
'resources' => 123,
'resources_used_in' => 123,
'team' => '<string>',
'templates' => [
[
'_id' => '<string>',
'title' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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.cx.stax.ai/library/view"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"activity\": [\n {\n \"_id\": \"<string>\",\n \"action\": \"<string>\",\n \"changes\": [\n {\n \"data\": \"<string>\",\n \"field\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ],\n \"client\": \"<string>\",\n \"on_id\": \"<string>\",\n \"on_py\": 123,\n \"on_type\": \"<string>\",\n \"team\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user\": \"<string>\"\n }\n ],\n \"created_at\": \"<string>\",\n \"default_for\": {},\n \"deleted_at\": \"<string>\",\n \"description\": \"<string>\",\n \"elements\": [\n {\n \"content\": \"<string>\",\n \"field\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"is_default\": true,\n \"n_fields\": 123,\n \"name\": \"<string>\",\n \"on_type\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resources\": 123,\n \"resources_used_in\": 123,\n \"team\": \"<string>\",\n \"templates\": [\n {\n \"_id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.cx.stax.ai/library/view")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"activity\": [\n {\n \"_id\": \"<string>\",\n \"action\": \"<string>\",\n \"changes\": [\n {\n \"data\": \"<string>\",\n \"field\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ],\n \"client\": \"<string>\",\n \"on_id\": \"<string>\",\n \"on_py\": 123,\n \"on_type\": \"<string>\",\n \"team\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user\": \"<string>\"\n }\n ],\n \"created_at\": \"<string>\",\n \"default_for\": {},\n \"deleted_at\": \"<string>\",\n \"description\": \"<string>\",\n \"elements\": [\n {\n \"content\": \"<string>\",\n \"field\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"is_default\": true,\n \"n_fields\": 123,\n \"name\": \"<string>\",\n \"on_type\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resources\": 123,\n \"resources_used_in\": 123,\n \"team\": \"<string>\",\n \"templates\": [\n {\n \"_id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/library/view")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"activity\": [\n {\n \"_id\": \"<string>\",\n \"action\": \"<string>\",\n \"changes\": [\n {\n \"data\": \"<string>\",\n \"field\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ],\n \"client\": \"<string>\",\n \"on_id\": \"<string>\",\n \"on_py\": 123,\n \"on_type\": \"<string>\",\n \"team\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user\": \"<string>\"\n }\n ],\n \"created_at\": \"<string>\",\n \"default_for\": {},\n \"deleted_at\": \"<string>\",\n \"description\": \"<string>\",\n \"elements\": [\n {\n \"content\": \"<string>\",\n \"field\": \"<string>\",\n \"type\": \"<string>\"\n }\n ],\n \"is_default\": true,\n \"n_fields\": 123,\n \"name\": \"<string>\",\n \"on_type\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resources\": 123,\n \"resources_used_in\": 123,\n \"team\": \"<string>\",\n \"templates\": [\n {\n \"_id\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"activity": [
{
"_id": "<string>",
"action": "<string>",
"changes": [
{
"data": "<string>",
"field": "<string>",
"from": "<string>",
"to": "<string>"
}
],
"client": "<string>",
"on_id": "<string>",
"on_py": 123,
"on_type": "<string>",
"team": "<string>",
"timestamp": "<string>",
"user": "<string>"
}
],
"created_at": "<string>",
"default_for": {},
"deleted_at": "<string>",
"description": "<string>",
"elements": [
{
"content": "<string>",
"field": "<string>",
"type": "<string>"
}
],
"is_default": true,
"n_fields": 123,
"name": "<string>",
"on_type": "<string>",
"resource_type": "<string>",
"resources": 123,
"resources_used_in": 123,
"team": "<string>",
"templates": [
{
"_id": "<string>",
"title": "<string>"
}
]
}{}{}Authorizations
Body
application/json
View creation data
Response
Created view