curl --request POST \
--url https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"content": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"metadata": {}
}
'import requests
url = "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents"
payload = {
"path": "<string>",
"content": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"metadata": {}
}
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({
path: '<string>',
content: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
modifiedBy: '<string>',
metadata: {}
})
};
fetch('https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents', 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://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents",
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([
'path' => '<string>',
'content' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'modifiedBy' => '<string>',
'metadata' => [
]
]),
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://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"modifiedBy\": \"<string>\",\n \"metadata\": {}\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://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"modifiedBy\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents")
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 \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"modifiedBy\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"path": "<string>",
"content": "<string>",
"type": "workbook",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"metadata": {}
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Create document
Creates a new document within the workspace (the {workspaceName} in the path is the
destination), such as a workbook or dashboard.
Authorization: Requires workspace manager or editor permissions.
Parameters: Use overwrite to replace existing documents with the same path.
Content: Supports Malloy code, configuration, and other document types.
Relocating an existing document: Set moveFrom to the credible:// URI of a
document in another workspace to atomically relocate it into this workspace instead of
creating from the request body. The source document is deleted, its content/metadata are
transplanted under the same path here, and chat/report bookmarks are re-pointed. The
request body is ignored in this mode. The destination workspace must be a shared (Group)
workspace and must already have every package the source document references — the
endpoint deliberately does NOT silently attach packages (that would be a backdoor for
granting package read access). Returns 400 if a required package is missing; attach it
via the package-permission endpoints first and retry.
curl --request POST \
--url https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"content": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"metadata": {}
}
'import requests
url = "https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents"
payload = {
"path": "<string>",
"content": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"metadata": {}
}
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({
path: '<string>',
content: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
modifiedBy: '<string>',
metadata: {}
})
};
fetch('https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents', 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://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents",
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([
'path' => '<string>',
'content' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'modifiedBy' => '<string>',
'metadata' => [
]
]),
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://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"modifiedBy\": \"<string>\",\n \"metadata\": {}\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://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"modifiedBy\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{organization}.admin.credibledata.com/api/v0/organizations/{organizationName}/workspaces/{workspaceName}/documents")
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 \"path\": \"<string>\",\n \"content\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"modifiedBy\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"path": "<string>",
"content": "<string>",
"type": "workbook",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"modifiedBy": "<string>",
"metadata": {}
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
Query Parameters
Optional credible:// URI of a source document to relocate into this workspace (e.g. credible://workspaces/{sourceWorkspace}/documents/{sourcePath}). When set, the source document is moved here under the same path and the request body is ignored. Only data chats and reports may be moved. Not constrained by ResourceIdentifierPattern: the embedded workspace name and document path allow spaces and punctuation (see WorkspaceNamePattern / DocumentPathPattern). The URI is structurally validated by the server (parsed into workspace + document path) and the move is authorized against the resolved source document.
512Body
Represents a document within a workspace, such as a workbook or dashboard
Response
Document created (or relocated) successfully
Represents a document within a workspace, such as a workbook or dashboard
Was this page helpful?