curl --request POST \
--url https://scribe.skeptrune.com/api/docs/{id}/shares \
--header 'Content-Type: application/json' \
--cookie scribe_session= \
--data '
{
"email": "[email protected]",
"role": "editor"
}
'import requests
url = "https://scribe.skeptrune.com/api/docs/{id}/shares"
payload = {
"email": "[email protected]",
"role": "editor"
}
headers = {
"cookie": "scribe_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'scribe_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '[email protected]', role: 'editor'})
};
fetch('https://scribe.skeptrune.com/api/docs/{id}/shares', 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://scribe.skeptrune.com/api/docs/{id}/shares",
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([
'email' => '[email protected]',
'role' => 'editor'
]),
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"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://scribe.skeptrune.com/api/docs/{id}/shares"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"role\": \"editor\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "scribe_session=")
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://scribe.skeptrune.com/api/docs/{id}/shares")
.header("cookie", "scribe_session=")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"role\": \"editor\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/docs/{id}/shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'scribe_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"role\": \"editor\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "usr_3fGhJkLmNpQrStUvWx5y",
"email": "[email protected]",
"name": "Grace Hopper",
"role": "editor",
"createdAt": 1752624000000
}{
"invite": {
"id": "dsi_5aBcDeFgHiJkLmNoPq6r",
"email": "[email protected]",
"role": "commenter",
"pending": true,
"createdAt": 1752624000000
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Share with a user by email
Grants a role on this document to a user addressed by email. When the email matches an existing Scribe user, a direct share is created (201). When no user with that email exists, a pending share invite is created and a sign-up invitation email is sent (202); the share materializes on their first login. Agent users cannot be matched by email (share with them via their user id instead). Requires write access (owner or editor); API keys with edit access act as their agent identity.
curl --request POST \
--url https://scribe.skeptrune.com/api/docs/{id}/shares \
--header 'Content-Type: application/json' \
--cookie scribe_session= \
--data '
{
"email": "[email protected]",
"role": "editor"
}
'import requests
url = "https://scribe.skeptrune.com/api/docs/{id}/shares"
payload = {
"email": "[email protected]",
"role": "editor"
}
headers = {
"cookie": "scribe_session=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {cookie: 'scribe_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '[email protected]', role: 'editor'})
};
fetch('https://scribe.skeptrune.com/api/docs/{id}/shares', 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://scribe.skeptrune.com/api/docs/{id}/shares",
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([
'email' => '[email protected]',
'role' => 'editor'
]),
CURLOPT_COOKIE => "scribe_session=",
CURLOPT_HTTPHEADER => [
"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://scribe.skeptrune.com/api/docs/{id}/shares"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"role\": \"editor\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "scribe_session=")
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://scribe.skeptrune.com/api/docs/{id}/shares")
.header("cookie", "scribe_session=")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"role\": \"editor\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://scribe.skeptrune.com/api/docs/{id}/shares")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["cookie"] = 'scribe_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"role\": \"editor\"\n}"
response = http.request(request)
puts response.read_body{
"userId": "usr_3fGhJkLmNpQrStUvWx5y",
"email": "[email protected]",
"name": "Grace Hopper",
"role": "editor",
"createdAt": 1752624000000
}{
"invite": {
"id": "dsi_5aBcDeFgHiJkLmNoPq6r",
"email": "[email protected]",
"role": "commenter",
"pending": true,
"createdAt": 1752624000000
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}{
"error": {
"code": "not_found",
"message": "No such document."
}
}Authorizations
Browser session cookie set by the WorkOS sign-in flow.
Path Parameters
Id of the document to share by email.
Body
Email of the user and the role to grant.
Share the document with a user addressed by email.
Email address to share with. Unknown addresses receive a sign-up invitation.
Role to grant to the user matched by email.
viewer, commenter, editor "editor"
Response
The share entry created for the user matched by email.
A per-user share entry on a document.
User id the document is shared with.
"usr_3fGhJkLmNpQrStUvWx5y"
Email of that user.
Display name of that user.
"Grace Hopper"
Per-document share role.
viewer, commenter, editor "editor"
When the share was granted (epoch milliseconds).
1752624000000