> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.gracehill.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.gracehill.com/_mcp/server.

# List assignments

GET https://api.gracehill.com/v1/assignments

Open training assignments for your active employees, matching the Training Assignment and Exceptions - Overdue Assignments reports in PerformanceHQ. Self-assigned (book bag) items are excluded unless you set filter[assignmentType] to self_assigned or all. Due status is computed against the current UTC date: overdue (past due), due_soon (due today through 7 days), upcoming (more than 7 days), no_due_date. To reproduce the Training Assignment report use filter[dueWithinDays]=7; to reproduce the Overdue Assignments report use filter[dueStatus]=overdue (that report also omits assignments on sub-trainings such as ILT sessions, which this endpoint returns). employeeId is the join key to /v1/employees and /v1/completions.

Reference: https://developer.gracehill.com/api-reference/list-assignments

## Authentication

- `Authorization` header (bearer token, required) — Customer API key (ghk_…). Your organization's System Admins create keys on the PHQ Integrations page; a key is shown once. Send it as `Authorization: Bearer ghk_…`.

## Request

### Query parameters

- `page[number]` (integer, optional, default: 1) — 1-based page number.
- `page[size]` (integer, optional, default: 50) — Page size (max 200).
- `filter[assignmentType]` (enum, optional, default: assigned) — assigned (default), self_assigned, or all.
  - Allowed values: `assigned`, `self_assigned`, `all`
- `filter[dueStatus]` (string, optional) — overdue, due_soon, upcoming, no_due_date; comma-separated list.
- `filter[dueWithinDays]` (integer, optional) — Due between today and today + N days.
- `filter[trainingType]` (string, optional) — online, ilt, policy, other; comma-separated list.
- `filter[training]` (string, optional) — trainingId; comma-separated list.
- `filter[group]` (string, optional) — Group id or name (use -1 for employees in no group).
- `filter[location]` (string, optional) — customerLocationId; comma-separated list.
- `filter[position]` (string, optional) — customerPositionId; comma-separated list.
- `filter[employeeId]` (string, optional) — Exact employee ID; comma-separated list.

## Response

### 200

A page of open assignments.

- `data` (list of Assignment, required)
- `meta` (AssignmentsPageMeta, required)

## Errors

### 400 Bad Request Error

Invalid filter value.

- `any`

### 401 Unauthorized Error

Missing, invalid, expired, or revoked API key.

- `errors` (list of ErrorResponseErrorsItems, required)

### 403 Forbidden Error

The Customer API isn't enabled for your account (customer_api_not_enabled), your plan lacks a required product (product_not_in_plan), or API access for your account has been disabled (access_disabled).

- `errors` (list of ErrorResponseErrorsItems, required)

### 429 Too Many Requests Error

rate_limited: your account exceeded its request rate limit; retry after Retry-After seconds. quota_exceeded: your account used its daily request quota; the quota resets at 00:00 UTC.

- `errors` (list of ErrorResponseErrorsItems, required)

### 503 Service Unavailable Error

query_timeout: the request took too long (the database stops each query after 4 seconds). Narrow the date range or filters, or use a smaller page size. Retry no sooner than Retry-After; repeats of a request whose count just timed out return 503 immediately for about a minute.

- `errors` (list of ErrorResponseErrorsItems, required)

## Types

### Assignment

- `id` (string, optional) — Stable id for this assignment instance (a re-assigned training gets a new id).
- `employeeId` (string, optional, nullable) — Unique within your organization; the join key to /v1/employees and /v1/completions.
- `firstName` (string, optional, nullable)
- `lastName` (string, optional, nullable)
- `positionName` (string, optional, nullable)
- `customerPositionId` (string, optional, nullable)
- `locationName` (string, optional, nullable)
- `customerLocationId` (string, optional, nullable)
- `trainingId` (string, optional) — Use with filter[training].
- `trainingTitle` (string, optional, nullable)
- `trainingType` (enum, optional)
  - Allowed values: `Online Course`, `Instructor-Led`, `Policy`, `Other`
- `dueDate` (date, optional, nullable)
- `daysUntilDue` (integer, optional, nullable) — Negative when overdue; null when there is no due date.
- `dueStatus` (enum, optional)
  - Allowed values: `overdue`, `due_soon`, `upcoming`, `no_due_date`
- `assignmentType` (enum, optional) — Administrator-assigned vs. self-assigned (book bag).
  - Allowed values: `assigned`, `self_assigned`
- `assignedVia` (enum, optional, nullable) — How an assigned item was assigned; null when self-assigned.
  - Allowed values: `position`, `individual`, `location`, `group`, `special`, `learning_path`, `enrolled`, `validate`, `other`

### AssignmentsPageMeta

- `page` (AssignmentsPageMetaPage, optional)

### ErrorResponseErrorsItems

- `status` (string, required)
- `code` (enum, required)
  - Allowed values: `unauthorized`, `customer_api_not_enabled`, `product_not_in_plan`, `access_disabled`, `forbidden`, `invalid_parameter`, `not_found`, `rate_limited`, `quota_exceeded`, `query_timeout`
- `title` (string, required)
- `detail` (string, required)

### AssignmentsPageMetaPage

- `number` (integer, optional)
- `size` (integer, optional)
- `totalCount` (integer, optional)
- `totalPages` (integer, optional)

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "string",
      "employeeId": "string",
      "firstName": "string",
      "lastName": "string",
      "positionName": "string",
      "customerPositionId": "string",
      "locationName": "string",
      "customerLocationId": "string",
      "trainingId": "string",
      "trainingTitle": "string",
      "trainingType": "Online Course",
      "dueDate": "2023-01-15",
      "daysUntilDue": 1,
      "dueStatus": "overdue",
      "assignmentType": "assigned",
      "assignedVia": "position"
    }
  ],
  "meta": {
    "page": {
      "number": 1,
      "size": 50,
      "totalCount": 318,
      "totalPages": 7
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.gracehill.com/v1/assignments"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.gracehill.com/v1/assignments';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.gracehill.com/v1/assignments"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.gracehill.com/v1/assignments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.gracehill.com/v1/assignments")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.gracehill.com/v1/assignments', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.gracehill.com/v1/assignments");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.gracehill.com/v1/assignments")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```