Skip to Content

Grant a member access to a mailbox

Shares a mailbox with an organization member and returns the grant with status 201.

POST
/v1/mailboxes/{id}/grants

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^mbx_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
userId*UserId
Match^user_[0-9a-hjkmnp-tv-z]{16,24}$
role*MailboxGrantRole
Value in"admin""collaborator""viewer"

Response Body

Success

application/json
  1. response
id*MailboxGrantId
Match^mbxacl_[0-9a-hjkmnp-tv-z]{16,24}$
actor*
permissions*array<>
createdAt*string
Example Request
import { 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"
}

Related documentation