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

# Share a port publicly

> A link anyone can open to one port of the box, no sign-in. One link per box and port: asking again returns the same link. Opening it wakes an asleep box. Answers 402 `plan_limit` when the org's plan has no public links, and 400 `invalid_request` when the port is one tesser reserves, or the org runs its boxes in its own AWS or behind its own gateway, or public links are turned off for it.



## OpenAPI

````yaml /openapi.yaml post /v1/{orgId}/boxes/{boxId}/share/public
openapi: 3.1.0
info:
  title: Tesser API
  version: '1'
  description: >-
    Boxes as plain sandboxes: create one, SSH in, put it to sleep, fork it,
    remove it.
servers:
  - url: https://api.tesser.sh
security:
  - bearer: []
tags:
  - name: Boxes
  - name: Account
paths:
  /v1/{orgId}/boxes/{boxId}/share/public:
    post:
      tags:
        - Boxes
      summary: Share a port publicly
      description: >-
        A link anyone can open to one port of the box, no sign-in. One link per
        box and port: asking again returns the same link. Opening it wakes an
        asleep box. Answers 402 `plan_limit` when the org's plan has no public
        links, and 400 `invalid_request` when the port is one tesser reserves,
        or the org runs its boxes in its own AWS or behind its own gateway, or
        public links are turned off for it.
      operationId: Boxes.sharePublic
      parameters:
        - name: orgId
          in: path
          schema:
            type: string
          required: true
          description: >-
            Your organization id, `org_` followed by 12 hex digits. `tesser org`
            prints it.
        - name: boxId
          in: path
          schema:
            type: string
          required: true
          description: The box's id, as returned when it was created.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SharePublicRequest'
        required: true
      responses:
        '200':
          description: SharePublicResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SharePublicResponse'
        '400':
          description: >-
            - `invalid_request`: The request is well-formed but not allowed as
            sent; `message` says why.

            - A path, query or body that does not match this spec gets a bare
            400 with no body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: '- `unauthorized`: The API token is missing, expired or revoked.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: |-
            - `credit_exhausted`: The org is out of credit.
            - `plan_limit`: The org's plan does not allow this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: |-
            - `forbidden`: The token cannot do this to this box.
            - `box_limit`: The org has as many boxes as its plan allows.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: |-
            - `box_not_found`: No box with that id in the org.
            - `org_not_found`: No such org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: |-
            - `box_asleep_waking`: The box is waking. Retry.
            - `box_unbootable`: The box cannot boot; `message` says why.
            - `box_moving`: The box is moving to another machine. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            - `request_interrupted`: The request was cut off mid-way. Retry.

            - `overloaded`: Busy. Retry.

            - `fleet_full`: No capacity for this size right now. Retry, or pick
            another size.

            - `vcpu_quota`: No capacity for this size right now. Retry, or pick
            another size.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    SharePublicRequest:
      type: object
      properties:
        port:
          type: integer
          minimum: 1
          maximum: 65535
          description: >-
            The port to serve: any port the box listens on, except tesser's own
            14651-14655.
        ttlSeconds:
          type: integer
          description: >-
            How long the link works, in whole seconds, at most 30 days. Defaults
            to 7 days for a new link; on an existing link it restarts the clock,
            and leaving it out keeps the old expiry.
      required:
        - port
    SharePublicResponse:
      type: object
      properties:
        url:
          type: string
          description: >-
            The link, `https://<box>-<secret>.tesser.website/`. Anyone with it
            can open the port, no sign-in.
        port:
          type: integer
          description: The port the link serves.
        expiresAt:
          type: string
          description: When the link stops working, ISO 8601.
      required:
        - url
        - port
        - expiresAt
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable and machine-readable; branch on this.
            message:
              type: string
              description: What went wrong, for a person.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: An org API token, from `tesser member token create`.

````

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