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

# Set the project on selected expenses

> Requires the projects entitlement. Sets the same project on every expense header
and line item in a single transaction.




## OpenAPI

````yaml /openapi/openapi.json post /expenses/projects
openapi: 3.1.0
info:
  title: OpenAPI
  version: '1.0'
  summary: OpenApi
  contact:
    name: Altera Support
    url: https://altera.co
    email: wsparcie@altera.co
  description: ''
  license:
    url: https://altera.co/regulamin
    name: Terms of services for Altera.app
servers:
  - url: https://api.altera.co
    description: Production endpoint (proxied)
security:
  - Authorization: []
tags:
  - name: Configuration
  - name: Data export
  - name: Expenses
  - name: Sales
paths:
  /expenses/projects:
    post:
      tags:
        - Expenses
      summary: Set the project on selected expenses
      description: >
        Requires the projects entitlement. Sets the same project on every
        expense header

        and line item in a single transaction.
      operationId: updateExpenseProjects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectBatchUpdate'
      responses:
        '200':
          $ref: '#/components/responses/InvoiceBatchUpdated'
        '400':
          $ref: '#/components/responses/InvalidExpenseClassification'
        '401':
          $ref: '#/components/responses/OpenApiAuthorizationRequired'
        '402':
          description: The company's subscription does not include projects.
        '403':
          $ref: '#/components/responses/OpenApiAccessDenied'
        '404':
          description: At least one ID does not identify an expense in the company.
components:
  schemas:
    ProjectBatchUpdate:
      type: object
      additionalProperties: false
      required:
        - invoiceIds
        - tag
      properties:
        invoiceIds:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: integer
            minimum: 1
            maximum: 9007199254740991
        tag:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Active project ID from GET /company/projects?onlyActive=1. Set to
            null to clear the project.
      example:
        invoiceIds:
          - 101
          - 102
        tag: 9
    InvoiceBatchResult:
      type: object
      required:
        - result
        - data
      properties:
        result:
          type: string
          enum:
            - OK
        data:
          type: object
          required:
            - processed
            - rejected
          properties:
            processed:
              type: array
              description: >-
                Each processed invoice ID appears once, in the order of its
                first occurrence in the request.
              uniqueItems: true
              items:
                type: integer
                minimum: 1
            rejected:
              type: array
              maxItems: 0
              items:
                type: object
    ExpenseClassificationError:
      type: object
      properties:
        result:
          type: string
          enum:
            - Error
        errorCode:
          type: string
        errorMessage:
          type: string
        errorMessagePL:
          type: string
        details:
          type: object
          additionalProperties: true
          properties:
            invoices:
              type: array
              description: >-
                Present when the category change needs explicit workflow
                confirmation.
              items:
                type: object
                required:
                  - invoiceId
                  - confirmation
                properties:
                  invoiceId:
                    type: integer
                    minimum: 1
                  confirmation:
                    type: string
                    pattern: ^[a-f0-9]{64}$
  responses:
    InvoiceBatchUpdated:
      description: Every selected document was updated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InvoiceBatchResult'
    InvalidExpenseClassification:
      description: >-
        Invalid input, unavailable classification, or a locked expense. The
        entire batch is rejected.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExpenseClassificationError'
    OpenApiAuthorizationRequired:
      description: >-
        The Authorization header is missing, or a verified key has expired
        (KEY_EXPIRED).
    OpenApiAccessDenied:
      description: The API key is invalid or the company does not have OpenAPI access.
  securitySchemes:
    Authorization:
      name: Authorization
      type: apiKey
      in: header
      description: OpenApi Key created within Altera.app for a certain company

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.