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

# Preview a recorded template on an application

> Renders a recorded template on the application — subject and HTML body with the real keywords, exactly as send-email would produce them — without sending anything. Same access rules as send-email. A missing `template_id` answers 200 `_status: INVALID`.



## OpenAPI

````yaml /api-reference/openapi.json get /application/{applicationid}/email-preview
openapi: 3.0.3
info:
  title: JobAffinity REST API
  version: '1.20'
  description: >
    JobAffinity REST API for managing jobs, candidates, applications, and
    recruitment processes.


    ## Authentication

    All endpoints require HTTP Basic Authentication.


    ## Conventions

    - **Validation errors are answered with HTTP 200** and `{"_status":
    "INVALID", "invalid": {...}}` (see the `InvalidResponse` schema and the
    Responses guide), not with an HTTP error code.

    - **Pagination**: list endpoints return pages of a fixed 100 items. Follow
    `_next`; it is an empty string on the last page.

    - **Unknown query parameters**: list endpoints answer `_status: INVALID`;
    detail endpoints ignore them.

    - **Dates** are `YYYY-MM-DD`. **Timestamps** are `YYYY-MM-DD HH:MM:SS`
    (space separator, no timezone, server local time), unless stated otherwise.

    - `_self`, `_schema`, `_next` and the other resource links are root-relative
    paths (`/restapi/v1/...`).

    - Empty text fields are returned as `""`; empty email fields as `null`.


    ## Versioning

    Current version: 1.20


    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:
  /application/{applicationid}/email-preview:
    get:
      tags:
        - Applications
      summary: Preview a recorded template on an application
      description: >-
        Renders a recorded template on the application — subject and HTML body
        with the real keywords, exactly as send-email would produce them —
        without sending anything. Same access rules as send-email. A missing
        `template_id` answers 200 `_status: INVALID`.
      operationId: previewApplicationEmail
      parameters:
        - name: applicationid
          in: path
          required: true
          description: Application ID
          schema:
            type: integer
        - name: template_id
          in: query
          required: true
          description: Template to render.
          schema:
            type: integer
      responses:
        '200':
          description: Rendered template
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      _status:
                        type: string
                        enum:
                          - OK
                      application_id:
                        type: integer
                        description: ID of the application previewed.
                      template_id:
                        type: integer
                        description: ID of the rendered template.
                      subject:
                        type: string
                        description: Subject with keywords expanded.
                      body:
                        type: string
                        description: HTML body with keywords expanded.
                      from_email:
                        type: string
                        description: Address the email would be sent as.
                      to_email:
                        type: string
                        description: Candidate address the email would go to.
                  - $ref: '#/components/schemas/InvalidResponse'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: >-
            Application not visible or not editable (default jobs included), or
            the template is unknown, of another organisation, or not an email
            template.
components:
  schemas:
    InvalidResponse:
      type: object
      description: Answered with HTTP 200 when parameters or body fail validation.
      properties:
        _status:
          type: string
          enum:
            - INVALID
        invalid:
          type: object
          description: >-
            One entry per invalid field; the key `""` holds errors not tied to a
            field (e.g. an unexpected parameter). `message` is an object or an
            array for nested fields.
          additionalProperties:
            type: object
            properties:
              code:
                type: string
                nullable: true
                description: Always null.
              message:
                oneOf:
                  - type: string
                  - type: object
                  - type: array
                    items: {}
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      headers:
        WWW-Authenticate:
          schema:
            type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Authentication with API credentials

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.