# Quickstart

Source: https://capacms.com/docs/get-started/quickstart

Create a model, publish an entry, make a key and read it with curl. About five minutes.

By the end of this page you will have one published entry and a `curl` command that reads it from Capa's CDN.

You need a Capa account. Sign in at [app.capacms.com](https://app.capacms.com).

<Steps>
  <Step>
    ### Create a project [#create-a-project]

    A project holds one site's models, entries, media and keys.

    1. On **Projects**, choose **Create project**.
    2. Enter a **Project name**, such as `Northpeak Outdoor`.
    3. Choose **Create**.

    Capa opens the new project. Already have a project? Open it and skip this step.
  </Step>

  <Step>
    ### Create a model [#create-a-model]

    A model is a content type, such as an article or a product.

    1. Choose **Models** in the sidebar, then **New model**.
    2. Enter `Article` in **Unique Model Name**. The **Namespace** fills in as `article`. That is the name the API uses.
    3. Choose **Create Model**.

    Every new model starts with a `title` field.
  </Step>

  <Step>
    ### Add a field [#add-a-field]

    1. Open the model's row menu and choose **Edit fields**.
    2. Under the card of fields, choose **Add field**, then **Rich Text**.
    3. In the field's settings, set **Name** to `Body`. Its namespace becomes `body`.
    4. Choose **Done**, then **Save fields** in the top bar.

    Fields are saved only when you choose **Save fields**.
  </Step>

  <Step>
    ### Write and publish an entry [#write-and-publish-an-entry]

    1. Choose **Content** in the sidebar, then **New content**, then **Article**.
    2. Fill in **Title** and **Body**.
    3. Choose **Publish**.

    **Publish** saves and publishes in one step. **Save draft** saves without publishing, and a production key never sees a draft.
  </Step>

  <Step>
    ### Create a key [#create-a-key]

    1. Open **Developers > Keys** and choose **New key**.
    2. Set **Name** to `Website`.
    3. Leave **Environment** on **Production**.
    4. Under **Grants**, choose **Read only**.
    5. Choose **Create key**, and copy the key.

    <Callout type="warn">
      The key is shown once. Capa stores it hashed and cannot show it again. If you lose it, rotate the key.
    </Callout>
  </Step>

  <Step>
    ### Read it [#read-it]

    Put the key in an environment variable, then read the model's entries:

    ```bash
    export CAPA_KEY=cap_live_...

    curl "https://cdn.capacms.com/api/entries/article?select=title,body" \
      -H "x-api-key: $CAPA_KEY" \
      -H "Capa-Version: 2026-10-01"
    ```

    You get your entry back:

    ```json
    { "data": [
        { "id": "…3a", "model": "article", "status": "published",
          "fields": { "title": "Winter Field Guide 2026: Layering Above Treeline",
                      "body": "The cherries came in late this year…" } } ],
      "page": { "limit": 25, "hasNext": false, "next": null, "hasPrev": false, "prev": null },
      "meta": { "version": "2026-10-01", "contract": 1, "environment": "production", "requestId": "req_0f3c…" } }
    ```
  </Step>
</Steps>

## What just happened

* `article` in the URL is the model's namespace.
* `select` chose two fields. Without it you get every field.
* The response came from Capa's CDN. When you publish a change, Capa purges the cached copy, and the next read gets the new version.
* `Capa-Version` pins the shape of the response. See [Versions](https://capacms.com/docs/concepts/versions).

## Something went wrong?

| You got                            | It means                                                                                       |
| ---------------------------------- | ---------------------------------------------------------------------------------------------- |
| `401 missing_key` or `invalid_key` | The `x-api-key` header is missing, or the key is wrong. Copy it again, or rotate it.           |
| `404 model_not_found`              | No model with that namespace, or the key cannot read it. Check the namespace under **Models**. |
| `"data": []`                       | The entry is a draft. Publish it, or read with a draft key.                                    |

Every error has its own page under [Errors](https://capacms.com/docs/errors).

## Next

* [Next.js](https://capacms.com/docs/get-started/nextjs): show this entry on a site.
* [Content model](https://capacms.com/docs/concepts/content-model): field types and relations.
* [Any language with fetch](https://capacms.com/docs/guides/fetch): filters, sorting and paging.
