> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tembo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Share

> Share with a person, a team or the whole organization. Each member then acts only as far as their role allows. Requires Write on it.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public post /v1/sessions/{sessionId}/sharing
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/sessions/{sessionId}/sharing:
    post:
      tags:
        - Sessions
      summary: Share
      description: >-
        Share with a person, a team or the whole organization. Each member then
        acts only as far as their role allows. Requires Write on it.
      operationId: createSessionShare
      parameters:
        - schema:
            type: string
          in: path
          name: sessionId
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      const: user
                      description: One active member.
                    id:
                      type: string
                      minLength: 1
                      description: User ID of an active member.
                  required:
                    - type
                    - id
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: team
                      description: Every member of a team.
                    id:
                      type: string
                      minLength: 1
                      description: Team ID in this organization.
                  required:
                    - type
                    - id
                  additionalProperties: false
                - type: object
                  properties:
                    type:
                      type: string
                      const: organization
                      description: Everyone in the organization.
                  required:
                    - type
                  additionalProperties: false
              description: >-
                Who to share with. Each member then acts only as far as their
                role allows.
      responses:
        '200':
          description: Share
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  audience:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - user
                          - team
                          - organization
                      id:
                        type: string
                      name:
                        type:
                          - string
                          - 'null'
                    required:
                      - type
                      - id
                      - name
                    additionalProperties: false
                  createdAt:
                    type: string
                required:
                  - id
                  - audience
                  - createdAt
                additionalProperties: false
        '400':
          description: Validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
                additionalProperties: false
        '403':
          description: Validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |
            import Tembo from '@tembo-io/sdk';

            const client = new Tembo();

            const share = await client.sessions.shares.create('sessionId', {
              type: 'user',
              id: 'x',
            });
        - lang: rust
          label: Rust SDK
          source: |
            use tembo_rs::*;

            let client = Tembo::from_env()?;

            let response = client
                .sessions()
                .shares()
                .create(
                    "sessionId",
                    SharesCreateBody::SharesCreateBodyVariant1(SharesCreateBodyVariant1::new("user", "x")),
                )
                .send()
                .await?;
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.