> ## 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.

> List company projects and obtain the project object needed to assign a sales invoice.

# List projects

The endpoint returns projects for the company associated with your `Authorization` API key. You do not need to send a `companyId`.

## List projects

`GET /company/projects` returns active and disabled projects. Use `GET /company/projects?onlyActive=1` to return only active projects; omitting the filter or using `onlyActive=0` includes disabled projects.

Each item in `data` contains `tagId`, `name`, `enabled` and `color`. `tagId` identifies the project, and `color` is its numeric ARGB value. When no projects match, the response is `{ "result": "OK", "data": [] }`.

## Assign Grow to a draft invoice

1. Fetch the projects and find the item whose `name` is `Grow` in `data`. There is no server-side name filter.
2. Copy that complete object into the top-level `project` field of your `POST /sales/invoice` request.
3. Set `basicInformation.statusId` to `DRAFT` to save a draft. For an existing draft, also include `basicInformation.invoiceId` and the intended invoice data.

The following fragment must be combined with the remaining invoice data. Replace the illustrative values with the project returned for your company:

```json theme={null}
{
  "project": {
    "tagId": 123,
    "name": "Grow",
    "enabled": true,
    "color": 4286963618
  }
}
```

Invoice validation requires `name`, `enabled` and `color` in addition to the existing project's `tagId`. Sending only an ID, a name, or a `projects` array is insufficient. Include `project` again on subsequent saves to retain the assignment; omitting it removes the assignment.

See [Create/update an invoice](/openapi/sales/createupdate-invoice) for the full invoice contract. If the project does not exist, create it using [Add/modify a project](/openapi/configuration/addmodify-a-project) before assigning it to an invoice.


## OpenAPI

````yaml get /company/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:
  /company/projects:
    parameters: []
    get:
      tags:
        - Configuration
      summary: List projects
      description: >-
        List projects belonging to the company identified by the Authorization
        API key. Returns active and disabled projects by default. Use
        onlyActive=1 to return only active projects. Find the desired project by
        name in data and pass its complete object as project when saving a sales
        invoice; tagId is the project identifier. No companyId parameter is
        needed.
      operationId: get-company-projects
      parameters:
        - name: onlyActive
          in: query
          required: false
          description: >-
            Set to 1 to return only active projects. Omit or set to 0 to include
            disabled projects.
          schema:
            type: integer
            enum:
              - 0
              - 1
            default: 0
          example: 1
      responses:
        '200':
          description: Company projects. data is an empty array when no projects match.
          content:
            application/json:
              schema:
                type: object
                required:
                  - result
                  - data
                properties:
                  result:
                    type: string
                    enum:
                      - OK
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InvoiceTag'
              examples:
                Projects:
                  value:
                    result: OK
                    data:
                      - tagId: 123
                        name: Grow
                        enabled: true
                        color: 4286963618
                No projects:
                  value:
                    result: OK
                    data: []
components:
  schemas:
    InvoiceTag:
      type: object
      properties:
        tagId:
          type: integer
        name:
          type: string
        enabled:
          type: boolean
        color:
          type: integer
      x-examples:
        Example 1:
          tagId: 1
          name: Marketing
          enabled: false
          color: 4286963618
      examples:
        - tagId: 1
          name: Marketing
          enabled: false
          color: 4286963618
      title: ''
      description: ''
  securitySchemes:
    Authorization:
      name: Authorization
      type: apiKey
      in: header
      description: OpenApi Key created within Altera.app for a certain company

````