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

# Department headcount

> Retrieve headcount information for specified departments or all departments if none specified.

By default the data comes live from LinkedIn (`live: true`) and includes 3/6/12-month evolution per department, as documented below. Set `live: false` to answer from Pipecorn's companies database (Elasticsearch) instead, with no integration required. The `live: false` response is a current snapshot only (no evolution) in a different shape:

```json
{
  "total_headcount": 18769,
  "departments": {
    "Engineering": { "current_headcount": 8681 },
    "Sales": { "current_headcount": 6258 }
  }
}
```

**Rate limit:** 2 requests per minute



## OpenAPI

````yaml POST /accounts/headcount
openapi: 3.0.1
info:
  title: Pipecorn Accounts API
  description: Pipecorn Accounts API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /accounts/headcount:
    post:
      summary: Get company headcount by department
      description: >-
        Retrieve headcount information for specified departments or all
        departments if none specified.


        By default the data comes live from LinkedIn (`live: true`) and includes
        3/6/12-month evolution per department, as documented below. Set `live:
        false` to answer from Pipecorn's companies database (Elasticsearch)
        instead, with no integration required. The `live: false` response is a
        current snapshot only (no evolution) in a different shape:


        ```json

        {
          "total_headcount": 18769,
          "departments": {
            "Engineering": { "current_headcount": 8681 },
            "Sales": { "current_headcount": 6258 }
          }
        }

        ```


        **Rate limit:** 2 requests per minute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                company_linkedin_id:
                  type: string
                  description: LinkedIn company identifier
                  example: '1818'
                departments:
                  type: array
                  example:
                    - Engineering
                    - Sales
                    - Finance
                  items:
                    type: string
                    enum:
                      - Accounting
                      - Administrative
                      - Arts and Design
                      - Business Development
                      - Community and Social Services
                      - Consulting
                      - Customer Success and Support
                      - Education
                      - Engineering
                      - Entrepreneurship
                      - Finance
                      - Healthcare Services
                      - Human Resources
                      - Information Technology
                      - Legal
                      - Marketing
                      - Media and Communication
                      - Military and Protective Services
                      - Operations
                      - Product Management
                      - Program and Project Management
                      - Purchasing
                      - Quality Assurance
                      - Real Estate
                      - Research
                      - Sales
                  description: >-
                    List of departments to get headcount for. If not provided,
                    returns data for all departments.
                live:
                  type: boolean
                  description: >-
                    Data source toggle. `true` (default) returns the live
                    department headcount with 3/6/12-month evolution from
                    LinkedIn. `false` answers from Pipecorn's companies database
                    (Elasticsearch) instead — no integration required —
                    returning only a current headcount snapshot
                    (`total_headcount` plus `departments` with
                    `current_headcount`), without any evolution data. A
                    non-boolean value returns `422`.
                  default: true
                  example: true
              required:
                - company_linkedin_id
      responses:
        '200':
          description: Successfully retrieved headcount data
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
                  properties:
                    3_months_evolution:
                      type: object
                      properties:
                        base_headcount:
                          type: integer
                          description: Base headcount value
                        current_headcount:
                          type: integer
                          description: Current headcount value
                        headcount_gain:
                          type: integer
                          description: Headcount gain
                        headcount_gain_percentage:
                          type: integer
                          description: Headcount gain percentage
                    6_months_evolution:
                      type: object
                      properties:
                        base_headcount:
                          type: integer
                          description: Base headcount value
                        current_headcount:
                          type: integer
                          description: Current headcount value
                        headcount_gain:
                          type: integer
                          description: Headcount gain
                        headcount_gain_percentage:
                          type: integer
                          description: Headcount gain percentage
                    12_months_evolution:
                      type: object
                      properties:
                        base_headcount:
                          type: integer
                          description: Base headcount value
                        current_headcount:
                          type: integer
                          description: Current headcount value
                        headcount_gain:
                          type: integer
                          description: Headcount gain
                        headcount_gain_percentage:
                          type: integer
                          description: Headcount gain percentage
              example:
                Engineering:
                  3_months_evolution:
                    base_headcount: 8611
                    current_headcount: 8681
                    headcount_gain: 70
                    headcount_gain_percentage: 1
                  6_months_evolution:
                    base_headcount: 8412
                    current_headcount: 8681
                    headcount_gain: 269
                    headcount_gain_percentage: 3
                  12_months_evolution:
                    base_headcount: 8153
                    current_headcount: 8681
                    headcount_gain: 528
                    headcount_gain_percentage: 6
                Finance:
                  3_months_evolution:
                    base_headcount: 2801
                    current_headcount: 2830
                    headcount_gain: 29
                    headcount_gain_percentage: 1
                  6_months_evolution:
                    base_headcount: 2774
                    current_headcount: 2830
                    headcount_gain: 56
                    headcount_gain_percentage: 2
                  12_months_evolution:
                    base_headcount: 2659
                    current_headcount: 2830
                    headcount_gain: 171
                    headcount_gain_percentage: 6
                Sales:
                  3_months_evolution:
                    base_headcount: 6130
                    current_headcount: 6258
                    headcount_gain: 128
                    headcount_gain_percentage: 2
                  6_months_evolution:
                    base_headcount: 5914
                    current_headcount: 6258
                    headcount_gain: 344
                    headcount_gain_percentage: 6
                  12_months_evolution:
                    base_headcount: 5549
                    current_headcount: 6258
                    headcount_gain: 709
                    headcount_gain_percentage: 13
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: 400
                message: >-
                  Please use only valid department values from the provided
                  list.
        '429':
          description: Rate limit exceeded (2 requests per minute)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````