# Endpoint overview

> Every v1 endpoint, what it answers, and the conventions they share.

Every v1 endpoint is under `https://www.vestiarion.xyz/api/v1`, authenticated with a [workspace API key](https://www.vestiarion.xyz/docs/get-started/authentication) sent as `Authorization: Bearer <key>`, and reaches only that key's workspace. A `GET` reads. A `POST` adds a counterparty, an invoice or a milestone, or makes a payee link, with a key that has [write access](https://www.vestiarion.xyz/docs/get-started/authentication#scopes), and answers `201` with the record: shaped as its list returns it, or for a payee link, the link. A response carries its result in `data`: one object, or for a collection an array, beside `page` with `nextCursor`, `hasMore` and `count` for [paging](https://www.vestiarion.xyz/docs/get-started/pagination). A failure answers `{ "error": { "code", "message" } }` with one of the [error codes](https://www.vestiarion.xyz/docs/get-started/errors). The same endpoints are published as an [OpenAPI 3.1 document](https://www.vestiarion.xyz/api/v1/openapi.json). In TypeScript, the [TypeScript SDK](https://www.vestiarion.xyz/docs/get-started/sdk) gives each one a typed method.

**Workspace**

| Endpoint | Summary |
| --- | --- |
| [`GET /api/v1/status`](https://www.vestiarion.xyz/docs/api/get-status) | Get workspace status |

**Ledger**

| Endpoint | Summary |
| --- | --- |
| [`GET /api/v1/ledger`](https://www.vestiarion.xyz/docs/api/list-ledger-entries) | List ledger entries |
| [`GET /api/v1/ledger/verify`](https://www.vestiarion.xyz/docs/api/verify-ledger) | Verify the ledger |

**Payables and receivables**

| Endpoint | Summary |
| --- | --- |
| [`GET /api/v1/invoices`](https://www.vestiarion.xyz/docs/api/list-invoices) | List invoices |
| [`POST /api/v1/invoices`](https://www.vestiarion.xyz/docs/api/create-invoice) | Add an invoice |

**Counterparties**

| Endpoint | Summary |
| --- | --- |
| [`GET /api/v1/counterparties`](https://www.vestiarion.xyz/docs/api/list-counterparties) | List counterparties |
| [`GET /api/v1/counterparties/{id}`](https://www.vestiarion.xyz/docs/api/get-counterparty) | Get a counterparty |
| [`POST /api/v1/counterparties`](https://www.vestiarion.xyz/docs/api/create-counterparty) | Add a counterparty |
| [`POST /api/v1/payee-links`](https://www.vestiarion.xyz/docs/api/create-payee-link) | Create a payee link |

**Milestones**

| Endpoint | Summary |
| --- | --- |
| [`GET /api/v1/milestones`](https://www.vestiarion.xyz/docs/api/list-milestones) | List milestones |
| [`POST /api/v1/milestones`](https://www.vestiarion.xyz/docs/api/create-milestone) | Add a milestone |

**Treasury**

| Endpoint | Summary |
| --- | --- |
| [`GET /api/v1/treasury`](https://www.vestiarion.xyz/docs/api/get-treasury) | Get the treasury |

**Insights**

| Endpoint | Summary |
| --- | --- |
| [`GET /api/v1/insights`](https://www.vestiarion.xyz/docs/api/get-insights) | Get insights |
