---
title: "Create an Analytical General Ledger export"
method: POST
path: "/api/external/v2/exports/analytical_general_ledgers"
tags: ["Exports"]
---

# Create an Analytical General Ledger export

`POST /api/external/v2/exports/analytical_general_ledgers`

## Request

- Base URL: `https://app.pennylane.com`
- URL: `https://app.pennylane.com/api/external/v2/exports/analytical_general_ledgers`
- Auth: OAuth 2
  - Authorization code: `https://app.pennylane.com/oauth/authorize`
  - Token URL: `https://app.pennylane.com/oauth/oauth/token` scopes: `exports:agl`

This endpoint allows you to create an Analytical General Ledger export. The generated export file is an xlsx file, using the in-line analytical mode by default.

> ℹ️
> This endpoint requires the following scope: `exports:agl`

## Headers

- `X-Company-Id` string

## Request body

- object
  - `period_start` string, date, required: Start date of the period to export
  - `period_end` string, date, required: End date of the period to export
  - `mode` 'in_line' | 'in_column': The mode of the export. The export can be in lines or in columns. If this parameter is not provided, it will use the default `in_line` mode.

## Response `201`

Returns the generated export status

- object
  - `id` integer, required: ID of the export
  - `status` 'pending' | 'ready' | 'error', required: The state of the export
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access to this resource forbidden
- `404`: The resource was not found

## Changes

- **2026-11-03** `871f863307e5`: 1 info
  - added the new optional `header` request parameter `X-Company-Id`

[Operation history](https://skmtc.dev/pennylane/apis/company-v2/changes/api/external/v2/exports/analytical_general_ledgers/post.md)

---

[API](https://skmtc.dev/pennylane/apis/company-v2.md) - [All operations](https://skmtc.dev/pennylane/apis/company-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/pennylane/apis/company-v2/revisions/871f863307e5?raw)
