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

# Initiate upload

> Initiate a resumable upload by registering an H&E slide's filename, size, and content type, and receive a signed GCS URL to PUT the slide bytes to.



## OpenAPI

````yaml POST /uploads
openapi: 3.1.0
info:
  title: Strand AI Platform API
  version: v1
  description: >-
    REST surface for uploading WSIs, submitting Lattice inference jobs, and
    streaming results. All endpoints require an API key or Strand AI OAuth
    access token in the `Authorization: Bearer` header.
servers:
  - url: https://app.strandai.com/api/v1
    description: Production
security:
  - ApiKey: []
  - OAuth2: []
paths:
  /uploads:
    post:
      summary: Initiate a resumable upload
      description: >-
        Creates an organization-bound GCS resumable session. Slides must be
        de-identified before upload. Automated slide de-identification is off by
        default and runs only when enabled for the organization. It does not
        determine whether a slide satisfies HIPAA or any other legal
        de-identification standard, and it does not inspect or remove
        identifiers in tissue pixels or filenames. PUT the declared bytes to
        `uploadUrl`; when GCS finalizes the object, the platform automatically
        starts ingest preprocessing. There is no client finalize call. Poll `GET
        /uploads/{id}` until the sample leaves `uploading`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - filename
                - fileSize
                - contentType
              properties:
                filename:
                  type: string
                fileSize:
                  type: integer
                contentType:
                  type: string
                contentSha256:
                  type: string
                  pattern: ^[0-9a-f]{64}$
                  description: >-
                    Optional client-computed SHA-256. On a match within the
                    calling organization, the response returns the existing
                    upload and skips byte transfer.
                modality:
                  type: string
                  enum:
                    - H&E
                    - IHC
                  default: H&E
                  description: >-
                    Explicit slide modality. Native IHC samples cannot run
                    Lattice.
                stainTarget:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: Optional stain target for native IHC.
                autoSegment:
                  type: boolean
                  description: >-
                    Opt out of automatic cell segmentation for this upload.
                    Defaults to the organization's `autoSegmentDefault` (true
                    unless changed). When false, the slide is ingested and
                    rendered but no segmentation job runs; marker runs still
                    work but without cell-level readouts until segmented.
                mpp:
                  oneOf:
                    - type: number
                      exclusiveMinimum: 0
                      maximum: 100
                    - type: object
                      additionalProperties: false
                      required:
                        - x
                        - 'y'
                      properties:
                        x:
                          type: number
                          exclusiveMinimum: 0
                          maximum: 100
                        'y':
                          type: number
                          exclusiveMinimum: 0
                          maximum: 100
                  description: >-
                    Optional user-reported microns per pixel, for callers that
                    already know their slide's scale. Slides are isotropic: pass
                    a number, or an { x, y } object whose axes are equal
                    (anisotropic input is rejected). Persisted on the sample at
                    creation and takes precedence over the slide's own
                    calibrated value, so `POST /predict` works as soon as
                    preprocessing finishes — no follow-up `PATCH /samples/{id}`
                    needed. Ignored when `contentSha256` deduplicates to an
                    existing sample (that sample's scale stands).
      responses:
        '200':
          description: Resumable upload URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadCreated'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UploadCreated:
      type: object
      required:
        - uploadId
        - gcsPath
        - existing
      properties:
        uploadId:
          type: string
          format: uuid
        uploadUrl:
          type: string
          description: >-
            Resumable upload URL. Present for a new upload; omitted when
            `existing` is true.
        gcsPath:
          type: string
        existing:
          type: boolean
          description: >-
            True when `contentSha256` matched an existing active upload in the
            same organization.
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        reason:
          type: string
          nullable: true
        required:
          type: integer
          nullable: true
        retryAfterSeconds:
          type: integer
          nullable: true
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: sk-strand-XXXXXXXXXXXXXXXXXXXXXXXX
    OAuth2:
      type: oauth2
      description: >-
        Strand AI authorization-code flow with S256 PKCE, explicit organization
        consent, and RFC 8707 resource binding.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.strandai.com/oauth2/auth
          tokenUrl: https://auth.strandai.com/oauth2/token
          scopes:
            samples:read: Read slide metadata and estimates
            samples:write: Upload and change slides
            jobs:read: Read run status
            jobs:write: Start, export, or cancel runs
            results:read: Read and download results
            credits:spend: Reserve and spend organization credits

````

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