Skip to content
API Reference
Sharing

Messages sharing

Messages sharing in Prism / Objects / Messages — Micro TypeScript reference.

Reference for TypeScript SDK 0.14.0.

Release source · Setup and client configuration

update

PUT /v2/prism/{teamId}/message/{messageId}/grant

client.prism.objects.messages.grant.update(messageID, { ...params }) -> GrantUpdateResponse

Update grant

const grant =
  await client.prism.objects.messages.grant.update(
    '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  );

get

GET /v2/prism/{teamId}/message/{messageId}/grant

client.prism.objects.messages.grant.get(messageID, { ...params }) -> GrantGetResponse

Get grant

const grant = await client.prism.objects.messages.grant.get(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);

Parameter and response types

These declarations show the request parameters and response shapes used by the methods above.

GrantUpdateResponse

Source

/**
 * The grants on a record. For `message`, also carries the entity ids of everyone
 * on the message, resolved from its address headers when the grant was written.
 * The id arrays are read-only and are null when participant resolution was
 * unavailable (for example the mailbox had no Gmail token at the time).
 */
export interface GrantUpdateResponse {
  contact_ids?: Array<string> | null;

  group_id?: { [key: string]: 'a' | 'r' | 'w' };

  identity_ids?: Array<string> | null;

  organization_ids?: Array<string> | null;

  /**
   * How much of the record the grant exposes. `metadata` shares only the record's
   * headers and participants; `full` shares its contents. Currently recorded on the
   * access row and returned on read — it is not yet enforced by the read path.
   * Applies to `message` grants; ignored for other object types.
   */
  share_level?: 'metadata' | 'full';

  team_id?: { [key: string]: 'a' | 'r' | 'w' };

  user_id?: { [key: string]: 'a' | 'r' | 'w' };
}

GrantGetResponse

Source

/**
 * The grants on a record. For `message`, also carries the entity ids of everyone
 * on the message, resolved from its address headers when the grant was written.
 * The id arrays are read-only and are null when participant resolution was
 * unavailable (for example the mailbox had no Gmail token at the time).
 */
export interface GrantGetResponse {
  contact_ids?: Array<string> | null;

  group_id?: { [key: string]: 'a' | 'r' | 'w' };

  identity_ids?: Array<string> | null;

  organization_ids?: Array<string> | null;

  /**
   * How much of the record the grant exposes. `metadata` shares only the record's
   * headers and participants; `full` shares its contents. Currently recorded on the
   * access row and returned on read — it is not yet enforced by the read path.
   * Applies to `message` grants; ignored for other object types.
   */
  share_level?: 'metadata' | 'full';

  team_id?: { [key: string]: 'a' | 'r' | 'w' };

  user_id?: { [key: string]: 'a' | 'r' | 'w' };
}

GrantUpdateParams

Source

export interface GrantUpdateParams {
  /**
   * Path param
   */
  teamId?: string;

  /**
   * Body param: How much of the record the grant exposes. `metadata` shares only the
   * record's headers and participants; `full` shares its contents. Currently
   * recorded on the access row and returned on read — it is not yet enforced by the
   * read path. Applies to `message` grants; ignored for other object types.
   */
  share_level?: 'metadata' | 'full';

  /**
   * Body param
   */
  team_group_id?: Array<{ [key: string]: 'a' | 'r' | 'w' }>;

  /**
   * Body param
   */
  team_id?: { [key: string]: 'a' | 'r' | 'w' };

  /**
   * Body param
   */
  user_id?: Array<{ [key: string]: 'a' | 'r' | 'w' }>;

  /**
   * Header param: A unique key (UUID or any opaque string up to 255 chars) for an
   * authenticated POST, PUT, or PATCH request. The server retains the initial claim
   * for 24 hours and replays a completed non-5xx response only when the method,
   * path, and request body all match. Reusing a non-expired key with a different
   * method, path, or body returns 409 `idempotency_key_mismatch`; reusing it after
   * expiry returns 409 `idempotency_key_stale`, so use a new key. Replays include
   * the `idempotent-replay: true` response header.
   */
  'Idempotency-Key'?: string;
}

GrantGetParams

Source

export interface GrantGetParams {
  teamId?: string;
}

Grant

Source

export declare namespace Grant {
  export {
    type GrantUpdateResponse as GrantUpdateResponse,
    type GrantGetResponse as GrantGetResponse,
    type GrantUpdateParams as GrantUpdateParams,
    type GrantGetParams as GrantGetParams,
  };
}
micro.so