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

# Create Document File Session

> Authorize an opaque resource ID and create a short-lived revocable session token for viewing the file. No S3 URL is returned.



## OpenAPI

````yaml /api-reference/openapi-v1.json post /document-file-session
openapi: 3.0.0
info:
  title: Artos API
  description: API for document generation, template management, and document organization
  version: 1.0.0
  contact:
    name: Artos Support
    email: internal@artosai.com
servers:
  - url: https://api.artosai.com
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security:
  - bearerAuth: []
paths:
  /document-file-session:
    post:
      tags:
        - Files
      summary: Create Document File Session
      description: >-
        Authorize an opaque resource ID and create a short-lived revocable
        session token for viewing the file. No S3 URL is returned.
      operationId: createDocumentFileSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentFileSessionRequest'
            example:
              resource_id: sourcefile-org-id/documents/protocol.pdf
      responses:
        '200':
          description: Session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentFileSessionResponse'
        '401':
          description: Missing, invalid, or unauthorized Bearer token
        '500':
          description: Document session service is unavailable
components:
  schemas:
    DocumentFileSessionRequest:
      type: object
      properties:
        resource_id:
          type: string
          description: >-
            Opaque file, document, or template resource identifier returned by
            Artos.
      required:
        - resource_id
    DocumentFileSessionResponse:
      type: object
      properties:
        session_token:
          type: string
          description: Short-lived revocable token for the authenticated document stream.
      required:
        - session_token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Okta access-token JWT sent as a Bearer token. The token identifies the
        user and scopes access to the user's organization.

````