# Contract

## Download the OpenAPI definition

**get** `/v1/openapi.yaml`

Downloads this API's OpenAPI 3.1 definition, served as
`application/yaml`. It is the authority for request and response shapes
and error codes; the guide carries the semantics a spec cannot express,
such as consent gating and turn-taking.

### Example

```http
curl https://messages.api.linqapp.com/v1/openapi.yaml \
    -H "Authorization: Bearer $LINQ_AMB_API_KEY"
```

## Get a part type's JSON Schema

**get** `/v1/parts/{type}`

Fetch one part type's JSON Schema (2020-12) BYTE-VERBATIM: the same
Retrieves one part type's JSON Schema (2020-12), served as
`application/schema+json`; ready to hand to a structured-output model
as a tool schema.

**Behavior**

- The schema is deliberately wider than the API: rules JSON Schema
  cannot express (length caps, item counts, casing) are enforced when
  you send, and a violation returns HTTP 422 naming the exact field.

**Errors**

- HTTP 404 `code` 2037: unknown part type.

### Path Parameters

- `type: string`

### Example

```http
curl https://messages.api.linqapp.com/v1/parts/$TYPE \
    -H "Authorization: Bearer $LINQ_AMB_API_KEY"
```

## Domain Types

### Contract OpenAPI Response

- `ContractOpenAPIResponse = string`

### Contract Part Schema Response

- `ContractPartSchemaResponse = string`
