---
title: "Apply the post-tax-filing lock to an assigned customer's closed GL period (irreversible)"
method: POST
path: "/accountant/companies/{customerId}/gl-periods/{periodId}/file-lock"
tags: ["GL Periods"]
---

# Apply the post-tax-filing lock to an assigned customer's closed GL period (irreversible)

`POST /accountant/companies/{customerId}/gl-periods/{periodId}/file-lock`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/gl-periods/{periodId}/file-lock`
- Auth: HTTP bearer

Marks a closed period immutable after its tax return was filed
elsewhere. It does not submit or verify a return. Irreversible: there is
no unlock. Writes an audit_logs entry (action `file-lock`) with the
actor and time.

Requires accountant access to the customer AND the company admin/owner
role that `/companies/{companyId}/gl-periods/{id}/file-lock` requires;
assignment alone is not enough (#2104). Signed-in humans only: API keys
get 403 and the service principal gets 404.

## Response `200`

Period filing-locked

- GlPeriodResponse
  - `success` boolean
  - `data` GlPeriod
    - `id` string, uuid
    - `companyId` string, uuid
    - `startDate` string, date
    - `endDate` string, date
    - `status` 'open' | 'closed'
    - `closedAt` string, date-time, nullable
    - `closedByUserId` string, uuid, nullable
    - `filingLockedAt` string, date-time, nullable
    - `filingLockedByUserId` string, uuid, nullable

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: GL period not found for this customer
- `422`: Period is not closed, or is already filing-locked.

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
