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

# Revoke a share code

> Revoke a share code (`boat snapshot unshare <name> <share-id>` in the CLI). The code stops creating new sandboxes. Sandboxes already created from it keep their own copy. Needs `snapshot.write`.



## OpenAPI

````yaml openapi/boat-v1.yaml DELETE /named-snapshots/{name}/shares/{shareId}
openapi: 3.1.0
info:
  title: Boat Public API v1
  version: 1.0.0
  description: >
    Public JSON API for creating, operating, prompting, observing, and exposing
    sandboxes from backend services, CI jobs, hosted workers, and Boat
    automation products.


    The v1 reference intentionally documents the developer integration surface
    only. Dashboard billing actions are not part of v1.
servers:
  - url: https://boat.dev/api/v1
security:
  - BoatBearerAuth: []
tags:
  - name: Boat
    description: >-
      Unified Boat account, setup, lifecycle, prompting, event history, desktop
      access, and SSH operations.
paths:
  /named-snapshots/{name}/shares/{shareId}:
    parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      - name: shareId
        in: path
        required: true
        schema:
          type: string
        description: Share id, for example `shr_...`.
    delete:
      tags:
        - Boat
      summary: Revoke a share code
      description: >-
        Revoke a share code (`boat snapshot unshare <name> <share-id>` in the
        CLI). The code stops creating new sandboxes. Sandboxes already created
        from it keep their own copy. Needs `snapshot.write`.
      operationId: revokeSnapshotShare
      responses:
        '200':
          description: Revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamedSnapshotShareRevokedResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    NamedSnapshotShareRevokedResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessBase'
        - type: object
          required:
            - name
            - share
          properties:
            type:
              type: string
              const: snapshot.share.revoked
            name:
              type: string
            share:
              $ref: '#/components/schemas/NamedSnapshotShare'
    SuccessBase:
      type: object
      required:
        - ok
        - type
      properties:
        ok:
          type: boolean
          examples:
            - true
        type:
          type: string
          description: Stable success envelope discriminator added by v1.
    NamedSnapshotShare:
      type: object
      description: >-
        A share code for a named snapshot. Any Boat account that holds the code
        can create a sandbox from the snapshot. Boat stores only a hash of the
        code. The full code is in the create response only.
      required:
        - id
        - codePrefix
        - status
        - useCount
        - lastUsedAt
        - revokedAt
        - createdAt
      properties:
        id:
          type: string
          description: Share id, for example `shr_...`. Pass it to revoke the code.
        codePrefix:
          type: string
          description: >-
            The first characters of the code, for example `bsh_xxxxxxxx`. Use it
            to tell codes apart.
        status:
          type: string
          enum:
            - active
            - revoked
        useCount:
          type: integer
          description: Number of sandboxes created with this code.
        lastUsedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When a sandbox was last created with this code. null if never.
        revokedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the code was revoked. null while active.
        createdAt:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - ok
        - type
        - status
        - code
        - message
        - error
        - requestId
      properties:
        ok:
          type: boolean
          examples:
            - false
        type:
          type: string
          examples:
            - sandbox.error
        status:
          type: integer
          examples:
            - 409
        code:
          type: string
          examples:
            - provider_not_configured
        message:
          type: string
          examples:
            - Prompting is locked until Codex is configured on the Agents page.
        requestId:
          type: string
          examples:
            - req_01HX...
        error:
          type: object
          required:
            - code
            - message
            - status
          properties:
            code:
              type: string
            message:
              type: string
            status:
              type: integer
            details:
              type: object
              additionalProperties: true
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            unauthorized:
              value:
                ok: false
                type: sandbox.error
                status: 401
                code: unauthorized
                message: Unauthorized
                error:
                  code: unauthorized
                  message: Unauthorized
                  status: 401
                requestId: req_01HX...
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BoatBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sandbox_api_key
      description: >-
        Boat bearer token in the form `boat_...`. Service API keys authenticate
        sandbox operations.

````

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