# Create app

Create an app, website or newsletter from a name, description, installed template, or built-in example. Returns a content ID and its Brigg URL. Content type, reusable and private options apply only when creating blank content; a clone keeps its source classification.

POST https://api.brigg.app/v1/operations/documents.CreateApp

## Access & visibility

Allow `documents.CreateApp` on your API key.

**Acting member required.** Send `Brigg-Act-As` with an [approved member account ID](https://developer.brigg.app/authentication#member-delegation). The key supplies permissions; the member selects whose data is used.

The selected member must be active and approved by the credential. This selects whose private data is used; the credential supplies permissions. Private ownership and project boundaries still apply.

[Set up authentication](https://developer.brigg.app/authentication) · [Choose permissions](https://developer.brigg.app/permissions)

## Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | The new bundle's display name. With a clone it overrides the source's label. At least 1 character. At most 200 characters. |
| `description` | string | No | What to build — mints a blank bundle for a builder to fill in. At least 1 character. At most 2000 characters. |
| `icon` | string | No | A sidebar icon from the curated catalog, on a blank mint. Allowed: `"default"`, `"home"`, `"users"`, `"shield"`, `"trophy"`, `"headphones"`, `"briefcase"`, `"award"`, `"building"`, `"scale"`, `"rocket"`, `"calendar"`, `"checklist"`, `"folder"`, `"graph"`, `"lightbulb"`, `"money"`, `"package"`, `"phone"`, `"puzzle"`, `"star"`, `"tag"`, `"cloud"`, `"globe"`, `"clock"`, `"receipt"`, `"book"`, `"chat"`, `"funnel"`, `"kanban"`, `"ticket"`. |
| `content_type` | string | No | Media type of the file, such as application/pdf. Null when no binary file exists. Allowed: `"app"`, `"website"`, `"newsletter"`. |
| `example_id` | string | No | Clone this built-in example (a `list_examples` slug). At least 1 character. At most 80 characters. |
| `template_catalog_id` | string | No | Instantiate this installed template — its authoring slug (`list_templates` → `installed[].parent_template_slug`). At least 1 character. At most 80 characters. |
| `reusable` | boolean | No | Blank mint only: a reusable template (hidden from the menu) rather than a one-off. |
| `private` | boolean | No | Blank mint only: private to the caller (a signing document belongs to one person until signed). |

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `content_id` | string | Yes | Opaque ID from workspace.ListBundles. Its kind distinguishes apps, websites, newsletters, documents, templates and integrations; it is not an uploaded file ID. |
| `label` | string | Yes | Human-readable name for this content or saved version. |
| `url` | string | Yes | Absolute URL, including its scheme. |
| `version_id` | string or null | Yes | The version a clone's bytes were written to; null on a blank mint. |

## Errors & retries

Set `BRIGG_REQUEST_ID` once for each logical action. The samples send it as `Idempotency-Key`. Reuse the same value and body on retries, including after a timeout; a missing response does not prove the action failed.

For rate limits, follow the server’s retry guidance and back off. See [HTTP errors](https://developer.brigg.app/http#errors) and [safe retries and limits](https://developer.brigg.app/reliability).

| HTTP status | Code | What to do |
| --- | --- | --- |
| 400 | `invalid_json` | Send a JSON object with Content-Type: application/json. |
| 400 | `invalid_input` | Check the request fields and types. Supply a stable Idempotency-Key containing 1–200 characters. |
| 401 | `invalid_key` | The workspace API key is missing, invalid or revoked. |
| 403 | `forbidden` | Check the key’s operation and resource grants. Supply Brigg-Act-As with a member authorized by the key’s delegation grant. The selected member must be active and approved by the credential. This selects whose private data is used; the credential supplies permissions. Private ownership and project boundaries still apply. |
| 404 | `not_found` | The requested operation or resource is not available to this credential. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. Reuse the original Idempotency-Key. |

## Next steps

- [Upload and download files](https://developer.brigg.app/files)

[Download OpenAPI](https://developer.brigg.app/openapi.json) · [Versioning & retirement](https://developer.brigg.app/versioning)

## Examples

### Example request

Fictional values. Replace IDs and business details with values from your workspace.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/documents.CreateApp' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Brigg-Act-As: $BRIGG_ACT_AS" \
  -H "Idempotency-Key: $BRIGG_REQUEST_ID" \
  --data-raw '{}'
```

#### TypeScript


```typescript
const actAs = process.env.BRIGG_ACT_AS;
if (!actAs) throw new Error("Set BRIGG_ACT_AS to an approved member account ID.");

const requestId = process.env.BRIGG_REQUEST_ID;
if (!requestId) throw new Error("Set BRIGG_REQUEST_ID once per action and reuse it on retries.");

const response = await fetch("https://api.brigg.app/v1/operations/documents.CreateApp", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
    "Brigg-Act-As": actAs,
    "Idempotency-Key": requestId, // Create once per action; reuse on retries.
  },
  body: JSON.stringify({}),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

request_id = os.environ["BRIGG_REQUEST_ID"]  # Reuse for retries of this action.
payload = {}
request = Request(
    "https://api.brigg.app/v1/operations/documents.CreateApp",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
        "Brigg-Act-As": os.environ["BRIGG_ACT_AS"],
        "Idempotency-Key": request_id,  # Create once per action; reuse on retries.
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "content_id": "e_example",
  "label": "Consulting proposal",
  "url": "https://example.com",
  "version_id": null
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The new bundle's display name. With a clone it overrides the source's label."
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000,
      "description": "What to build — mints a blank bundle for a builder to fill in."
    },
    "icon": {
      "type": "string",
      "enum": [
        "default",
        "home",
        "users",
        "shield",
        "trophy",
        "headphones",
        "briefcase",
        "award",
        "building",
        "scale",
        "rocket",
        "calendar",
        "checklist",
        "folder",
        "graph",
        "lightbulb",
        "money",
        "package",
        "phone",
        "puzzle",
        "star",
        "tag",
        "cloud",
        "globe",
        "clock",
        "receipt",
        "book",
        "chat",
        "funnel",
        "kanban",
        "ticket"
      ],
      "description": "A sidebar icon from the curated catalog, on a blank mint."
    },
    "content_type": {
      "type": "string",
      "enum": [
        "app",
        "website",
        "newsletter"
      ],
      "description": "Media type of the file, such as application/pdf. Null when no binary file exists."
    },
    "example_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "Clone this built-in example (a `list_examples` slug)."
    },
    "template_catalog_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "Instantiate this installed template — its authoring slug (`list_templates` → `installed[].parent_template_slug`)."
    },
    "reusable": {
      "type": "boolean",
      "description": "Blank mint only: a reusable template (hidden from the menu) rather than a one-off."
    },
    "private": {
      "type": "boolean",
      "description": "Blank mint only: private to the caller (a signing document belongs to one person until signed)."
    }
  },
  "additionalProperties": false,
  "examples": [
    {}
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "content_id": {
      "type": "string",
      "description": "Opaque ID from workspace.ListBundles. Its kind distinguishes apps, websites, newsletters, documents, templates and integrations; it is not an uploaded file ID."
    },
    "label": {
      "type": "string",
      "description": "Human-readable name for this content or saved version."
    },
    "url": {
      "type": "string",
      "description": "Absolute URL, including its scheme."
    },
    "version_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The version a clone's bytes were written to; null on a blank mint."
    }
  },
  "required": [
    "content_id",
    "label",
    "url",
    "version_id"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "content_id": "e_example",
      "label": "Consulting proposal",
      "url": "https://example.com",
      "version_id": null
    }
  ]
}
```

