# Versioning

Arche has two distinct kinds of versioning:

- API versioning, such as `/v1`
- data versioning: which filing a statement came from, and point-in-time retrieval

## API versioning

The public contract documented here is versioned under `/v1`.

```text
/v1/edgar/companies:resolve
/v1/edgar/companies/{cik}/statements
/v1/edgar/as-of/{date}/financials/{cik}
```

Treat an API version change as explicit upgrade work.

## Statements by filing

Each SEC filing's statement is kept as filed. When a later filing amends,
corrects or restates a period, Arche keeps both: the earlier filing's statement
and the later one, each identified by its own filing.

A statement is identified by:

- `cik`
- `statement_type`
- `fiscal_year`
- `fiscal_period`
- `accession_id` — the SEC accession number of the filing

`accepted_at` orders the filings for a period, and `is_restated` marks a
statement that restated an earlier filing's figures.

## Latest vs as_of

Use a latest-style collection route when you want the most current known state:

```http
GET /v1/edgar/companies/{cik}/statements?statement_type=INCOME_STATEMENT
```

Use an `as_of` route when the question is historical:

```http
GET /v1/edgar/as-of/{date}/financials/{cik}
```

> **Tip:** If the answer must reflect what was knowable on a past decision date, default to
> `as_of` retrieval rather than the latest available statement.

## Restatements

A restatement adds another filing's statement for the same reporting period.

Use the restatement timeline route to see every filing for a period in order:

```http
GET /v1/edgar/companies/{cik}/statements/restatement-timeline?statement_type=INCOME_STATEMENT&fiscal_year=2023&fiscal_period=FY
```

That route is the cleanest way to answer:

- when a value changed
- which filing introduced the change
- whether a query result would differ on a different date

## Next steps

- [Concepts](https://docs.arche.fi/concepts): Understand point-in-time retrieval, restatements, and deterministic datasets.
- [Data model](https://docs.arche.fi/data-model): Learn how companies, filings and statements relate.
- [Request & response conventions](https://docs.arche.fi/request-response-conventions): Response envelopes, timestamps, nullability, ordering, and field conventions.
