Onplana Expenses API

Expense claims against a project (Onplana Services): their receipts

GitHub OpenAPI

Operations 8

GET /expenses List expense claims: the caller's own, a project's, or the ones waiting for the… #
POST /expenses File an expense claim on a project #
POST /expenses/{id}/submit Send the caller's own expense claim for approval #
POST /expenses/{id}/withdraw Take the caller's own expense claim back to draft #
GET /expenses/{id}/attachments List an expense claim's receipts #
POST /expenses/{id}/attachments Attach a receipt to an expense claim #
GET /expenses/{id}/attachments/{attachmentId}/download Download a receipt #
DELETE /expenses/{id}/attachments/{attachmentId} Remove a receipt for good #

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/onplana-com:onplana-com-expenses-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

onplana-com-expenses-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Onplana Expenses API
  version: 1.0.0
  description: AI-native Project Management System REST API. All org-scoped routes require the `X-Organization-Id` header. Most routes require a Bearer JWT obtained from `/auth/login`.
servers:
- url: /api
security:
- bearerAuth: []
- patAuth: []
tags:
- name: Expenses
  description: 'Expense claims against a project (Onplana Services): their receipts'
paths:
  /expenses:
    get:
      tags:
      - Expenses
      summary: 'List expense claims: the caller''s own, a project''s, or the ones waiting for the…'
      description: 'Needs the Onplana Services plan feature (crm, 402 otherwise). Without projectId, or with mine=1, the caller''s own claims. With projectId alone, that project''s claims as far as the caller may see them: `scope` in the answer says whether that is everyone''s (all) or only the caller''s (own). With awaiting=me, the submitted claims of other people that the caller may decide, across the projects they can read, oldest first, with `eligible` saying whether they are an approver at all; the other filters are then ignored. Otherwise newest claim date first, at most 500. Amounts are numbers. While the server switch expense_receipts_enabled is on, each claim carries `attachments` and the answer carries receiptsEnabled: true.'
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      - name: projectId
        in: query
        required: false
        schema:
          type: string
        description: One project's claims
      - name: status
        in: query
        required: false
        schema:
          type: string
        description: One of DRAFT, SUBMITTED, APPROVED, REJECTED; any other value is ignored
      - name: mine
        in: query
        required: false
        schema:
          type: string
        description: 1 keeps the list to the caller's own claims
      - name: awaiting
        in: query
        required: false
        schema:
          type: string
        description: me gives the approver's queue
      responses:
        '200':
          description: The claims
          content:
            application/json:
              schema:
                type: object
                required:
                - expenses
                - total
                - scope
                properties:
                  expenses:
                    type: array
                    items:
                      type: object
                    description: Each with its project, user and approvedBy
                  total:
                    type: integer
                    description: How many rows this answer holds
                  scope:
                    type: string
                    enum:
                    - own
                    - all
                  eligible:
                    type: boolean
                    description: Only with awaiting=me
                  receiptsEnabled:
                    type: boolean
                    description: Only while receipts are switched on
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '404':
          description: projectId is not a project the caller may read
      operationId: getExpenses
      x-operation-id-source: derived
    post:
      tags:
      - Expenses
      summary: File an expense claim on a project
      description: Needs the Onplana Services plan feature (crm, 402 otherwise). The caller must be able to add content to the project (403 EXPENSE_WRITE_DENIED otherwise). The claim is the caller's own and starts as DRAFT; send it for approval with POST /expenses/{id}/submit. The day is stored as a calendar day, the currency in upper case, and the exchange rates of the moment are kept with the claim. While the server switch expense_validation_mode is on, an amount with more than two decimals or over the limit answers 400 INVALID_AMOUNT and a day in the future 400 DATE_IN_FUTURE.
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  minLength: 1
                date:
                  type: string
                  description: The day the money was spent, YYYY-MM-DD; today when omitted
                category:
                  type: string
                  enum:
                  - TRAVEL
                  - ACCOMMODATION
                  - MEALS
                  - EQUIPMENT
                  - SOFTWARE
                  - SUBCONTRACTOR
                  - OTHER
                  description: OTHER when omitted
                description:
                  type: string
                  minLength: 1
                  maxLength: 500
                amount:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                currency:
                  type: string
                  description: A 3-letter ISO currency code
                isBillable:
                  type: boolean
                  description: true when omitted
                taskId:
                  nullable: true
                  type: string
                  minLength: 1
                  description: A task of the same project the money went to; 400 INVALID_TASK for any other task, 400 TASK_LINK_OFF while the server switch expense_receipts_enabled is off
              required:
              - projectId
              - description
              - amount
              - currency
      responses:
        '201':
          description: The claim, status DRAFT, with its project, user and approvedBy
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '403':
          description: Forbidden - insufficient role
      operationId: postExpenses
      x-operation-id-source: derived
  /expenses/{id}/submit:
    post:
      tags:
      - Expenses
      summary: Send the caller's own expense claim for approval
      description: Needs the Onplana Services plan feature (crm, 402 otherwise). Moves a DRAFT or REJECTED claim to SUBMITTED, clears the reason it was last returned with, and, while the server switch expense_submit_notice_mode is on, tells the people who approve. A claim that is already SUBMITTED comes back unchanged. An APPROVED one is refused with 400 INVALID_TRANSITION, someone else's claim with 403 NOT_CLAIMANT, and a claim that changed status in the same moment with 409 CONFLICT.
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Expense claim id
      responses:
        '200':
          description: The claim, status SUBMITTED
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '403':
          description: Forbidden - insufficient role
        '404':
          description: 'NOT_FOUND: no such claim in the organization'
        '409':
          description: CONFLICT
      operationId: postExpensesByIdSubmit
      x-operation-id-source: derived
  /expenses/{id}/withdraw:
    post:
      tags:
      - Expenses
      summary: Take the caller's own expense claim back to draft
      description: Needs the Onplana Services plan feature (crm, 402 otherwise). Moves a SUBMITTED or REJECTED claim to DRAFT. A claim that is already DRAFT comes back unchanged. An APPROVED one is refused with 400 INVALID_TRANSITION, someone else's claim with 403 NOT_CLAIMANT, and a claim an approver decided in the same moment with 409 CONFLICT.
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Expense claim id
      responses:
        '200':
          description: The claim, status DRAFT
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '403':
          description: Forbidden - insufficient role
        '404':
          description: 'NOT_FOUND: no such claim in the organization'
        '409':
          description: CONFLICT
      operationId: postExpensesByIdWithdraw
      x-operation-id-source: derived
  /expenses/{id}/attachments:
    get:
      tags:
      - Expenses
      summary: List an expense claim's receipts
      description: 'Only while the server switch expense_receipts_enabled is on; off, it answers 404 as a route that does not exist. Needs the Onplana Services plan feature (crm, 402 otherwise). Readable by whoever may see the claim: the claimant, or a reader of the project the claim list lets see it (never someone else''s draft).'
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Expense claim id
      responses:
        '200':
          description: 'Array of receipts: id, fileName, mimeType, size, createdAt, uploadedBy'
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '404':
          description: The switch is off, or the claim is not one the caller may see
      operationId: getExpensesByIdAttachments
      x-operation-id-source: derived
    post:
      tags:
      - Expenses
      summary: Attach a receipt to an expense claim
      description: Only while the server switch expense_receipts_enabled is on; off, it answers 404 as a route that does not exist. Needs the Onplana Services plan feature (crm, 402 otherwise). Only the claimant, while the claim is DRAFT or REJECTED. One file in the multipart field `file`, at most 100 MB; the storage quota and a content check apply.
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Expense claim id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '201':
          description: The receipt
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '403':
          description: Forbidden - insufficient role
        '404':
          description: The switch is off, or the claim is not one the caller may see
        '413':
          description: The file is over 100 MB, or the organization's storage is full
        '415':
          description: The file content is not a type that may be attached
      operationId: postExpensesByIdAttachments
      x-operation-id-source: derived
  /expenses/{id}/attachments/{attachmentId}/download:
    get:
      tags:
      - Expenses
      summary: Download a receipt
      description: Only while the server switch expense_receipts_enabled is on; off, it answers 404 as a route that does not exist. Needs the Onplana Services plan feature (crm, 402 otherwise). Readable as the receipt list is.
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Expense claim id
      - name: attachmentId
        in: path
        required: true
        schema:
          type: string
        description: Receipt id
      responses:
        '200':
          description: The file
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '404':
          description: The switch is off, or no such receipt the caller may see, or the file is missing
        '423':
          description: The malware scan quarantined the file
      operationId: getExpensesByIdAttachmentsByAttachmentIdDownload
      x-operation-id-source: derived
  /expenses/{id}/attachments/{attachmentId}:
    delete:
      tags:
      - Expenses
      summary: Remove a receipt for good
      description: Only while the server switch expense_receipts_enabled is on; off, it answers 404 as a route that does not exist. Needs the Onplana Services plan feature (crm, 402 otherwise). Only the claimant, while the claim is DRAFT or REJECTED. The file is deleted too.
      parameters:
      - $ref: '#/components/parameters/OrgHeader'
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: Expense claim id
      - name: attachmentId
        in: path
        required: true
        schema:
          type: string
        description: Receipt id
      responses:
        '200':
          description: '`{ success: true }`'
        '400':
          description: Validation error
        '401':
          description: Unauthorized - missing or invalid JWT
        '402':
          description: Plan gate - feature not available on current plan
        '403':
          description: Forbidden - insufficient role
        '404':
          description: The switch is off, or no such receipt on a claim the caller may change
      operationId: deleteExpensesByIdAttachmentsByAttachmentId
      x-operation-id-source: derived
components:
  parameters:
    OrgHeader:
      name: X-Organization-Id
      in: header
      required: true
      description: UUID of the active organization. Sets org context for all scoped operations.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    patAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Personal Access Token: `Authorization: Bearer pat_<token>`. Org context is embedded in the token - no `X-Organization-Id` header required.'
    oauthApp:
      type: oauth2
      description: Third-party OAuth app (confidential client). Register the app under Settings > Developer > OAuth apps; the person approving picks the workspace the token acts in. Tokens last 90 days and extend while in use; there is no refresh token, so a dormant connection re-consents.
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize
          tokenUrl: /oauth/token
          scopes:
            tasks: Read and write the tasks assigned to the person, read their projects, log their time.
            schedule: Read projects and create or update them (publish a schedule).
            mcp: The MCP tool surface, as a member-capped agent persona.
            webhooks: Create, list, change and delete the app's own webhook subscriptions.