# OrgOrg API v1 — Feedback forms — instructions for AI agents

This document describes the Feedback forms endpoints of the OrgOrg v1 REST API. Fetch it from https://orgorg.com/docs/api/v1/feedback/agents.md. The full API is documented at https://orgorg.com/docs/api/v1/agents.md.

## Basics

- Base URL: `https://orgorg.com`. All endpoint paths below are relative to it.
- Every request requires an `Authorization: Bearer <token>` header.
- `GET` endpoints take parameters in the URL query string. `POST` endpoints take a JSON body with a `Content-Type: application/json` header.
- All responses are JSON. A non-2xx status means the request failed; the body describes the problem.
- Endpoints are stable, but new response fields may be added without notice — ignore fields you do not recognize.

## Getting a token

Tokens are created by a signed-in user at https://orgorg.com/docs/credentials and inherit that user's permissions in their organization. If you do not have a token, ask your user to create one there. Verify a token works with:

```sh
curl "https://orgorg.com/api/v1/auth/test" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN"
```

A valid token returns `{ "ok": true, ... }`.

## Feedback forms

Performance review forms, engagement surveys, and feedback forms: list and read them, create them, and manage their questions and sections. Human-readable docs: https://orgorg.com/docs/api/v1/feedback

### List feedback forms

`GET /api/v1/feedback/forms/list`

List the forms of the org, newest first: performance review forms, engagement surveys, and feedback forms. Filter by type or state. Requires feedback.forms:read (or :write).

Parameters:

- `type` (`Basic` | `Engagement` | `RealtimeGratitude` | `PerformanceReview`, optional) — Only forms of this type.
- `state` (`Draft` | `Active` | `Archived`, optional) — Only forms in this state.

Example request:

```sh
curl -X GET "https://orgorg.com/api/v1/feedback/forms/list" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN"
```

Response shape:

```ts
{
  data: {
    id: string;
    title: string;
    description: string | null;
    type: 'Basic' | 'Engagement' | 'RealtimeGratitude' | 'PerformanceReview';
    state: 'Draft' | 'Active' | 'Archived';
    createdAt: number;
    updatedAt: number;
  }[]
}
```

### Get feedback form

`GET /api/v1/feedback/forms/get`

One form with its questions and sections in the order of the editor. Requires feedback.forms:read (or :write).

Parameters:

- `id` (string, required) — The form id.

Example request:

```sh
curl -X GET "https://orgorg.com/api/v1/feedback/forms/get?id=" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN"
```

Response shape:

```ts
{
  data: {
    id: string;
    title: string;
    description: string | null;
    type: 'Basic' | 'Engagement' | 'RealtimeGratitude' | 'PerformanceReview';
    state: 'Draft' | 'Active' | 'Archived';
    createdAt: number;
    updatedAt: number;
    items: {
      id: string;
      type: string;
      text: string;
      description: string | null;
      required: boolean;
      parentItemId: string | null;
      aboutItemId: string | null;
      forStageId: string | null;
      sequence: number;
    }[];
  }
}
```

### Create feedback form

`POST /api/v1/feedback/forms/create`

Create a form as a draft. Then add its questions with items/create. Requires feedback.forms:write.

Parameters:

- `title` (string, required) — The title of the form.
- `type` (`Basic` | `Engagement` | `RealtimeGratitude` | `PerformanceReview`, optional) — The kind of form. Default: PerformanceReview.
- `description` (string, optional) — The text under the title.

Example request:

```sh
curl -X POST "https://orgorg.com/api/v1/feedback/forms/create" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Self-Assessment",
    "type": "PerformanceReview"
  }'
```

Response shape:

```ts
{
  data: {
    id: string;
    title: string;
    description: string | null;
    type: 'Basic' | 'Engagement' | 'RealtimeGratitude' | 'PerformanceReview';
    state: 'Draft' | 'Active' | 'Archived';
    createdAt: number;
    updatedAt: number;
  };
  created: true;
}
```

