Share A Page Or Folder With Someone
POST
/shares/entity/{entityType}/{entityId}/grants
const url = 'https://app.metakip.com/api/v1/shares/entity/page/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/grants';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"hello@example.com","permission":"view"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://app.metakip.com/api/v1/shares/entity/page/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/grants \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com", "permission": "view" }'Grants access to an existing Metakip user or queues an email invitation for a new user. Only an owner or administrator can share an entity; only the owner can grant Admin access.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”entityType
required
string
The kind of Metakip entity to share.
entityId
required
string format: uuid
The UUID of the entity.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
email
required
string format: email
permission
required
string
Responses
Section titled “Responses”Access granted to an existing user.
Media typeapplication/json
object
ok
required
boolean
message
required
string
Example
{ "ok": true}An invitation was queued for an email address without an account.
Media typeapplication/json
object
ok
required
boolean
message
required
string
invitation
required
object
id
required
string format: uuid
targetType
required
string
targetId
required
string format: uuid
email
required
string format: email
permission
required
string
canManage
required
boolean
deliveryStatus
required
string
expiresAt
required
string format: date-time
createdAt
required
string format: date-time
Example
{ "ok": true, "invitation": { "targetType": "page", "permission": "view", "deliveryStatus": "pending" }}The API token is missing a required scope: pages:write.
Media typeapplication/json
Structured error returned when the request cannot be completed.
object
error
required
Error details for programmatic handling.
object
code
required
Stable error code.
string
message
required
Human-readable explanation.
string
Examplegenerated
{ "error": { "code": "example", "message": "example" }}