curl --request POST \
--url https://apis.experro.app/content/v2/content-models/{modelInternalName}/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-environment-id: <x-environment-id>' \
--header 'x-tenant-id: <x-tenant-id>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"title": "My First Blog Post",
"page_slug": "my-first-blog-post",
"description": "An introduction to our new feature."
}
'import requests
url = "https://apis.experro.app/content/v2/content-models/{modelInternalName}/records"
payload = {
"title": "My First Blog Post",
"page_slug": "my-first-blog-post",
"description": "An introduction to our new feature."
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"x-workspace-id": "<x-workspace-id>",
"x-environment-id": "<x-environment-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
'x-workspace-id': '<x-workspace-id>',
'x-environment-id': '<x-environment-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'My First Blog Post',
page_slug: 'my-first-blog-post',
description: 'An introduction to our new feature.'
})
};
fetch('https://apis.experro.app/content/v2/content-models/{modelInternalName}/records', 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://apis.experro.app/content/v2/content-models/{modelInternalName}/records",
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([
'title' => 'My First Blog Post',
'page_slug' => 'my-first-blog-post',
'description' => 'An introduction to our new feature.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-environment-id: <x-environment-id>",
"x-tenant-id: <x-tenant-id>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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://apis.experro.app/content/v2/content-models/{modelInternalName}/records"
payload := strings.NewReader("{\n \"title\": \"My First Blog Post\",\n \"page_slug\": \"my-first-blog-post\",\n \"description\": \"An introduction to our new feature.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-environment-id", "<x-environment-id>")
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://apis.experro.app/content/v2/content-models/{modelInternalName}/records")
.header("x-tenant-id", "<x-tenant-id>")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-environment-id", "<x-environment-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My First Blog Post\",\n \"page_slug\": \"my-first-blog-post\",\n \"description\": \"An introduction to our new feature.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.experro.app/content/v2/content-models/{modelInternalName}/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["x-workspace-id"] = '<x-workspace-id>'
request["x-environment-id"] = '<x-environment-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"My First Blog Post\",\n \"page_slug\": \"my-first-blog-post\",\n \"description\": \"An introduction to our new feature.\"\n}"
response = http.request(request)
puts response.read_body{
"Status": "<string>",
"Data": {
"content_model_data_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_id": "<string>"
}
}{
"Status": "failure",
"Data": {
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}{
"Status": "failure",
"Data": {
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}{
"Status": "failure",
"Data": {
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}Add Record
Create a new record for a content model with this API. It allows you to specify details like title, page slug (if the content model has ‘act_as_web_page’ enabled), version data, and relation fields.
curl --request POST \
--url https://apis.experro.app/content/v2/content-models/{modelInternalName}/records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-environment-id: <x-environment-id>' \
--header 'x-tenant-id: <x-tenant-id>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"title": "My First Blog Post",
"page_slug": "my-first-blog-post",
"description": "An introduction to our new feature."
}
'import requests
url = "https://apis.experro.app/content/v2/content-models/{modelInternalName}/records"
payload = {
"title": "My First Blog Post",
"page_slug": "my-first-blog-post",
"description": "An introduction to our new feature."
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"x-workspace-id": "<x-workspace-id>",
"x-environment-id": "<x-environment-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
'x-workspace-id': '<x-workspace-id>',
'x-environment-id': '<x-environment-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'My First Blog Post',
page_slug: 'my-first-blog-post',
description: 'An introduction to our new feature.'
})
};
fetch('https://apis.experro.app/content/v2/content-models/{modelInternalName}/records', 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://apis.experro.app/content/v2/content-models/{modelInternalName}/records",
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([
'title' => 'My First Blog Post',
'page_slug' => 'my-first-blog-post',
'description' => 'An introduction to our new feature.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-environment-id: <x-environment-id>",
"x-tenant-id: <x-tenant-id>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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://apis.experro.app/content/v2/content-models/{modelInternalName}/records"
payload := strings.NewReader("{\n \"title\": \"My First Blog Post\",\n \"page_slug\": \"my-first-blog-post\",\n \"description\": \"An introduction to our new feature.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-environment-id", "<x-environment-id>")
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://apis.experro.app/content/v2/content-models/{modelInternalName}/records")
.header("x-tenant-id", "<x-tenant-id>")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-environment-id", "<x-environment-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"My First Blog Post\",\n \"page_slug\": \"my-first-blog-post\",\n \"description\": \"An introduction to our new feature.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apis.experro.app/content/v2/content-models/{modelInternalName}/records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["x-workspace-id"] = '<x-workspace-id>'
request["x-environment-id"] = '<x-environment-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"My First Blog Post\",\n \"page_slug\": \"my-first-blog-post\",\n \"description\": \"An introduction to our new feature.\"\n}"
response = http.request(request)
puts response.read_body{
"Status": "<string>",
"Data": {
"content_model_data_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_id": "<string>"
}
}{
"Status": "failure",
"Data": {
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}{
"Status": "failure",
"Data": {
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}{
"Status": "failure",
"Data": {
"Status": "failure",
"Error": {
"message": "<string>",
"name": "<string>",
"code": "<string>"
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Identifier for the tenant. Ensures data isolation per tenant.
Workspace identifier within the tenant. Scopes resources to a specific workspace.
Unique identifier of the target environment. Used to scope the API call to a specific deployment environment.
"PRODUCTION-15a0f8c2-a5e8-4e40-ae74-cb1389d22f45-w49jkngj"
Path Parameters
Specifies the internal name of the content model.
Query Parameters
Specifies the language or region for the response data
Boolean flag to publish the record. Set to true to publish immediately upon creation.
Comma-separated environment IDs; required if publish is set to true.
Body
Specifies the title of the record.
"My First Blog Post"
Specifies the URL-friendly slug for the page. Required if model is set to act as a web page.
"my-first-blog-post"
Provides a brief description of the record. (Optional)
"An introduction to our new feature."