# Periods library

`GET https://api.endless.app/library/periods`

Source: https://endless.app/docs/api/library/periods

Periods library.

## Authentication

- `apiKey`: HTTP bearer (esk_live_…)
- `clerkSession`: HTTP bearer (JWT)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `organization_id` | query | string | yes |  |
| `types` | query | string | no |  |
| `kinds` | query | string | no |  |
| `created_by` | query | string | no |  |
| `models` | query | string | no |  |
| `origins` | query | string | no |  |
| `include_chat_uploads` | query | boolean | no |  |
| `project_ids` | query | string | no |  |
| `conversation_ids` | query | string | no |  |
| `canvas_ids` | query | string | no |  |
| `since` | query | string | no |  |
| `until` | query | string | no |  |
| `search` | query | string | no |  |
| `granularity` | query | "year" \| "month" | yes |  |
| `time_zone` | query | string | yes |  |
| `Endless-Api-Version` | header | string | no | Pin the caller to an API major (`1`). Omit to accept the current version. A major this deployment cannot serve is refused with 400 `unsupported_api_version`. |

## Responses

### 200 OK

Content type: `application/json` — object

- `periods` (array<object>, required)
  - `period` (string, required)
  - `starts_at` (string, required)
  - `ends_at` (string, required)
  - `count` (integer, required)
  - `cover` (object | null, required)
    - `id` (string (uuid), required)
    - `organization_id` (string, required)
    - `created_by_id` (string, required)
    - `type` ("image" | "video" | "audio" | "document" | "text" | "transcript" | "3d", required)
    - `title` (string | null, required)
    - `mime_type` (string | null, required)
    - `url` (string | null, required)
    - `object_key` (string | null, required)
    - `content` (string | null, required)
    - `upload_file_state` ("in_progress" | "success" | "error" | null, required)
    - `enrichment_state` ("ignored" | "pending" | "in_progress" | "success" | "error" | null, required)
    - `visibility` ("private" | "workspace" | "public", required)
    - `workspace_role` ("viewer" | "editor" | "manager" | "owner", required)
    - `color` ("red" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "gray" | null, required)
    - `metadata` (string | number | boolean | null | object | array<any | null> | null, required)
    - `generation_id` (string (uuid) | null, required)
    - `origin_conversation_id` (string (uuid) | null, required)
    - `origin_canvas_id` (string (uuid) | null, required)
    - `uploaded_from` ("library" | "chat" | "canvas" | "generate" | "project" | "element" | "voice" | "onboarding" | "mcp" | "api" | null, required)
    - `mod_transcript_id` (string | null, required)
    - `mod_asset_id` (string | null, required)
    - `mod_source_id` (string | null, required)
    - `dual_media_id` (string | null, required)
    - `deleted_at` (string (date-time) | null, required)
    - `deleted_by_id` (string | null, required)
    - `created_at` (string (date-time), required)
    - `updated_at` (string (date-time), required)
    - `linked_conversation_id` (string | null)
    - `shared` (boolean)
    - `can_edit` (boolean)
    - `can_delete` (boolean)

### Errors

- `400` (Error): The request is malformed, or failed input validation. `message` names the field and the rule it broke; `data.issues` carries them individually.
- `401` (Error): No bearer token, or a token that failed verification.
- `402` (Error): The workspace has no credits left, or the caller is over a spending limit.
- `403` (Error): Authenticated, but the caller's role in this workspace does not carry the permission this operation needs.
- `409` (Error): The request is well-formed, but the resource's current state forbids it — a taken name, a last admin, a limit already reached.
- `429` (Error): The caller has spent its rate-limit window. `Retry-After` says when to come back.
- `500` (Error): The request failed on our side. Safe to retry an idempotent operation with backoff.
