# Get a form (/docs/api-reference/forms/get-form)

A form's settings, with the `endpoint` it posts to and its `hosted_url`.

`GET https://api.coss.com/v1/forms/{id}`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Path parameters

- `id` (string, required): The form's id.

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.forms.get("form_01kd2m8n3p4q5r6s7t8v9w0x1y");
```

HTTP:

```sh
curl -X GET "https://api.coss.com/v1/forms/form_01kd2m8n3p4q5r6s7t8v9w0x1y" \
  -H "Authorization: Bearer $COSS_API_KEY"
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.forms.get(
    id="form_01kd2m8n3p4q5r6s7t8v9w0x1y",
)
```

Go:

```go
import (
	"context"

	coss "github.com/cosscom/coss-go"
	cossclient "github.com/cosscom/coss-go/client"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

request := &coss.GetFormsRequest{
    ID: "form_01kd2m8n3p4q5r6s7t8v9w0x1y",
}
client.Forms.Get(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.forms.get(id: "form_01kd2m8n3p4q5r6s7t8v9w0x1y")
```

PHP:

```php
<?php

use Coss\Coss;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->forms->get(
    'form_01kd2m8n3p4q5r6s7t8v9w0x1y',
);
```

Java:

```java
import com.coss.Coss;
import com.coss.resources.forms.requests.GetFormsRequest;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.forms().get(
    "form_01kd2m8n3p4q5r6s7t8v9w0x1y",
    GetFormsRequest
        .builder()
        .build()
);
```

.NET:

```csharp
using Coss;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.Forms.GetAsync(new GetFormsRequest { Id = "form_01kd2m8n3p4q5r6s7t8v9w0x1y" });
```

## Response 200

The form.

- `object` ("form", required)
- `id` (string, required)
- `name` (string, required): Your name for the form, shown in the dashboard and in notifications.
- `enabled` (boolean, required): `false`: submissions are refused.
- `endpoint` (string, required): Where the form posts: `<form action=…>`.
- `hosted_url` (string | null, required): The hosted page, when `hosted.enabled`; `null` otherwise.
- `fields` (object[] | null, required): The form's fields. `null`: any field is accepted, without validation.
  - `name` (string, required): The `name` the form's input posts.
  - `type` ("text" | "email" | "textarea" | "number" | "tel" | "url" | "date" | "select" | "radio" | "checkbox" | "hidden" | "file", required): Validates the value and picks the input on hosted pages.
  - `label` (string | null, required): Shown on hosted pages and in notifications. `null`: the name.
  - `required` (boolean, required): Whether a submission must include it.
  - `placeholder` (string | null, required): Shown in the empty input on hosted pages. `null`: none.
  - `options` (string[], required): The choices of `select`, `radio` and `checkbox` fields. Empty for other types.
  - `max_length` (integer | null, required): The longest value accepted, in characters. `null`: only the overall limit.
- `strict_fields` (boolean, required): With `fields`: whether fields the form doesn't define are refused.
- `allowed_origins` (string[], required): Sites that may post to the form. Empty: any.
- `redirect_url` (string | null, required): Where browsers go after an HTML post. `null`: coss.com's thank-you page.
- `spam` (object, required): How submissions are screened.
  - `honeypot_field` (string, required): A field people leave empty; a submission that fills it is spam.
  - `captcha` ("off" | "required", required): `required`: submissions need a captcha token. `off`: they don't.
  - `captcha_site_key` (string | null, required): The captcha's site key, which hosted pages render the widget with. `null`: none set.
  - `content_threshold` (number | null, required): A submission whose text scores at least this in a content category is spam. `null`: the environment's risk settings decide.
  - `on_review` ("deliver" | "hold", required): When Risk's decision is `review`: `hold` keeps the submission until you release it, `deliver` delivers it.
- `submitter` (object, required): Who the submitter is, and whether they must confirm by email.
  - `email_field` (string, required): The field holding the submitter's email address.
  - `verify` (boolean, required): Whether submissions wait until the submitter clicks a link emailed to them.
  - `confirmation_from` (string | null, required): The verification email's sender. `null`: none set.
- `notifications` (object, required): Emails about accepted submissions.
  - `recipients` (string[], required): Who gets an email for each accepted submission.
  - `from` (string | null, required): The notification's sender. `null`: coss.com, as "<form name> via coss.com".
- `contacts` (object, required): Turning submissions into contacts.
  - `enabled` (boolean, required): Whether each accepted submission becomes a contact.
  - `audience_ids` (string[], required): Audiences the contact joins.
  - `topics` (string[], required): Topic keys the contact is opted into.
  - `double_opt_in` (boolean | null, required): Whether new contacts confirm by email first. `null`: the environment's marketing settings decide.
  - `first_name_field` (string | null, required): The field holding the contact's first name. `null`: none.
  - `last_name_field` (string | null, required): The field holding the contact's last name. `null`: none.
  - `properties` (map of string, required): Contact property key → the field whose value it takes.
- `files` (object, required): File uploads.
  - `enabled` (boolean, required): Whether uploads are accepted (`multipart/form-data`).
  - `max_files` (integer, required): Most files per submission.
  - `max_file_bytes` (integer, required): Largest file, in bytes.
  - `allowed_types` (string[], required): MIME types accepted. Empty: images, PDFs, text and Office.
- `hosted` (object, required): The page coss.com can serve for this form.
  - `enabled` (boolean, required): Whether the page is served at `hosted_url`.
  - `title` (string | null, required): The page's heading. `null`: the form's name.
  - `description` (string | null, required): Text under the heading. `null`: none.
  - `submit_label` (string | null, required): The submit button's label. `null`: the default.
  - `success_message` (string | null, required): Shown after a submission. `null`: the default.
  - `published_at` (string | null, required, date-time): When the page was turned on, or what it shows last changed. `null`: never published.
- `disabled_by_admin` (boolean, required): coss.com disabled the form for abuse; contact support.
- `sandbox` (boolean, required): Whether the form belongs to a sandbox environment.
- `created_at` (string, required, date-time)
- `updated_at` (string, required, date-time)

Example:

```json
{
  "object": "form",
  "id": "form_01kd2m8n3p4q5r6s7t8v9w0x1y",
  "name": "Contact us",
  "enabled": true,
  "endpoint": "https://cossforms.com/f/form_01kd2m8n3p4q5r6s7t8v9w0x1y",
  "hosted_url": null,
  "fields": null,
  "strict_fields": false,
  "allowed_origins": [
    "https://www.example.com"
  ],
  "redirect_url": null,
  "spam": {
    "honeypot_field": "_gotcha",
    "captcha": "off",
    "captcha_site_key": null,
    "content_threshold": 0.9,
    "on_review": "hold"
  },
  "submitter": {
    "email_field": "email",
    "verify": false,
    "confirmation_from": null
  },
  "notifications": {
    "recipients": [
      "support@example.com"
    ],
    "from": null
  },
  "contacts": {
    "enabled": false,
    "audience_ids": [],
    "topics": [],
    "double_opt_in": null,
    "first_name_field": null,
    "last_name_field": null,
    "properties": {}
  },
  "files": {
    "enabled": false,
    "max_files": 3,
    "max_file_bytes": 10485760,
    "allowed_types": []
  },
  "hosted": {
    "enabled": false,
    "title": null,
    "description": null,
    "submit_label": null,
    "success_message": null,
    "published_at": null
  },
  "disabled_by_admin": false,
  "sandbox": false,
  "created_at": "2026-10-29T10:00:00.000Z",
  "updated_at": "2026-10-29T10:00:00.000Z"
}
```

## Errors

- `400`: The `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the permission this endpoint needs (`permission_error`), or its organization is suspended (`organization_suspended`).
- `404`: No form with this id exists in the API key's environment (`not_found`).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: Forms isn't available in this deployment yet (`forms_unavailable`).