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

# /greenhouse/jobs/departments

> List the department tree of a company's Greenhouse job board by board token: each department's id, name, parent and child department ids, and the jobs that belong to it.

**Price:** 10 credits

**⚠️ Common errors:** 412: Board token does not exist



## OpenAPI

````yaml /openapi/jobs.json post /api/greenhouse/jobs/departments
openapi: 3.1.0
info:
  title: Any Site API
  description: >+
    Any Site API provides programmatic access to data from LinkedIn, Instagram,
    Twitter, and other platforms.


    ## Authentication


    All API endpoints require an `access-token` header with a valid API token.
    Tokens can be created in the [dashboard](https://app.anysite.io/).


    ## Pricing


    Each endpoint has a credit cost listed in its description. Credits are
    deducted from your token balance per request.

  version: 0.0.1
servers: []
security:
  - AccessToken: []
paths:
  /api/greenhouse/jobs/departments:
    post:
      tags:
        - /greenhouse
      summary: /greenhouse/jobs/departments
      description: >-
        List the department tree of a company's Greenhouse job board by board
        token: each department's id, name, parent and child department ids, and
        the jobs that belong to it.


        **Price:** 10 credits


        **⚠️ Common errors:** 412: Board token does not exist
      operationId: __api_greenhouse_jobs_departments_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GreenhouseJobsDepartmentsPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GreenhouseDepartment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GreenhouseJobsDepartmentsPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        board_token:
          type: string
          minLength: 1
      type: object
      required:
        - board_token
    GreenhouseDepartment:
      properties:
        '@type':
          type: string
          default: GreenhouseDepartment
        id:
          type: integer
        name:
          anyOf:
            - type: string
            - type: 'null'
        parent_id:
          anyOf:
            - type: integer
            - type: 'null'
        child_ids:
          items:
            type: integer
          type: array
          default: []
        jobs:
          items:
            $ref: '#/components/schemas/GreenhouseJob'
          type: array
          default: []
      type: object
      required:
        - id
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    GreenhouseJob:
      properties:
        '@type':
          type: string
          default: GreenhouseJob
        id:
          type: integer
        location:
          anyOf:
            - type: string
            - type: 'null'
        url:
          anyOf:
            - type: string
            - type: 'null'
        company_name:
          anyOf:
            - type: string
            - type: 'null'
        language:
          anyOf:
            - type: string
            - type: 'null'
        requisition_id:
          anyOf:
            - type: string
            - type: 'null'
        internal_job_id:
          anyOf:
            - type: integer
            - type: 'null'
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
        first_published_at:
          anyOf:
            - type: string
            - type: 'null'
        education:
          anyOf:
            - type: string
            - type: 'null'
        employment:
          anyOf:
            - type: string
            - type: 'null'
        departments:
          items:
            $ref: '#/components/schemas/GreenhouseDepartmentRef'
          type: array
          default: []
        offices:
          items:
            $ref: '#/components/schemas/GreenhouseOfficeRef'
          type: array
          default: []
        questions:
          items:
            $ref: '#/components/schemas/GreenhouseQuestion'
          type: array
          default: []
        location_questions:
          items:
            $ref: '#/components/schemas/GreenhouseQuestion'
          type: array
          default: []
        demographic_questions:
          anyOf:
            - $ref: '#/components/schemas/GreenhouseDemographicQuestions'
            - type: 'null'
        compliance:
          items:
            $ref: '#/components/schemas/GreenhouseCompliance'
          type: array
          default: []
        metadata:
          items:
            $ref: '#/components/schemas/GreenhouseJobMetadata'
          type: array
          default: []
        data_compliance:
          items:
            $ref: '#/components/schemas/GreenhouseDataCompliance'
          type: array
          default: []
      type: object
      required:
        - id
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
    GreenhouseDepartmentRef:
      properties:
        '@type':
          type: string
          default: GreenhouseDepartmentRef
        id:
          type: integer
        name:
          anyOf:
            - type: string
            - type: 'null'
        parent_id:
          anyOf:
            - type: integer
            - type: 'null'
        child_ids:
          items:
            type: integer
          type: array
          default: []
      type: object
      required:
        - id
    GreenhouseOfficeRef:
      properties:
        '@type':
          type: string
          default: GreenhouseOfficeRef
        id:
          type: integer
        name:
          anyOf:
            - type: string
            - type: 'null'
        location:
          anyOf:
            - type: string
            - type: 'null'
        parent_id:
          anyOf:
            - type: integer
            - type: 'null'
        child_ids:
          items:
            type: integer
          type: array
          default: []
      type: object
      required:
        - id
    GreenhouseQuestion:
      properties:
        '@type':
          type: string
          default: GreenhouseQuestion
        label:
          anyOf:
            - type: string
            - type: 'null'
        required:
          anyOf:
            - type: boolean
            - type: 'null'
        fields:
          items:
            $ref: '#/components/schemas/GreenhouseQuestionField'
          type: array
          default: []
      type: object
    GreenhouseDemographicQuestions:
      properties:
        '@type':
          type: string
          default: GreenhouseDemographicQuestions
        header:
          anyOf:
            - type: string
            - type: 'null'
        questions:
          items:
            $ref: '#/components/schemas/GreenhouseDemographicQuestion'
          type: array
          default: []
      type: object
    GreenhouseCompliance:
      properties:
        '@type':
          type: string
          default: GreenhouseCompliance
        type:
          anyOf:
            - type: string
            - type: 'null'
        questions:
          items:
            $ref: '#/components/schemas/GreenhouseQuestion'
          type: array
          default: []
      type: object
    GreenhouseJobMetadata:
      properties:
        '@type':
          type: string
          default: GreenhouseJobMetadata
        id:
          anyOf:
            - type: integer
            - type: 'null'
        name:
          anyOf:
            - type: string
            - type: 'null'
        value: {}
        value_type:
          anyOf:
            - type: string
            - type: 'null'
      type: object
    GreenhouseDataCompliance:
      properties:
        '@type':
          type: string
          default: GreenhouseDataCompliance
        type:
          anyOf:
            - type: string
            - type: 'null'
        requires_consent:
          anyOf:
            - type: boolean
            - type: 'null'
        requires_processing_consent:
          anyOf:
            - type: boolean
            - type: 'null'
        requires_retention_consent:
          anyOf:
            - type: boolean
            - type: 'null'
        retention_period:
          anyOf:
            - type: integer
            - type: 'null'
      type: object
    GreenhouseQuestionField:
      properties:
        '@type':
          type: string
          default: GreenhouseQuestionField
        name:
          anyOf:
            - type: string
            - type: 'null'
        type:
          anyOf:
            - type: string
            - type: 'null'
        values:
          items:
            additionalProperties: true
            type: object
          type: array
          default: []
      type: object
    GreenhouseDemographicQuestion:
      properties:
        '@type':
          type: string
          default: GreenhouseDemographicQuestion
        id:
          anyOf:
            - type: integer
            - type: 'null'
        label:
          anyOf:
            - type: string
            - type: 'null'
        type:
          anyOf:
            - type: string
            - type: 'null'
        required:
          anyOf:
            - type: boolean
            - type: 'null'
        answer_options:
          items:
            $ref: '#/components/schemas/GreenhouseDemographicAnswerOption'
          type: array
          default: []
      type: object
    GreenhouseDemographicAnswerOption:
      properties:
        '@type':
          type: string
          default: GreenhouseDemographicAnswerOption
        id:
          anyOf:
            - type: integer
            - type: 'null'
        label:
          anyOf:
            - type: string
            - type: 'null'
        free_form:
          anyOf:
            - type: boolean
            - type: 'null'
        decline_to_answer:
          anyOf:
            - type: boolean
            - type: 'null'
      type: object
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````