ctlsurf Files API

The files API from ctlsurf — 9 operation(s) for files.

GitHub OpenAPI

Operations 10

POST /api/files/upload Upload File #
POST /api/files/request-upload Request Upload Url #
POST /api/files/confirm-upload Confirm Upload #
GET /api/files/{file_id} Get File #
DELETE /api/files/{file_id} Delete File #
GET /api/files/{file_id}/content Get File Content #
GET /api/files/{file_id}/download Download File #
GET /api/files/{file_id}/text Get File Text #
GET /api/files/page/{page_id} List Page Files #
GET /api/files/block/{block_id} List Block Files #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ctlsurf-com:ctlsurf-com-files-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ctlsurf-com-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ctlsurf Com Files API
  version: 0.1.0
  description: 'Operations tagged files across 2 of this provider''s published API definitions: ctlsurf-com-openapi.json, ctlsurf-com-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://app.ctlsurf.com
  description: ctlsurf application host (documented MCP endpoint https://app.ctlsurf.com/api/mcp; spec served at /openapi.json)
tags:
- name: Files
paths:
  /api/files/upload:
    post:
      tags:
      - Files
      summary: Upload File
      description: 'Upload a file to storage.


        Supports images, PDFs, Office documents, text, and email files (EML, EMLX, MSG, MBOX).

        Max file size: 10 MB.'
      operationId: upload_file_api_files_upload_post
      security:
      - HTTPBearer: []
      parameters:
      - name: page_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          description: Associate with a page
          title: Page Id
        description: Associate with a page
      - name: block_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          description: Associate with a block
          title: Block Id
        description: Associate with a block
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_file_api_files_upload_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/files/request-upload:
    post:
      tags:
      - Files
      summary: Request Upload Url
      description: 'Get a presigned URL for direct file upload.


        This allows clients to upload files directly to S3/MinIO without

        passing the file data through the API server, saving bandwidth and tokens.


        Flow:

        1. Call this endpoint to get upload_url and file_id

        2. PUT the file directly to upload_url using curl or similar

        3. Call /files/confirm-upload to create the database record'
      operationId: request_upload_url_api_files_request_upload_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadUrlRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadUrlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/files/confirm-upload:
    post:
      tags:
      - Files
      summary: Confirm Upload
      description: 'Confirm a completed upload and create the database record.


        Call this after successfully uploading a file to the presigned URL.

        Verifies the file exists in storage before creating the record.

        Optionally creates a file block on the specified page.'
      operationId: confirm_upload_api_files_confirm_upload_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmUploadRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfirmUploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/files/{file_id}:
    get:
      tags:
      - Files
      summary: Get File
      description: Get file metadata by ID.
      operationId: get_file_api_files__file_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: File Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Files
      summary: Delete File
      description: Delete a file.
      operationId: delete_file_api_files__file_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: File Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/files/{file_id}/content:
    get:
      tags:
      - Files
      summary: Get File Content
      description: Get raw file content. Accepts token via header or query param for img/iframe tags.
      operationId: get_file_content_api_files__file_id__content_get
      security:
      - HTTPBearer: []
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: File Id
      - name: token
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: JWT token for img/iframe requests
          title: Token
        description: JWT token for img/iframe requests
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/files/{file_id}/download:
    get:
      tags:
      - Files
      summary: Download File
      description: Download through a fresh access check; don't issue shareable storage URLs.
      operationId: download_file_api_files__file_id__download_get
      security:
      - HTTPBearer: []
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: File Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/files/{file_id}/text:
    get:
      tags:
      - Files
      summary: Get File Text
      description: Get extracted text content from a file.
      operationId: get_file_text_api_files__file_id__text_get
      security:
      - HTTPBearer: []
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: File Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileTextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/files/page/{page_id}:
    get:
      tags:
      - Files
      summary: List Page Files
      description: List all files associated with a page.
      operationId: list_page_files_api_files_page__page_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: page_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Page Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/files/block/{block_id}:
    get:
      tags:
      - Files
      summary: List Block Files
      description: List all files associated with a block.
      operationId: list_block_files_api_files_block__block_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: block_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Block Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ConfirmUploadRequest:
      properties:
        file_id:
          type: string
          format: uuid
          title: File Id
        s3_key:
          type: string
          title: S3 Key
        filename:
          type: string
          title: Filename
        mime_type:
          type: string
          title: Mime Type
        page_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Page Id
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        create_block:
          type: boolean
          title: Create Block
          default: true
      type: object
      required:
      - file_id
      - s3_key
      - filename
      - mime_type
      title: ConfirmUploadRequest
      description: Request to confirm a completed upload.
    ConfirmUploadResponse:
      properties:
        file:
          $ref: '#/components/schemas/FileResponse'
        block:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Block
        message:
          type: string
          title: Message
          default: Upload confirmed successfully
      type: object
      required:
      - file
      title: ConfirmUploadResponse
      description: Response after confirming upload.
    UploadUrlResponse:
      properties:
        file_id:
          type: string
          format: uuid
          title: File Id
        upload_url:
          type: string
          title: Upload Url
        s3_key:
          type: string
          title: S3 Key
        expires_in:
          type: integer
          title: Expires In
          default: 900
        mime_type:
          type: string
          title: Mime Type
        filename:
          type: string
          title: Filename
      type: object
      required:
      - file_id
      - upload_url
      - s3_key
      - mime_type
      - filename
      title: UploadUrlResponse
      description: Response with presigned upload URL.
    Body_upload_file_api_files_upload_post:
      properties:
        file:
          type: string
          format: binary
          title: File
      type: object
      required:
      - file
      title: Body_upload_file_api_files_upload_post
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    FileTextResponse:
      properties:
        file_id:
          type: string
          format: uuid
          title: File Id
        filename:
          type: string
          title: Filename
        mime_type:
          type: string
          title: Mime Type
        text:
          anyOf:
          - type: string
          - type: 'null'
          title: Text
        size_bytes:
          type: integer
          title: Size Bytes
        has_text:
          type: boolean
          title: Has Text
          default: false
      type: object
      required:
      - file_id
      - filename
      - mime_type
      - size_bytes
      title: FileTextResponse
      description: Response for extracted text content.
    FileResponse:
      properties:
        original_filename:
          type: string
          title: Original Filename
        mime_type:
          type: string
          title: Mime Type
        size_bytes:
          type: integer
          title: Size Bytes
        width:
          anyOf:
          - type: integer
          - type: 'null'
          title: Width
        height:
          anyOf:
          - type: integer
          - type: 'null'
          title: Height
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          type: string
          format: uuid
          title: User Id
        page_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Page Id
        block_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Block Id
        filename:
          type: string
          title: Filename
        s3_key:
          type: string
          title: S3 Key
        created_at:
          type: string
          format: date-time
          title: Created At
        url:
          anyOf:
          - type: string
          - type: 'null'
          title: Url
        has_extracted_text:
          type: boolean
          title: Has Extracted Text
          default: false
      type: object
      required:
      - original_filename
      - mime_type
      - size_bytes
      - id
      - user_id
      - filename
      - s3_key
      - created_at
      title: FileResponse
      description: Schema for file response.
    UploadUrlRequest:
      properties:
        filename:
          type: string
          title: Filename
        mime_type:
          type: string
          title: Mime Type
        page_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Page Id
      type: object
      required:
      - filename
      - mime_type
      title: UploadUrlRequest
      description: Request for presigned upload URL.
    FileUploadResponse:
      properties:
        file:
          $ref: '#/components/schemas/FileResponse'
        message:
          type: string
          title: Message
          default: File uploaded successfully
      type: object
      required:
      - file
      title: FileUploadResponse
      description: Response after successful file upload.
    FileListResponse:
      properties:
        files:
          items:
            $ref: '#/components/schemas/FileResponse'
          type: array
          title: Files
        total:
          type: integer
          title: Total
      type: object
      required:
      - files
      - total
      title: FileListResponse
      description: List of files response.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
x-refined-from:
- ctlsurf-com-openapi.json
- ctlsurf-com-openapi.yml