Set who can read an email
PUT /emails/{uuid}/access_grants
/emails/{uuid}/access_grantsReplaces, for one email or for all the emails of a record in the owner's mailbox, the complete list of members and teams who get full read access (body, attachments, participants). Whoever is not in the lists loses the access this grant gave them.
When to use: When the owner of a mailbox wants a colleague or a team to read a specific conversation, or the whole email history of a contact, company or opportunity, for example to hand a customer over.
When not to use: To share a whole mailbox, or to change what the rest of the account sees of it, the owner uses Email and calendar settings in the app: that is not available through the API. A grant never shows more than the owner sees: the blocklist, protected list and hidden recipients still apply. To only see the current sharing, use get_email_access_grants. Only the owner of a mailbox that holds the email can see or change who it is shared with; for anyone else it is a 404, exactly as if the email did not exist.
Side effects: The people and teams in the lists can read the email (or the emails of the record, now and, for scope record, those that arrive later with the same addresses or domains) from that moment, with full read access, and lose it when they are left out. Nobody is notified. The change is recorded in the sharing audit of the mailbox with counts only, under the person who made the call; the current code does not record the "via Maia" mark for it. It does not touch who can send from the mailbox. scope message applies to this email in every mailbox of the owner that holds it; scope record applies to the record the request was made through (its addresses or domains as they are today, plus the ones not yet covered when include_new is true).
Permissions: Requires a CRM seat and the crm.contacts_companies.write capability. Only the owner of a mailbox that holds the email can change who it is shared with; for anyone else it is a 404, exactly as if the email did not exist. A user who can only read the CRM can see the sharing with get_email_access_grants but not change it. For the emails of an opportunity the user also needs read access to the pipeline of the opportunity. Recipients must be active members with a CRM seat, or teams of the account.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the email. Get it from list_emails.
uuidQuery Parameters
UUID of the contact through which you reached the email (the one you listed it from). Send exactly one of contact, company and opportunity; an email that is not part of that record is a 404.
uuidUUID of the company through which you reached the email (the one you listed it from). Send exactly one of contact, company and opportunity; an email that is not part of that record is a 404.
uuidUUID of the opportunity through which you reached the email (the one you listed it from). Send exactly one of contact, company and opportunity; an email that is not part of that record is a 404.
uuidThe updated EmailAccessGrants resource
TypeScript Definitions
Use the request body type in TypeScript.
Who the owner of a mailbox shares one email, or the emails of the record it was reached through, with (fase 5). Generated from the proposal by fase-5/tools/gen_emails_api.py; the texts are the proposal's. Only the owner of a mailbox that holds the email reaches it; for anyone else the use case answers the same 404 as a missing email.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X PUT "https://api.easymailing.com/emails/b3c1d8e4-52a7-4f19-8e06-7d9a2c4b1f35/access_grants?contact=3a9e1f52-6c47-4d08-b1a3-9e2d7c5f8a40&company=7f3c2a10-5b8e-4d1a-9c2e-3a6f0b9d4e21&opportunity=5d8a3c16-9e2b-4f70-a1c4-6b0e7d3f2a95" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "scope": "message", "users": [ "e519232e-7dcb-41b1-a0b3-44779018b164" ], "teams": [ "6c34d4a2-82d7-47eb-ae09-5fb7d414df64" ], "include_new": false }'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "mailbox": "ba8efdb9-b4c4-43cf-965e-5da7040913a7", "record_type": "contact", "message": { "users": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "email": "string", "avatar_url": "string", "can_send": true, "read_full": true } ], "teams": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "member_count": 0, "can_send": true, "read_full": true } ] }, "record": { "users": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "email": "string", "avatar_url": "string", "can_send": true, "read_full": true } ], "teams": [ { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "member_count": 0, "can_send": true, "read_full": true } ], "value_kind": "address", "not_included": [ "string" ] }}