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

# Update a file or canvas's sharing

> Replaces the sharing of one file or canvas. Only the chat's owner or the person who added the item can change it. Send the `revision` you read as `expectedRevision` so a change someone else saved meanwhile is refused with 409 instead of overwritten. Links don't expire; turning the public link off kills it for good.




## OpenAPI

````yaml /openapi/chat.yaml post /artifact-shares
openapi: 3.1.0
info:
  title: Connie Chat API
  version: 1.0.0
  description: >
    Endpoints the Connie web app uses for chat. They authenticate with your
    signed-in browser session — see
    https://docs.connie.ai/api-reference/authentication. These are the app's own
    endpoints and can change when the app changes.
servers:
  - url: https://connie.ai/api
security:
  - sessionCookie: []
tags:
  - name: Chats
    description: List, create, rename, pin and delete chats.
  - name: Turns
    description: Send a message to Connie and stop a running reply.
  - name: Chat messages
    description: Read the saved messages of a chat.
  - name: Artifacts
    description: Workflows, tables, canvases, analytics views and apps attached to a chat.
  - name: Sharing
    description: >-
      Share a chat or a single file or canvas, and read a chat through its
      public link.
paths:
  /artifact-shares:
    post:
      tags:
        - Sharing
      summary: Update a file or canvas's sharing
      description: >
        Replaces the sharing of one file or canvas. Only the chat's owner or the
        person who added the item can change it. Send the `revision` you read as
        `expectedRevision` so a change someone else saved meanwhile is refused
        with 409 instead of overwritten. Links don't expire; turning the public
        link off kills it for good.
      operationId: updateArtifactSharing
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workspaceId
                - sourceType
                - sourceId
                - internalAccess
                - externalAccess
              properties:
                workspaceId:
                  type: string
                  format: uuid
                  description: The chat's workspace.
                sourceType:
                  type: string
                  enum:
                    - file
                    - canvas
                sourceId:
                  type: string
                  format: uuid
                internalAccess:
                  type: string
                  enum:
                    - chat
                    - workspace
                  description: >-
                    `chat` = people who can open the chat; `workspace` =
                    everyone in the workspace.
                members:
                  type: array
                  maxItems: 200
                  description: >-
                    Extra workspace members who can open it. Replaces the
                    current list.
                  items:
                    type: string
                    format: uuid
                externalAccess:
                  type: string
                  enum:
                    - invited
                    - anyone
                  description: '`anyone` turns on the public link.'
                password:
                  type:
                    - string
                    - 'null'
                  minLength: 10
                  maxLength: 256
                  description: >-
                    Protects the public link. Omit to keep the current password,
                    null to remove it. Needs `externalAccess` set to `anyone`.
                expectedRevision:
                  type:
                    - integer
                    - 'null'
                  description: >-
                    The `revision` you read, or null if the item had never been
                    shared.
      responses:
        '200':
          description: The saved settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArtifactShare'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Someone else changed this sharing after you read it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ArtifactShare:
      type: object
      properties:
        canManage:
          type: boolean
          description: True when you can change this sharing.
        ownerId:
          type:
            - string
            - 'null'
          format: uuid
          description: The chat's owner.
        internalAccess:
          type: string
          enum:
            - chat
            - workspace
        members:
          type: array
          items:
            type: string
            format: uuid
        externalAccess:
          type: string
          enum:
            - invited
            - anyone
        hasPassword:
          type: boolean
        privatePath:
          type: string
          description: >-
            Path of the in-app link for teammates, such as `/artifacts/<id>`.
            Prefix it with https://connie.ai.
        publicPath:
          type:
            - string
            - 'null'
          description: >-
            Path of the public link. Shown only to people who can change the
            sharing.
        revision:
          type:
            - integer
            - 'null'
          description: Pass back as `expectedRevision` when you update.
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: Machine-readable code, when there is one.
      required:
        - error
  responses:
    BadRequest:
      description: A required field is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: >-
        No valid session (`UNAUTHORIZED`), or the session has expired
        (`SESSION_EXPIRED`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: You aren't a member of the workspace or aren't allowed to do this.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found, or you can't open it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: header
      name: Cookie
      description: >-
        The full Cookie header copied from a signed-in connie.ai browser
        request. See the Authentication page.

````

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