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

# client.listAssessments()

> List all assessment templates configured for your organisation. Use this to build an assessment picker UI.

<Info>
  This is a **Backend SDK method**, not an HTTP endpoint.
</Info>

## Signature

<CodeGroup>
  ```typescript Node.js theme={null}
  client.listAssessments(): Promise<Assessment[]>
  ```

  ```python Python theme={null}
  client.list_assessments()
  ```
</CodeGroup>

No parameters required.

***

## Return value

Returns an array / list of assessment template objects.

<ResponseField name="assessmentId" type="string">
  Unique identifier for the assessment template.
</ResponseField>

<ResponseField name="name" type="string">
  Display name of the assessment (e.g. `"Full Stack Developer Assessment"`).
</ResponseField>

<ResponseField name="skills" type="string[]">
  Skills this assessment tests (e.g. `["JavaScript", "React", "Node.js"]`).
</ResponseField>

<ResponseField name="totalMarks" type="number">
  Total marks available (always `100`).
</ResponseField>

<ResponseField name="passMarks" type="number">
  Minimum marks required to pass.
</ResponseField>

<ResponseField name="durationMinutes" type="number">
  Time limit for the assessment in minutes.
</ResponseField>

***

<RequestExample>
  ```typescript List and display (Node.js) theme={null}
  const assessments = await client.listAssessments();

  assessments.forEach(a => {
    console.log(`${a.name} — ${a.durationMinutes} min, pass at ${a.passMarks}/${a.totalMarks}`);
  });
  ```

  ```python List and display (Python) theme={null}
  assessments = client.list_assessments()

  for a in assessments:
      print(f"{a['name']} — {a['durationMinutes']} min, pass at {a['passMarks']}/{a['totalMarks']}")
  ```

  ```typescript API endpoint for frontend (Node.js) theme={null}
  app.get('/assessments', yourAuthMiddleware, async (req, res) => {
    const client = new AssessmentClient({
      apiKey:    process.env.ASSESSMENT_API_KEY,
      secretKey: process.env.ASSESSMENT_SECRET_KEY,
    });

    const assessments = await client.listAssessments();
    res.json({ success: true, data: assessments });
  });
  ```

  ```python API endpoint for frontend (Python — FastAPI) theme={null}
  from fastapi import FastAPI
  from smartai_assessment_backend import AssessmentClient
  import os

  app = FastAPI()
  client = AssessmentClient(
      api_key=os.getenv("ASSESSMENT_API_KEY"),
      secret_key=os.getenv("ASSESSMENT_SECRET_KEY"),
  )

  @app.get("/assessments")
  def list_assessments():
      assessments = client.list_assessments()
      return {"success": True, "data": assessments}
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  [
    {
      "assessmentId": "asmt_xyz789",
      "name": "Full Stack Developer Assessment",
      "skills": ["JavaScript", "React", "Node.js", "MongoDB"],
      "totalMarks": 100,
      "passMarks": 60,
      "durationMinutes": 60
    },
    {
      "assessmentId": "asmt_abc123",
      "name": "Data Analyst Assessment",
      "skills": ["Python", "SQL", "Pandas", "Data Visualisation"],
      "totalMarks": 100,
      "passMarks": 65,
      "durationMinutes": 45
    }
  ]
  ```
</ResponseExample>
