Logo
Search
Docs

Document share permission

POST https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}/share/permission

Change a recipient's Read/Write permission

Authentication

Send a bearer token created on your dashboard's Developer page:

Authorization: Bearer <YOUR_API_KEY>

Path parameters

knowledge_base string Required

The library.

Validation: the library's UUID
Stored in knowledge_bases.id
article string Required

The document.

Validation: the document's UUID
Stored in knowledge_articles.id

Request body

email string Required

Recipient email — there is no picker of existing users.

Validation: required|string|email|max:255
can_view boolean Optional

Optional — not required or nullable, but must be boolean when present.

Validation: boolean
can_edit boolean Optional

Optional — not required or nullable, but must be boolean when present.

Validation: boolean

Errors

StatusMeaningBody
404 Document not found, or it does not belong to that library {"message":"No query results for model [App\\Models\\KnowledgeArticle] <id>."}
403 Policy denied — outside your organization, or you cannot write to this resource {"message":"This action is unauthorized."}
404 That email has no share or pending invite on this document {"message":"This document is not shared with that email."}
422 Invalid email {"message":"…"}
422 Validation failed {"message":"…","errors":{"field":["…"]}}
401 Missing or invalid bearer token
403 Feature knowledge_docs not enabled for the account

Notes

  • can_view defaults to true and can_edit defaults to false when omitted (not false/false) — the opposite default from the invite endpoint's implicit computation.
curl --request POST \
  --url https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}/share/permission \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "[email protected]",
  "can_view": true,
  "can_edit": true
}'
import requests

url = "https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}/share/permission"
headers = {"Authorization": "Bearer <YOUR_API_KEY>"}
payload = {
  "email": "[email protected]",
  "can_view": true,
  "can_edit": true
}

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

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	url := "https://app.sulus.ai/api/v1/kb/knowledge-bases/{knowledge_base}/articles/{article}/share/permission"
	payload := strings.NewReader(`{
  "email": "[email protected]",
  "can_view": true,
  "can_edit": true
}`)
	req, _ := http.NewRequest("POST", url, payload)
	req.Header.Add("Authorization", "Bearer <YOUR_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))
}
Response 200
{
    "message": "Permission updated."
}