Pencil Files API

Safe file metadata and inline text content.

GitHub OpenAPI

Operations 2

GET /files List files #
GET /files/{id} Get a file #

Specifications

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/pencil-ink:pencil-ink-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

pencil-ink-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Pencil Public Files API
  version: 1.0.0
  description: 'Programmatic access to Pencil tasks, projects, agents, ideas, content, phases, and meetings.


    **Authentication.** Every request must send an org-scoped API key as a bearer token:


    ```

    Authorization: Bearer pk_live_…

    ```


    Create and manage keys in Pencil under **Settings → API Keys**. A key is scoped to a single organization — the org is determined by the key, so you never pass an org id. Each key carries a single coarse role:


    - `read` — may call any `GET` endpoint.

    - `write` — may additionally call `POST`/`PATCH`/`DELETE`. A read-only key calling a write endpoint gets `403`.


    **Responses.** Single resources are wrapped as `{ "data": … }`. List endpoints return `{ "data": [...], "pagination": { "nextCursor": string | null, "hasMore": boolean } }`; pass the returned `nextCursor` back as the `cursor` query param to page. Errors use `{ "error": { "code": …, "message": … } }`.


    **Rate limits.** Requests are limited per key. Exceeding the limit returns `429` with a `Retry-After` header (seconds until the window resets).'
servers:
- url: https://app.pencil.ink/api/v1
  description: This deployment
security:
- bearerAuth: []
tags:
- name: Files
  description: Safe file metadata and inline text content.
paths:
  /files:
    get:
      tags:
      - Files
      summary: List files
      description: Returns safe file metadata and inline text content only when already stored inline. Storage URLs are not exposed.
      operationId: listFiles
      parameters:
      - name: projectId
        in: query
        schema:
          type: string
      - name: taskId
        in: query
        schema:
          type: string
      - name: contentId
        in: query
        schema:
          type: string
      - name: agentId
        in: query
        schema:
          type: string
      - name: search
        in: query
        schema:
          type: string
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: A page of resources.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/FileObject'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /files/{id}:
    parameters:
    - $ref: '#/components/parameters/PathId'
    get:
      tags:
      - Files
      summary: Get a file
      operationId: getFile
      responses:
        '200':
          description: The resource.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/FileObject'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    PathId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: The resource id.
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
      description: Page size (clamped to 1–100, default 25).
    Cursor:
      name: cursor
      in: query
      schema:
        type: string
      description: Opaque pagination cursor (`pagination.nextCursor` from a previous page).
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
              - unauthorized
              - forbidden
              - rate_limited
              - validation_error
              - phase_gate_locked
              - conflict
              - not_found
              - internal_error
            message:
              type: string
    FileObject:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        name:
          type: string
        size:
          type: integer
        mimeType:
          type: string
        hasInlineContent:
          type: boolean
        content:
          type:
          - string
          - 'null'
          description: 'Only present for files stored with `url: inline`.'
        createdAt:
          type: integer
      description: Safe file metadata. Raw storage URLs and credentials are never returned.
    Pagination:
      type: object
      properties:
        nextCursor:
          type: string
          nullable: true
          description: Cursor for the next page, or null when there are no more results.
        hasMore:
          type: boolean
  responses:
    NotFound:
      description: Resource not found in this org (`not_found`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key (`unauthorized`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Org-scoped API key, e.g. `pk_live_…`.