# First steps with curl

Check your key, list ideas, create one, vote and comment with the REST API, step by step with curl.

This guide calls the REST API with `curl`. You need a [secret API key](https://docs.feedzzie.com/api/keys/) with the `write` scope; the last two steps need `admin`.

Every endpoint is under `https://feedzzie.com/api/v1`, and every answer is JSON.

## 1. Save your key

So the key does not end up in your shell history, read it into a variable:

```bash
read -rs FEEDZZIE_API_KEY && export FEEDZZIE_API_KEY
```

Paste the key and press Enter.

## 2. Check the key

```bash
curl -s https://feedzzie.com/api/v1/me \
  -H "Authorization: Bearer $FEEDZZIE_API_KEY"
```

The answer names the key, its scopes, your organization and its plan:

```json
{
  "data": {
    "key": {
      "id": "4f99eede-8c53-4803-86f4-7d5895345b8e",
      "name": "support-sync",
      "type": "secret",
      "prefix": "fz_live_0671c3d0",
      "created_at": "2026-11-25T18:43:57.839883+00:00",
      "expires_at": "2027-02-23T18:43:57.765+00:00",
      "last_used_at": null
    },
    "scopes": ["read", "write"],
    "organization": { "id": "75f97222-4146-41a9-b674-b9f96aa2e991", "name": "Acme", "slug": "acme" },
    "plan": "trial",
    "rate_limit": { "requests_per_minute": 60 }
  },
  "meta": { "request_id": "f4deff33-ca22-46ac-a870-dd8de36a78d3", "timestamp": "2026-11-25T18:44:17.004Z" }
}
```

`trial` is the API name of the Free plan.

A `401` means the key is wrong, expired or revoked.

## 3. List ideas

```bash
curl -s "https://feedzzie.com/api/v1/ideas?per_page=5&sort=most_votes" \
  -H "Authorization: Bearer $FEEDZZIE_API_KEY"
```

`data` is the list of ideas and `meta.pagination` says how many there are. Filters: `status`, `topic_id`, `search`; sorts: `newest`, `oldest`, `most_votes`, `most_comments`. See [pagination](https://docs.feedzzie.com/api/pagination-limits-errors/#pagination).

## 4. Create an idea

```bash
curl -s https://feedzzie.com/api/v1/ideas \
  -H "Authorization: Bearer $FEEDZZIE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title": "Export ideas to CSV", "description": "A button to download every idea."}'
```

The answer is `201` with the new idea in `data`:

```json
{"data":{"id":"e1e468f3-1c65-4d23-9f81-1129c9391e16","title":"Export ideas to CSV","description":"A button to download every idea.","status":"open","vote_count":0,"comment_count":0,"is_private":false,"is_pinned":false,"is_approved":true,"is_duplicate_of":null,"merged_into":null,"created_at":"2026-11-25T19:40:57.617889+00:00","updated_at":"2026-11-25T19:40:57.617889+00:00","author":null,"topic":null},"meta":{"request_id":"04e191e2-4705-4083-8f1c-dbbc2bfa5918","timestamp":"2026-11-25T19:40:57.575Z"}}
```

Save its `id`:

```bash
IDEA_ID=<the id from the answer>
```

The idea is created in your organization's **default project** ([several projects](https://docs.feedzzie.com/api/pagination-limits-errors/#several-projects)). With the `Idempotency-Key` header, sending the same request again does not create a second idea: see [safe retries](https://docs.feedzzie.com/api/pagination-limits-errors/#safe-retries).

## 5. Vote for it

```bash
curl -s -X POST "https://feedzzie.com/api/v1/ideas/$IDEA_ID/votes" \
  -H "Authorization: Bearer $FEEDZZIE_API_KEY"
```

The answer has the new count: `{"data":{"idea_id":"…","vote_count":1,"voted":true}, …}`. Your organization votes once per idea through the API, whichever key calls: voting again changes nothing. `DELETE` on the same URL removes the vote.

## 6. Comment on it

```bash
curl -s "https://feedzzie.com/api/v1/ideas/$IDEA_ID/comments" \
  -H "Authorization: Bearer $FEEDZZIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "We are looking into it."}'
```

The comment is signed with the name of the person who created the key.

## 7. Change its status (admin)

```bash
curl -s -X PATCH "https://feedzzie.com/api/v1/ideas/$IDEA_ID" \
  -H "Authorization: Bearer $FEEDZZIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "planned"}'
```

The statuses are listed in [concepts](https://docs.feedzzie.com/start/concepts/#ideas). Without the `admin` scope the answer is `403` with `INSUFFICIENT_SCOPE`.

## 8. Delete it (admin)

```bash
curl -s -o /dev/null -w '%{http_code}\n' -X DELETE "https://feedzzie.com/api/v1/ideas/$IDEA_ID" \
  -H "Authorization: Bearer $FEEDZZIE_API_KEY"
```

It prints `204`.

## Next steps

- Every operation, field and error: the [API reference](https://docs.feedzzie.com/api/reference/).
- Lists, rate limits, errors and several projects: [pagination, limits and errors](https://docs.feedzzie.com/api/pagination-limits-errors/).
- The same from the terminal, without curl: the [CLI](https://docs.feedzzie.com/cli/cli/).
