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

# Get the recruitment funnel of a job

> Returns the recruitment funnel of one job: total applications, per channel, per week over the last eight weeks, the average of open jobs on the same contract type, and the first active publication date.



## OpenAPI

````yaml /api-reference/openapi.json get /job/{jobid}/stats
openapi: 3.0.3
info:
  title: JobAffinity REST API
  version: '1.13'
  description: >
    JobAffinity REST API for managing jobs, candidates, applications, and
    recruitment processes.


    ## Authentication

    All endpoints require HTTP Basic Authentication.


    ## Versioning

    Current version: 1.13


    See `/restapi/changelog` for version history and changes.
  contact:
    name: JobAffinity API Support
servers:
  - url: https://jobaffinity.fr/restapi/v1
    description: REST API v1
  - url: https://jobaffinity.fr/restapi
    description: REST API root (for changelog)
security:
  - basicAuth: []
tags:
  - name: API Info
    description: API metadata and changelog
  - name: Account
    description: Authenticated user identity and organisation membership
  - name: Jobs
    description: Job listings and details
  - name: Candidates
    description: Candidate information
  - name: Applications
    description: Job applications
  - name: Processes
    description: Recruitment processes and steps
  - name: Notes
    description: Candidate notes
  - name: Templates
    description: Recorded email templates
  - name: Questionnaires
    description: Questionnaire answers
  - name: Webhooks
    description: Webhook tasks
  - name: Job Application Submission
    description: >-
      Submit candidate applications to a job posting via the apply URL provided
      in the job feed. The authentication token is embedded in the URL — no
      additional credentials are required.
paths:
  /job/{jobid}/stats:
    get:
      tags:
        - Jobs
      summary: Get the recruitment funnel of a job
      description: >-
        Returns the recruitment funnel of one job: total applications, per
        channel, per week over the last eight weeks, the average of open jobs on
        the same contract type, and the first active publication date.
      operationId: getJobStats
      parameters:
        - name: jobid
          in: path
          required: true
          description: Job ID
          schema:
            type: integer
        - $ref: '#/components/parameters/organisationFilterParam'
      responses:
        '200':
          description: Recruitment funnel
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStats'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  parameters:
    organisationFilterParam:
      name: organisation_id
      in: query
      description: >-
        Narrow the read to a single organisation. Without it, the caller keeps
        its full visibility.
      schema:
        type: integer
  schemas:
    JobStats:
      type: object
      properties:
        _status:
          type: string
          enum:
            - OK
            - INVALID
        job_id:
          type: integer
        job_title:
          type: string
        applications_total:
          type: integer
          description: Applications received over the job's life.
        by_channel:
          type: array
          description: Applications per publication source, biggest first.
          items:
            type: object
            properties:
              channel:
                type: string
                description: Publication source name.
              count:
                type: integer
              last_date:
                type: string
                nullable: true
                description: Date of the latest application from this channel.
        by_week:
          type: array
          description: Applications per week over the last eight weeks.
          items:
            type: object
            properties:
              week_start:
                type: string
                description: First day of the week.
              count:
                type: integer
        peer_average:
          type: number
          nullable: true
          description: >-
            Average applications of open jobs on the same contract, null below
            three peers.
        published_since:
          type: string
          nullable: true
          description: First active publication date, null when never published.
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      headers:
        WWW-Authenticate:
          schema:
            type: string
    NotFoundError:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            type: object
            properties:
              _status:
                type: string
                enum:
                  - INVALID
              error:
                type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Authentication with API credentials

````