# Cognito Forms

> List Cognito Forms, read a form schema, and list, get, create, update or delete form entries via the REST API.

Lets an agent work with Cognito Forms, an online form builder: list your forms, read a form's schema (to learn its internal field names), and list, get, create, update or delete entries (submissions).

## What it can do

| Method | What it does |
| --- | --- |
| `cognitoforms_forms_list` | List forms in the account (id + name). |
| `cognitoforms_form_get` | Get a form's schema, including internal field names. |
| `cognitoforms_entries_list` | List entries for a form (OData filter / orderby / top / skip). |
| `cognitoforms_entry_get` | Get one entry by id. |
| `cognitoforms_entry_create` | Create an entry from field values. |
| `cognitoforms_entry_update` | Update an entry's field values. |
| `cognitoforms_entry_delete` | Delete an entry. |
| `cognitoforms_request` | Generic passthrough to any endpoint for full coverage. |

When creating or updating entries, the `fields` object is keyed by the form's **internal field names** - read them first with `cognitoforms_form_get`.

## How to get your key

The API authenticates with an `Authorization: Bearer <key>` header (it also accepts `?access_token=<key>`).

1. Sign in at [Cognito Forms](https://www.cognitoforms.com/).
2. Open **Account -> Integrations** ([cognitoforms.com/account/integrations](https://www.cognitoforms.com/account/integrations)).
3. Copy your API key. The API is available on paid plans.
4. Paste it into FlyMyAI.

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `COGNITOFORMS_API_KEY` | Cognito Forms -> Account -> Integrations -> API key |

## Troubleshooting

- **`401 Unauthorized`** - the key is wrong or missing. Re-copy it from Account -> Integrations.
- **`403 Forbidden`** - the REST API is not enabled on your plan. Upgrade to a plan that includes API access.
- **`400 Bad Request` on create / update** - a field name does not match the form schema. Use the internal field names from `cognitoforms_form_get`.
- **`404 Not Found`** - the form id or entry id is wrong. List forms / entries first to get valid ids.

## Links

- [Cognito Forms integrations / API key](https://www.cognitoforms.com/account/integrations)
- [Cognito Forms REST API documentation](https://www.cognitoforms.com/support/89/data-integration/rest-api)