### Update feedback form

`POST /api/v1/feedback/forms/update`

Change the title, the description, or the state of a form. Send only the fields that change. Requires feedback.forms:write.

Parameters:

- `id` (string, required) — The form id.
- `title` (string, optional) — The new title.
- `description` (string, optional) — The new description. An empty string clears it.
- `state` (`Draft` | `Active` | `Archived`, optional) — The new state.

Example request:

```sh
curl -X POST "https://orgorg.com/api/v1/feedback/forms/update" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "",
    "title": ""
  }'
```

Response shape:

```ts
{
  data: {
    id: string;
    title: string;
    description: string | null;
    type: 'Basic' | 'Engagement' | 'RealtimeGratitude' | 'PerformanceReview';
    state: 'Draft' | 'Active' | 'Archived';
    createdAt: number;
    updatedAt: number;
  }
}
```

### Add feedback form item

`POST /api/v1/feedback/forms/items/create`

Add a question or a section to a form. Put a question into a section with parentItemId; place it after another item with afterItemId, else it goes last. Requires feedback.forms:write.

Parameters:

- `formId` (string, required) — The form id.
- `text` (string, required) — The question text, or the title of a section.
- `type` (`MultilineText` | `LinearScale` | `Dropdown` | `Checkbox` | `Rating` | `FileUpload` | `CheckboxGrid` | `RadioGrid` | `Section` | `RepeatableSection` | `PersonList` | `SortableList` | `RatingWithComment` | `SmartGoal`, optional) — The kind of item. Default: MultilineText, a paragraph answer.
- `description` (string, optional) — Help text under the question. Markdown is fine.
- `required` (boolean, optional) — Whether an answer is required. Default: false.
- `parentItemId` (string, optional) — The id of the section that holds the item.
- `afterItemId` (string, optional) — The id of the item that this one follows.

Example request:

```sh
curl -X POST "https://orgorg.com/api/v1/feedback/forms/items/create" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "formId": "",
    "text": "What did you focus on this period?"
  }'
```

Response shape:

```ts
{
  data: {
    id: string;
    type: string;
    text: string;
    description: string | null;
    required: boolean;
    parentItemId: string | null;
    aboutItemId: string | null;
    forStageId: string | null;
    sequence: number;
  };
  created: true;
}
```

### Update feedback form item

`POST /api/v1/feedback/forms/items/update`

Change the text, the description, the required flag, or the type of a question or a section. Send only the fields that change. Requires feedback.forms:write.

Parameters:

- `id` (string, required) — The item id.
- `text` (string, optional) — The new text.
- `description` (string, optional) — The new help text. null removes it.
- `required` (boolean, optional) — Whether an answer is required.
- `type` (`MultilineText` | `LinearScale` | `Dropdown` | `Checkbox` | `Rating` | `FileUpload` | `CheckboxGrid` | `RadioGrid` | `Section` | `RepeatableSection` | `PersonList` | `SortableList` | `RatingWithComment` | `SmartGoal`, optional) — The new kind of question.

Example request:

```sh
curl -X POST "https://orgorg.com/api/v1/feedback/forms/items/update" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "",
    "text": ""
  }'
```

Response shape:

```ts
{
  data: {
    id: string;
    type: string;
    text: string;
    description: string | null;
    required: boolean;
    parentItemId: string | null;
    aboutItemId: string | null;
    forStageId: string | null;
    sequence: number;
  }
}
```

### Delete feedback form item

`POST /api/v1/feedback/forms/items/delete`

Remove a question or a section from a form. A removed section takes its questions with it. Requires feedback.forms:write.

Parameters:

- `id` (string, required) — The item id.

Example request:

```sh
curl -X POST "https://orgorg.com/api/v1/feedback/forms/items/delete" \
  -H "Authorization: Bearer $ORGORG_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": ""
  }'
```

Response shape:

```ts
{
  data: { id: string; deleted: true }
}
```
