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

# Retrieve Activity Report

> Retrieves activity report information by id.



## OpenAPI

````yaml /openapi.yaml get /api/v1/activity-reports/{id}
openapi: 3.0.3
info:
  title: Folkyn API
  version: 1.0.0
  license:
    name: Proprietary
    url: https://folkyn.com
  description: >-
    Team API key; responses in `data`, errors in `error` with `X-Request-Id`.
    Spec at `/api/v1/openapi.yaml` and `/api/v1/openapi.json` (no key). **60
    requests/minute** per key on `/api/v1/*`.
servers:
  - url: https://api.folkyn.com
    description: Production
security:
  - bearerAuth: []
  - ApiKeyHeader: []
tags:
  - name: Specification
    description: OpenAPI document download (no authentication)
  - name: Project codes
    description: Team project codes
  - name: Team tags
    description: Team tags
  - name: Teams
    description: Organizational teams (team units) and member lists
  - name: Missions
    description: Team missions
  - name: Freelancers
    description: Team freelancers and invitations
  - name: Activity reports
    description: Activity reports (CRA)
  - name: Accounting
    description: Accounting entries
paths:
  /api/v1/activity-reports/{id}:
    get:
      tags:
        - Activity reports
      summary: Retrieve Activity Report
      description: Retrieves activity report information by id.
      operationId: getActivityReport
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ActivityReportDetail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ActivityReportDetail:
      $ref: '#/components/schemas/ActivityReportListItemPublic'
    PublicError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: integer
              description: Same as HTTP status; use `message` and `details` to narrow.
              enum:
                - 400
                - 401
                - 403
                - 404
                - 429
                - 500
              example: 401
            message:
              type: string
            request_id:
              type: string
              format: uuid
              description: Correlates with the X-Request-Id response header.
            details:
              $ref: '#/components/schemas/PublicErrorDetails'
    ActivityReportListItemPublic:
      type: object
      properties:
        id:
          type: string
          format: uuid
        mission:
          $ref: '#/components/schemas/ActivityReportMissionPublic'
        external_referent:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActivityReportExternalReferentPublic'
        report_month:
          type: string
          pattern: ^[0-9]{4}-[0-9]{2}$
          description: >
            Month key as stored (**`YYYY-MM`**). **`report_period_start`** /
            **`report_period_end`** are RFC 3339 **`date-time`** strings with
            explicit offset, covering the **first civil day** through the **last
            civil day** of that month in **`report_period_time_zone`**
            (**`Europe/Paris`** — legal time, including DST). Safe to parse with
            standard `date-time` clients (`new Date(...)` in JavaScript). Null
            if **`report_month`** is missing or invalid.
          example: 2024-03
        report_period_time_zone:
          type: string
          enum:
            - Europe/Paris
          description: >-
            IANA time zone applied to **`report_period_start`** /
            **`report_period_end`** (always this value).
        report_period_start:
          type: string
          format: date-time
          nullable: true
          description: >
            First instant of the first civil day of **`report_month`** in
            **`Europe/Paris`** (RFC 3339 with offset). Null if missing or
            invalid.
          example: '2024-03-01T00:00:00.000+01:00'
        report_period_end:
          type: string
          format: date-time
          nullable: true
          description: >
            Last instant of the last civil day of **`report_month`** in
            **`Europe/Paris`** (handles February leap years and DST). Null if
            invalid.
          example: '2024-03-31T23:59:59.999+02:00'
        submission_date:
          type: string
          format: date-time
          nullable: true
        status:
          $ref: '#/components/schemas/ActivityReportDisplayStatus'
        reviewed_at:
          type: string
          format: date-time
          nullable: true
          description: >
            Timestamp of the last review decision (approve or reject). Null if
            never reviewed.
        rejection_reason:
          type: string
          nullable: true
        freelancer:
          $ref: '#/components/schemas/ActivityReportFreelancerPublic'
        invoicing_is_paid:
          type: boolean
        expenses_is_paid:
          type: boolean
        invoice_amount_excl_vat:
          type: number
          description: Invoice line amount excluding VAT.
        expense_amount_excl_vat:
          type: number
          description: Expense line amount excluding VAT.
        project_codes:
          type: array
          description: >
            Invoice amount excl. VAT split by project code (same rules as
            invoice billing; excludes expense refacturation). One entry with the
            full **`invoice_amount_excl_vat`** when the mission has a single
            linked code; per-line split when multiple codes are linked. Empty
            when no project codes are linked.
          items:
            $ref: '#/components/schemas/ProjectCodeAmountPublic'
        supplementary_items:
          type: array
          description: >
            Supplementary billing lines. When the mission has multiple project
            codes, each line includes **`project_code_id`**.
          items:
            $ref: '#/components/schemas/ActivityReportSupplementaryItemPublic'
        created_at:
          type: string
          format: date-time
        accounting_entries:
          type: array
          description: >-
            Accounting entry ids linked to this activity report (`invoice` /
            `expenses`). Empty until validated.
          items:
            $ref: '#/components/schemas/ActivityReportAccountingStubPublic'
        timesheets:
          type: array
          description: >-
            All timesheet lines for this activity report (discriminated by
            `type`). Empty array if none.
          items:
            $ref: '#/components/schemas/ActivityReportTimesheetLinePublic'
    PublicErrorDetails:
      type: object
      description: Optional structured hints (validation, scope, rate limit).
      additionalProperties: true
      properties:
        reason:
          $ref: '#/components/schemas/PartnerValidationErrorReason'
        field:
          type: string
          description: JSON body field name when applicable (e.g. `name`).
          example: name
        requiredScope:
          type: string
          description: >-
            Required OAuth-like scope string when `code` is 403 (insufficient
            scope).
          example: tags:write
        retryAfterSeconds:
          type: integer
          minimum: 0
          description: Hint when `code` is 429.
    ActivityReportMissionPublic:
      type: object
      required:
        - id
        - name
        - mission_type
        - currency
        - rate_amount
        - purchase_order
        - project_code
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        mission_type:
          $ref: '#/components/schemas/MissionBillingType'
        currency:
          type: string
          description: >-
            ISO 4217 currency code of the mission's amounts (e.g. `EUR`, `USD`).
            Defaults to `EUR`.
        rate_amount:
          type: number
          description: >-
            Freelancer unit rate excl. VAT (in **`currency`**); unit follows
            **`mission_type`**.
        client_rate_amount:
          type: number
          nullable: true
          description: >
            ESN: unit rate excl. VAT resold to the end client (same currency and
            unit as **`rate_amount`**). Null when not applicable or unset.
        purchase_order:
          type: string
          nullable: true
          description: Purchase order number (bon de commande) on the mission, if set.
        project_code:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ActivityReportMissionProjectCodePublic'
          description: >-
            Primary linked team project code; null if the mission has none. Use
            root **`project_codes`** on the activity report for the full list
            with amounts.
    ActivityReportExternalReferentPublic:
      type: object
      required:
        - id
        - email
        - company
        - siren
        - address
        - postal_code
        - city
      description: >-
        External client referent on the mission (id, email, company name, SIREN,
        address fields). Distinct from `freelancer.referent` (team referent).
      properties:
        id:
          type: string
          format: uuid
          nullable: true
          description: Client company UUID; null when unset.
        email:
          type: string
        company:
          type: string
        siren:
          type: string
          nullable: true
          pattern: ^[0-9]{9}$
          description: >-
            Client company SIREN (9 digits, no spaces); null when unset or fewer
            than 9 digits.
        address:
          type: string
          nullable: true
          description: Street address line.
        postal_code:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
    ActivityReportDisplayStatus:
      type: string
      description: >
        Normalized status in response JSON (lowercase). Values: `PENDING` →
        `pending`, `APPROVED` → `approved` or **`paid`** when invoicing or
        expenses are marked paid, `REJECTED` → `rejected`.
      enum:
        - pending
        - approved
        - rejected
        - paid
    ActivityReportFreelancerPublic:
      type: object
      nullable: true
      description: >
        Assigned freelancer; null if missing. `referent` matches the team
        referent on mission payloads (see `MissionFreelancerPublic`).
      properties:
        id:
          type: string
          format: uuid
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        external_id:
          type: string
          description: >
            External identifier for integrations. Uses the team-stored value
            when set; otherwise computed from lowercased `first_name` +
            `last_name` with spaces and Latin diacritics stripped (e.g. Clément
            Balea → `clementbalea`). German `ß` becomes `ss`. Empty string if
            both names are missing and no stored value.
        siren:
          type: string
          nullable: true
          description: >
            Freelancer company SIREN (9 digits, no spaces); null when unset or
            fewer than 9 digits.
        referent:
          type: object
          nullable: true
          description: Team referent (id, name, email); null if none.
          allOf:
            - $ref: '#/components/schemas/PartnerFreelancerReferentPublic'
    ProjectCodeAmountPublic:
      type: object
      required:
        - id
        - name
        - external_id
        - amount_excl_vat
      description: >-
        Project code with invoice amount excl. VAT (excludes expense
        refacturation).
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        external_id:
          type: string
          nullable: true
        amount_excl_vat:
          type: number
          description: >-
            Invoice amount excl. VAT attributed to this project code for the
            activity report or invoice accounting entry.
    ActivityReportSupplementaryItemPublic:
      type: object
      required:
        - id
        - description
        - amount_excl_vat
        - project_code_id
      properties:
        id:
          type: string
          format: uuid
        description:
          type: string
          nullable: true
        amount_excl_vat:
          type: number
        project_code_id:
          type: string
          format: uuid
          nullable: true
          description: >
            Project code billed on this supplementary line. Set when the mission
            has multiple project codes; otherwise `null`.
    ActivityReportAccountingStubPublic:
      type: object
      required:
        - id
        - type
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - invoice
            - expenses
    ActivityReportTimesheetLinePublic:
      description: >
        Timesheet lines for the activity report. `type` discriminates the object
        shape.

        For `hourly` and `daily` missions, the API returns one row per calendar
        day in `report_month`: days without declared time appear as zero-fill
        lines with `hours: 0` or `days: 0`, `description: null`, and a
        deterministic UUID in `id`. Declared days use their own `id`. Lines are
        sorted by `date`, then `id`. `monthly` / `deliverable` rows follow
        day-based lines.

        `description` is `null` when empty (never an empty string).
      oneOf:
        - $ref: '#/components/schemas/ActivityReportTimesheetLineHourlyPublic'
        - $ref: '#/components/schemas/ActivityReportTimesheetLineDailyPublic'
        - $ref: '#/components/schemas/ActivityReportTimesheetLineMonthlyPublic'
        - $ref: '#/components/schemas/ActivityReportTimesheetLineDeliverablePublic'
      discriminator:
        propertyName: type
        mapping:
          hourly:
            $ref: '#/components/schemas/ActivityReportTimesheetLineHourlyPublic'
          daily:
            $ref: '#/components/schemas/ActivityReportTimesheetLineDailyPublic'
          monthly:
            $ref: '#/components/schemas/ActivityReportTimesheetLineMonthlyPublic'
          deliverable:
            $ref: '#/components/schemas/ActivityReportTimesheetLineDeliverablePublic'
    PartnerValidationErrorReason:
      type: string
      description: >-
        Machine-readable validation subtype (HTTP 400) for create tag / project
        code.
      enum:
        - invalid_json
        - required_field
        - duplicate_name
    MissionBillingType:
      type: string
      description: >
        Billing model for the mission (Postgres enum `mission_type`). `hourly` /
        `daily` / `monthly` use **`rate_amount`** as the price per that unit in
        **`currency`**. `deliverable` missions bill via the **deliverables
        catalog** (quantities and line amounts); `rate_amount` may still be set
        as a reference but line totals come from catalog rows on mission detail.
      enum:
        - hourly
        - daily
        - monthly
        - deliverable
    ActivityReportMissionProjectCodePublic:
      type: object
      required:
        - id
        - name
        - external_id
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        external_id:
          type: string
          nullable: true
          description: Optional client / ERP reference for the project code.
    PartnerFreelancerReferentPublic:
      type: object
      description: Team referent (id, first name, last name, email).
      required:
        - id
        - first_name
        - last_name
        - email
      properties:
        id:
          type: string
          format: uuid
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
    ActivityReportTimesheetLineHourlyPublic:
      type: object
      required:
        - id
        - type
        - description
      description: >-
        Hours per calendar day. Missing days in the month are returned as
        zero-fill rows with `hours: 0`.
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - hourly
        description:
          type: string
          nullable: true
          description: Comment or line description on the CRA; null when empty.
        date:
          type: string
          format: date
          nullable: true
          description: Activity day (YYYY-MM-DD).
        hours:
          type: number
          nullable: true
          description: Declared hours for this line; `0` on zero-fill days.
        project_code_id:
          type: string
          format: uuid
          nullable: true
          description: >
            Project code billed on this line. Present when the mission has
            multiple project codes; omitted or `null` for single-code missions.
    ActivityReportTimesheetLineDailyPublic:
      type: object
      required:
        - id
        - type
        - description
      description: >-
        Days per calendar day. Missing days in the month are returned as
        zero-fill rows with `days: 0`.
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - daily
        description:
          type: string
          nullable: true
          description: Line comment on the CRA; null when empty.
        date:
          type: string
          format: date
          nullable: true
        days:
          type: number
          nullable: true
          description: Declared days for this line; `0` on zero-fill days.
        project_code_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Project code billed on this line when the mission has multiple
            project codes.
    ActivityReportTimesheetLineMonthlyPublic:
      type: object
      required:
        - id
        - type
        - description
      description: >-
        Activity or billing line for a calendar month (quantities and totals
        live on the CRA / mission elsewhere).
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - monthly
        description:
          type: string
          nullable: true
          description: Line comment on the CRA; null when empty.
        month:
          type: string
          nullable: true
          pattern: ^[0-9]{4}-[0-9]{2}$
          description: Month key YYYY-MM.
        project_code_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Project code billed on this line when the mission has multiple
            project codes.
    ActivityReportTimesheetLineDeliverablePublic:
      type: object
      required:
        - id
        - type
        - description
        - comment
      description: >
        One deliverable line. Structured payloads may return `comment`
        separately with `description` set to null (deliverable name in
        `deliverable`).
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - deliverable
        description:
          type: string
          nullable: true
          description: >-
            Optional label; null when only structured deliverable fields are
            present (use `deliverable` + `comment`).
        comment:
          type: string
          nullable: true
          description: >-
            Optional deliverable comment from the stored JSON (`comment` field);
            `null` when unset.
        deliverable:
          type: string
          nullable: true
          description: Free-text name or label of the deliverable.
        date:
          type: string
          format: date
          nullable: true
        amount:
          type: number
          nullable: true
        project_code_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            Project code billed on this line when the mission has multiple
            project codes.
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
    ForbiddenError:
      description: Insufficient scope or forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
    RateLimited:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use `Authorization: Bearer <your_api_key>`'
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key

````