Skip to main content
POST
/
knowledge-hub
/
pages
Create page
curl --request POST \
  --url https://api.exec.com/rest/v1/knowledge-hub/pages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Pricing objection guide",
  "content": "## Handling pricing objections\n\nLead with value before discussing discounts…",
  "status": "published",
  "visibility": "workspace",
  "folder_ids": [
    "f1a2b3c4d5e6"
  ],
  "source_ids": [
    "s1a2b3c4d5e6"
  ],
  "skill_ids": [
    "sk1a2b3c4d5e"
  ]
}
'
import requests

url = "https://api.exec.com/rest/v1/knowledge-hub/pages"

payload = {
"title": "Pricing objection guide",
"content": "## Handling pricing objections

Lead with value before discussing discounts…",
"status": "published",
"visibility": "workspace",
"folder_ids": ["f1a2b3c4d5e6"],
"source_ids": ["s1a2b3c4d5e6"],
"skill_ids": ["sk1a2b3c4d5e"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Pricing objection guide',
content: '## Handling pricing objections\n\nLead with value before discussing discounts…',
status: 'published',
visibility: 'workspace',
folder_ids: ['f1a2b3c4d5e6'],
source_ids: ['s1a2b3c4d5e6'],
skill_ids: ['sk1a2b3c4d5e']
})
};

fetch('https://api.exec.com/rest/v1/knowledge-hub/pages', 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.exec.com/rest/v1/knowledge-hub/pages",
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' => 'Pricing objection guide',
'content' => '## Handling pricing objections

Lead with value before discussing discounts…',
'status' => 'published',
'visibility' => 'workspace',
'folder_ids' => [
'f1a2b3c4d5e6'
],
'source_ids' => [
's1a2b3c4d5e6'
],
'skill_ids' => [
'sk1a2b3c4d5e'
]
]),
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.exec.com/rest/v1/knowledge-hub/pages"

payload := strings.NewReader("{\n \"title\": \"Pricing objection guide\",\n \"content\": \"## Handling pricing objections\\n\\nLead with value before discussing discounts…\",\n \"status\": \"published\",\n \"visibility\": \"workspace\",\n \"folder_ids\": [\n \"f1a2b3c4d5e6\"\n ],\n \"source_ids\": [\n \"s1a2b3c4d5e6\"\n ],\n \"skill_ids\": [\n \"sk1a2b3c4d5e\"\n ]\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.exec.com/rest/v1/knowledge-hub/pages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Pricing objection guide\",\n \"content\": \"## Handling pricing objections\\n\\nLead with value before discussing discounts…\",\n \"status\": \"published\",\n \"visibility\": \"workspace\",\n \"folder_ids\": [\n \"f1a2b3c4d5e6\"\n ],\n \"source_ids\": [\n \"s1a2b3c4d5e6\"\n ],\n \"skill_ids\": [\n \"sk1a2b3c4d5e\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.exec.com/rest/v1/knowledge-hub/pages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Pricing objection guide\",\n \"content\": \"## Handling pricing objections\\n\\nLead with value before discussing discounts…\",\n \"status\": \"published\",\n \"visibility\": \"workspace\",\n \"folder_ids\": [\n \"f1a2b3c4d5e6\"\n ],\n \"source_ids\": [\n \"s1a2b3c4d5e6\"\n ],\n \"skill_ids\": [\n \"sk1a2b3c4d5e\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "title": "<string>",
  "owner": {
    "id": "<string>",
    "email": "[email protected]",
    "first_name": "<string>",
    "last_name": "<string>"
  },
  "folders": [
    {
      "id": "<string>",
      "name": "<string>",
      "emoji": "<string>"
    }
  ],
  "skills": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "source_count": 123,
  "version": 123,
  "cover": "<string>",
  "published_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "content": "<string>",
  "sources": [
    {
      "id": "<string>",
      "title": "<string>",
      "token_count": 123,
      "has_images": true,
      "external_url": "<string>",
      "summary": "<string>",
      "cover": "<string>",
      "folders": [
        {
          "id": "<string>",
          "name": "<string>",
          "emoji": "<string>"
        }
      ],
      "created_by": {
        "id": "<string>",
        "email": "[email protected]",
        "first_name": "<string>",
        "last_name": "<string>"
      },
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "processed_at": "2023-11-07T05:31:56Z",
      "content": "<string>"
    }
  ],
  "draft": {
    "title": "<string>",
    "content": "<string>"
  }
}
{
"error": {
"type": "invalid_request",
"code": "invalid_pagination",
"message": "Invalid pagination parameters"
}
}
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid or inactive API key"
}
}

Authorizations

Authorization
string
header
required

API key created in Settings > API.

Format: exec_live_ followed by 40 alphanumeric characters.

Body

application/json
title
string
required

Page title

content
string

Markdown body of the page

status
enum<string>
default:draft

Whether to save as a draft or publish immediately

Available options:
draft,
published
visibility
enum<string>
default:workspace

Visibility scope for the new page

Available options:
private,
workspace
folder_ids
string[]

UUIDs of folders to place the page in

source_ids
string[]

UUIDs of sources to attach to the page

skill_ids
string[]

UUIDs of skills to associate with the page

Response

Page created

A single page with its published body, attached sources, and (optionally) its draft.

id
string

Unique page identifier (UUID)

title
string

Page title

status
enum<string>

Current page status

Available options:
draft,
published,
archived
visibility
enum<string>

Visibility scope of the page

Available options:
private,
workspace,
global
owner
object | null

User who owns the page

folders
object[]

Folders the page belongs to

skills
object[]

Skills associated with the page

source_count
integer

Number of sources attached to the page

version
integer | null

Version number of the published version, or null if never published

cover
string

Cover image reference (empty string if none)

published_at
string<date-time> | null

When the page was last published

created_at
string<date-time>
updated_at
string<date-time>
content
string | null

Markdown body of the published version (null if unpublished)

sources
object[]

Sources attached to the page

draft
object | null

Current draft (only included when requested via ?include=draft)