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

# Create an artifact

> Create a typed file artifact for a session from inline content or an uploaded asset.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public post /v1/artifacts
openapi: 3.1.0
info:
  title: Tembo Public API
  description: Public API Endpoints for Tembo
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/artifacts:
    post:
      tags:
        - Artifacts
      summary: Create an artifact
      description: >-
        Create a typed file artifact for a session from inline content or an
        uploaded asset.
      operationId: createArtifact
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  maxLength: 200
                  description: Human-readable title for the artifact.
                description:
                  type: string
                  minLength: 1
                  maxLength: 2000
                  description: Short description of what the artifact shows.
                category:
                  type: string
                  enum:
                    - code_walkthrough
                    - bug_report
                    - incident_report
                    - license_audit
                    - data_flow_map
                    - security_findings
                    - cost_map
                    - ux_variations
                    - architecture_map
                    - migration_summary
                    - release_checklist
                    - shipped_summary
                    - rollout_plan
                    - diagram
                    - chart
                    - dashboard
                    - timeline
                    - comparison
                    - report
                  description: Artifact category for display and filtering.
                output:
                  oneOf:
                    - type: object
                      properties:
                        type:
                          type: string
                          const: html
                        content:
                          type: string
                          minLength: 1
                          description: >-
                            Complete self-contained HTML document. Inline CSS
                            and JavaScript are allowed. Do not depend on
                            external network assets. Must be at most 5242880
                            bytes after UTF-8 encoding.
                        fileName:
                          type: string
                          minLength: 1
                          maxLength: 255
                          description: >-
                            Optional stored filename. The extension is
                            normalized.
                      required:
                        - type
                        - content
                      additionalProperties: false
                      description: >-
                        Complete self-contained HTML document. Inline CSS and
                        JavaScript are allowed. Do not depend on external
                        network assets.
                    - type: object
                      properties:
                        type:
                          type: string
                          const: markdown
                        content:
                          type: string
                          minLength: 1
                          description: >-
                            Markdown content for a readable report, checklist,
                            walkthrough, or notes artifact. Must be at most
                            5242880 bytes after UTF-8 encoding.
                        fileName:
                          type: string
                          minLength: 1
                          maxLength: 255
                          description: >-
                            Optional stored filename. The extension is
                            normalized.
                      required:
                        - type
                        - content
                      additionalProperties: false
                      description: >-
                        Markdown content for a readable report, checklist,
                        walkthrough, or notes artifact.
                    - type: object
                      properties:
                        type:
                          type: string
                          const: json
                        content:
                          type: string
                          minLength: 1
                          description: >-
                            Serialized JSON content for structured data,
                            diagnostics, or machine-readable findings. Must be
                            at most 5242880 bytes after UTF-8 encoding.
                        fileName:
                          type: string
                          minLength: 1
                          maxLength: 255
                          description: >-
                            Optional stored filename. The extension is
                            normalized.
                      required:
                        - type
                        - content
                      additionalProperties: false
                      description: >-
                        Serialized JSON content for structured data,
                        diagnostics, or machine-readable findings.
                    - type: object
                      properties:
                        type:
                          type: string
                          const: csv
                        content:
                          type: string
                          minLength: 1
                          description: >-
                            CSV content for audits, tables, inventories,
                            reports, and spreadsheet-friendly exports. Must be
                            at most 5242880 bytes after UTF-8 encoding.
                        fileName:
                          type: string
                          minLength: 1
                          maxLength: 255
                          description: >-
                            Optional stored filename. The extension is
                            normalized.
                      required:
                        - type
                        - content
                      additionalProperties: false
                      description: >-
                        CSV content for audits, tables, inventories, reports,
                        and spreadsheet-friendly exports.
                    - type: object
                      properties:
                        type:
                          type: string
                          const: asset
                        assetId:
                          type: string
                          format: uuid
                          description: >-
                            Existing Tembo asset ID returned by uploadFile or
                            completeFileUpload.
                        fileName:
                          type: string
                          minLength: 1
                          maxLength: 255
                          description: Optional display filename for the uploaded asset.
                      required:
                        - type
                        - assetId
                      additionalProperties: false
                      description: >-
                        Attach title, category, and artifact metadata to an
                        already uploaded screenshot, image, video, audio file,
                        PDF, or other binary asset.
                  description: The artifact output payload. Pick exactly one type.
                relatedPullRequestUrls:
                  type: array
                  items:
                    type: string
                    format: uri
                  maxItems: 20
                  description: Optional PR URLs related to this artifact.
                sessionId:
                  type: string
                  format: uuid
              required:
                - title
                - output
                - sessionId
              additionalProperties: false
      responses:
        '201':
          description: Create an artifact
          content:
            application/json:
              schema:
                type: object
                properties:
                  createdAt:
                    type: string
                    format: date-time
                  id:
                    type: string
                    format: uuid
                  sessionId:
                    type: string
                    format: uuid
                  type:
                    type: string
                    enum:
                      - PullRequest
                      - ToolCall
                      - Plan
                      - Response
                      - File
                      - Service
                      - Source
                    default: PullRequest
                  updatedAt:
                    type: string
                    format: date-time
                  assetId:
                    type:
                      - string
                      - 'null'
                    format: uuid
                  assetUrl:
                    type:
                      - string
                      - 'null'
                    format: uri
                  category:
                    type:
                      - string
                      - 'null'
                    enum:
                      - code_walkthrough
                      - bug_report
                      - incident_report
                      - license_audit
                      - data_flow_map
                      - security_findings
                      - cost_map
                      - ux_variations
                      - architecture_map
                      - migration_summary
                      - release_checklist
                      - shipped_summary
                      - rollout_plan
                      - diagram
                      - chart
                      - dashboard
                      - timeline
                      - comparison
                      - report
                      - null
                  content:
                    type: string
                  contentType:
                    type:
                      - string
                      - 'null'
                  description:
                    type:
                      - string
                      - 'null'
                  fileKind:
                    type: string
                    enum:
                      - image
                      - video
                      - audio
                      - html
                      - markdown
                      - text
                      - file
                  fileName:
                    type:
                      - string
                      - 'null'
                  outputType:
                    type:
                      - string
                      - 'null'
                    enum:
                      - html
                      - markdown
                      - json
                      - csv
                      - asset
                      - null
                  relatedPullRequestUrls:
                    type: array
                    items:
                      type: string
                      format: uri
                  runtime:
                    type:
                      - object
                      - 'null'
                    properties:
                      hostname:
                        type:
                          - string
                          - 'null'
                      serviceName:
                        type:
                          - string
                          - 'null'
                      serviceType:
                        type:
                          - string
                          - 'null'
                    required:
                      - hostname
                      - serviceName
                      - serviceType
                    additionalProperties: false
                  servicePort:
                    type:
                      - integer
                      - 'null'
                    minimum: 1
                    maximum: 65535
                  serviceUrl:
                    type:
                      - string
                      - 'null'
                    format: uri
                  sizeBytes:
                    type:
                      - integer
                      - 'null'
                    minimum: 0
                  sourceUrl:
                    type:
                      - string
                      - 'null'
                    format: uri
                  title:
                    type: string
                required:
                  - createdAt
                  - id
                  - sessionId
                  - type
                  - updatedAt
                  - assetId
                  - assetUrl
                  - category
                  - content
                  - contentType
                  - description
                  - fileKind
                  - fileName
                  - outputType
                  - relatedPullRequestUrls
                  - runtime
                  - servicePort
                  - serviceUrl
                  - sizeBytes
                  - sourceUrl
                  - title
                additionalProperties: false
        '400':
          description: Validation error or missing resource scope
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Artifact, session, or backing asset not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Artifact operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````