---
title: "CreateSpecBody"
description: "Request body for creating a Spec."
section: "Reference"
group: "Types"
order: 206
---

## Definition

```ts
interface CreateSpecBody {
  workspaceId: string;
  name: string;
  sourceUrl: string;
  autoCreateSolution: boolean;
  description?: string | undefined;
  baseUrl?: string | undefined;
  authHeaderName?: string | undefined;
  authValuePrefix?: string | undefined;
  authSecretId?: string | undefined;
  solutionId?: string | undefined;
}
```

## Fields

| Field                | Type                  | Notes                                                                                                                                                                                                                        |
| -------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `workspaceId`        | `string`              | `required` — Workspace that will own the new spec.                                                                                                                                                                           |
| `name`               | `string`              | `required` — Spec name.                                                                                                                                                                                                      |
| `sourceUrl`          | `string`              | `required` — URL to fetch the OpenAPI spec from.                                                                                                                                                                             |
| `autoCreateSolution` | `boolean`             | `required` — If true (default), auto-create a solution named after the spec and wrap generated entities in it. Set false to leave generated entities unwrapped, or pass `solutionId` to add to an existing solution instead. |
| `description`        | `string \| undefined` | `optional` — Optional longer-form description.                                                                                                                                                                               |
| `baseUrl`            | `string \| undefined` | `optional` — Override for the spec's `servers[]` base URL.                                                                                                                                                                   |
| `authHeaderName`     | `string \| undefined` | `optional` — HTTP header to set with the API key value when invoking generated functions (e.g. `Authorization`).                                                                                                             |
| `authValuePrefix`    | `string \| undefined` | `optional` — Prefix to prepend to the secret value (e.g. `Bearer `).                                                                                                                                                         |
| `authSecretId`       | `string \| undefined` | `optional` — Workspace secret ID holding the API key. Required if `authHeaderName` is set.                                                                                                                                   |
| `solutionId`         | `string \| undefined` | `optional` — Existing solution to add generated entities to. Mutually exclusive with `autoCreateSolution`.                                                                                                                   |
