Grant a member access to a mailbox
Shares a mailbox with an organization member and returns the grant with status 201.
POST
Shares a mailbox with an organization member and returns the grant with status 201. The member must already belong to the organization. A member who already holds a grant conflicts rather than being rewritten: change an existing grant with PATCH /v1/mailboxes/{id}/grants/{grantId}, so a grant is never widened as a side effect of granting. List the current grants with GET /v1/mailboxes/{id}/grants.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
userId*UserIdMatch
^user_[0-9a-hjkmnp-tv-z]{16,24}$role*MailboxGrantRoleValue in
"admin""collaborator""viewer"Success
application/json- response
id*MailboxGrantIdMatch
^mbxacl_[0-9a-hjkmnp-tv-z]{16,24}$actor*permissions*array<>createdAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.mailboxes.createGrant({
"id": "example",
"userId": "example",
"role": "admin"
});Example Response
{
"id": "string",
"actor": {
"kind": "user",
"id": "string",
"displayName": "string"
},
"permissions": [
"mailbox:read"
],
"createdAt": "string"
}