> This page is for Data API, version v2 Beta.
> For other versions, use one of these documentation indexes:
> - v2 (default): https://developers.webflow.com/data/v2.0.0/llms.txt
> - v2 Beta: https://developers.webflow.com/data/v2.0.0-beta/llms.txt
> - v1: https://developers.webflow.com/data/v1.0.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Create Collection

POST https://api.webflow.com/beta/sites/{site_id}/collections
Content-Type: application/json

Create a Collection for a site with collection fields.

Each collection includes the required _name_ and _slug_ fields, which are generated automatically. You can update the `displayName` of these fields, but the slug for them cannot be changed. Fields slugs are automatically converted to lowercase. Spaces in slugs are replaced with hyphens.

Required scope | `cms:write`


Reference: https://developers.webflow.com/data/reference/cms/collections/create

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `site_id` (string, required) — Unique identifier for a Site

### Body (application/json)

This endpoint expects an object.

- `displayName` (string, required) — Name of the collection. Each collection name must be distinct.
- `singularName` (string, required) — Singular name of each item.
- `slug` (string, optional) — Part of a URL that identifier
- `fields` (list of SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItems, optional) — An array of custom fields to add to the collection

## Response

### 200

Request was successful

- `id` (string, required) — Unique identifier for a Collection
- `displayName` (string, required) — Name given to the Collection
- `singularName` (string, required) — The name of one Item in Collection (e.g. ”Blog Post” if the Collection is called “Blog Posts”)
- `fields` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldsItems, required) — The list of fields in the Collection
- `slug` (string, optional) — Slug of Collection in Site URL structure
- `createdOn` (string, optional) — The date the collection was created
- `lastUpdated` (string, optional) — The date the collection was last updated
- `fieldGroups` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldGroupsItems, optional) — The list of field groups in the Collection

## Errors

### 400 Bad Request Error

Validation failure

- `code` (enum, optional) — Error code
  - Allowed values: `aeo_input_validation`, `analyze_filter_conflict`, `analyze_input_validation`, `analyze_unsupported_filter`, `bad_request`, `batch_too_large`, `before_historical_floor`, `billing_provider_unavailable`, `branch_merge_conflict`, `branch_merge_in_progress`, `branch_not_found`, `branch_publish_failed`, `branch_sync_pending`, `branch_task_not_found`, `branch_update_in_progress`, `brand_not_configured`, `cannot_invite_self`, `cannot_remove_self`, `cannot_update_user_role`, `client_seats_unavailable`, `collection_not_found`, `competitors_not_configured`, `conflict`, `conflicting_scope_filters`, `default_site_role_required`, `duplicate_collection`, `duplicate_member_in_request`, `duplicate_site_in_request`, `duplicate_user_email`, `ecommerce_not_enabled`, `end_time_too_recent`, `enterprise_provisioning_upstream_error`, `enterprise_self_provisioning_not_entitled`, `forbidden`, `forms_require_republish`, `incompatible_webhook_filter`, `insufficient_permissions`, `insufficient_seats`, `internal_error`, `invalid_auth_version`, `invalid_credentials`, `invalid_domain`, `invalid_resolution`, `invalid_site_role`, `invalid_time_range`, `invalid_user_email`, `invalid_workspace_role`, `invite_expired`, `invite_role_conflict`, `item_not_found`, `managed_by_scim`, `member_already_has_access`, `member_has_no_site_access`, `member_is_paying_client`, `member_not_found`, `member_not_removable`, `member_role_conflict`, `missing_scopes`, `no_domains`, `no_members_or_invites`, `not_authorized`, `not_enterprise_plan_site`, `not_enterprise_plan_workspace`, `optimize_before_historical_floor`, `optimize_input_validation`, `optimize_invalid_interval`, `optimize_unknown_dimension`, `optimize_unknown_goal`, `optimize_unknown_optimization`, `optimize_unsupported_group_by`, `order_not_found`, `page_cannot_branch`, `resource_not_found`, `service_unavailable`, `site_access_not_applicable_to_member`, `site_access_not_scopable_for_role`, `site_access_roles_must_match`, `site_not_in_workspace`, `site_role_id_invalid`, `site_role_id_not_allowed`, `site_role_id_required`, `site_specific_access_disabled`, `site_specific_access_not_entitled`, `time_range_too_wide`, `too_many_requests`, `unsupported_bot_provider`, `unsupported_version`, `unsupported_webhook_trigger_type`, `user_limit_reached`, `user_not_found`, `users_not_enabled`, `validation_error`, `workspace_invite_not_found`, `workspace_member_managed_by_scim`, `workspace_member_not_found`, `workspace_member_not_removable`, `workspace_role_not_grantable`
- `message` (string, optional) — Error message
- `externalReference` (string, optional) — Link to more information
- `details` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaDetailsItems, optional) — Array of errors

### 401 Unauthorized Error

Provided access token is invalid or does not have access to requested resource

- `code` (enum, optional) — Error code
  - Allowed values: `aeo_input_validation`, `analyze_filter_conflict`, `analyze_input_validation`, `analyze_unsupported_filter`, `bad_request`, `batch_too_large`, `before_historical_floor`, `billing_provider_unavailable`, `branch_merge_conflict`, `branch_merge_in_progress`, `branch_not_found`, `branch_publish_failed`, `branch_sync_pending`, `branch_task_not_found`, `branch_update_in_progress`, `brand_not_configured`, `cannot_invite_self`, `cannot_remove_self`, `cannot_update_user_role`, `client_seats_unavailable`, `collection_not_found`, `competitors_not_configured`, `conflict`, `conflicting_scope_filters`, `default_site_role_required`, `duplicate_collection`, `duplicate_member_in_request`, `duplicate_site_in_request`, `duplicate_user_email`, `ecommerce_not_enabled`, `end_time_too_recent`, `enterprise_provisioning_upstream_error`, `enterprise_self_provisioning_not_entitled`, `forbidden`, `forms_require_republish`, `incompatible_webhook_filter`, `insufficient_permissions`, `insufficient_seats`, `internal_error`, `invalid_auth_version`, `invalid_credentials`, `invalid_domain`, `invalid_resolution`, `invalid_site_role`, `invalid_time_range`, `invalid_user_email`, `invalid_workspace_role`, `invite_expired`, `invite_role_conflict`, `item_not_found`, `managed_by_scim`, `member_already_has_access`, `member_has_no_site_access`, `member_is_paying_client`, `member_not_found`, `member_not_removable`, `member_role_conflict`, `missing_scopes`, `no_domains`, `no_members_or_invites`, `not_authorized`, `not_enterprise_plan_site`, `not_enterprise_plan_workspace`, `optimize_before_historical_floor`, `optimize_input_validation`, `optimize_invalid_interval`, `optimize_unknown_dimension`, `optimize_unknown_goal`, `optimize_unknown_optimization`, `optimize_unsupported_group_by`, `order_not_found`, `page_cannot_branch`, `resource_not_found`, `service_unavailable`, `site_access_not_applicable_to_member`, `site_access_not_scopable_for_role`, `site_access_roles_must_match`, `site_not_in_workspace`, `site_role_id_invalid`, `site_role_id_not_allowed`, `site_role_id_required`, `site_specific_access_disabled`, `site_specific_access_not_entitled`, `time_range_too_wide`, `too_many_requests`, `unsupported_bot_provider`, `unsupported_version`, `unsupported_webhook_trigger_type`, `user_limit_reached`, `user_not_found`, `users_not_enabled`, `validation_error`, `workspace_invite_not_found`, `workspace_member_managed_by_scim`, `workspace_member_not_found`, `workspace_member_not_removable`, `workspace_role_not_grantable`
- `message` (string, optional) — Error message
- `externalReference` (string, optional) — Link to more information
- `details` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaDetailsItems, optional) — Array of errors

### 404 Not Found Error

Requested resource not found

- `code` (enum, optional) — Error code
  - Allowed values: `aeo_input_validation`, `analyze_filter_conflict`, `analyze_input_validation`, `analyze_unsupported_filter`, `bad_request`, `batch_too_large`, `before_historical_floor`, `billing_provider_unavailable`, `branch_merge_conflict`, `branch_merge_in_progress`, `branch_not_found`, `branch_publish_failed`, `branch_sync_pending`, `branch_task_not_found`, `branch_update_in_progress`, `brand_not_configured`, `cannot_invite_self`, `cannot_remove_self`, `cannot_update_user_role`, `client_seats_unavailable`, `collection_not_found`, `competitors_not_configured`, `conflict`, `conflicting_scope_filters`, `default_site_role_required`, `duplicate_collection`, `duplicate_member_in_request`, `duplicate_site_in_request`, `duplicate_user_email`, `ecommerce_not_enabled`, `end_time_too_recent`, `enterprise_provisioning_upstream_error`, `enterprise_self_provisioning_not_entitled`, `forbidden`, `forms_require_republish`, `incompatible_webhook_filter`, `insufficient_permissions`, `insufficient_seats`, `internal_error`, `invalid_auth_version`, `invalid_credentials`, `invalid_domain`, `invalid_resolution`, `invalid_site_role`, `invalid_time_range`, `invalid_user_email`, `invalid_workspace_role`, `invite_expired`, `invite_role_conflict`, `item_not_found`, `managed_by_scim`, `member_already_has_access`, `member_has_no_site_access`, `member_is_paying_client`, `member_not_found`, `member_not_removable`, `member_role_conflict`, `missing_scopes`, `no_domains`, `no_members_or_invites`, `not_authorized`, `not_enterprise_plan_site`, `not_enterprise_plan_workspace`, `optimize_before_historical_floor`, `optimize_input_validation`, `optimize_invalid_interval`, `optimize_unknown_dimension`, `optimize_unknown_goal`, `optimize_unknown_optimization`, `optimize_unsupported_group_by`, `order_not_found`, `page_cannot_branch`, `resource_not_found`, `service_unavailable`, `site_access_not_applicable_to_member`, `site_access_not_scopable_for_role`, `site_access_roles_must_match`, `site_not_in_workspace`, `site_role_id_invalid`, `site_role_id_not_allowed`, `site_role_id_required`, `site_specific_access_disabled`, `site_specific_access_not_entitled`, `time_range_too_wide`, `too_many_requests`, `unsupported_bot_provider`, `unsupported_version`, `unsupported_webhook_trigger_type`, `user_limit_reached`, `user_not_found`, `users_not_enabled`, `validation_error`, `workspace_invite_not_found`, `workspace_member_managed_by_scim`, `workspace_member_not_found`, `workspace_member_not_removable`, `workspace_role_not_grantable`
- `message` (string, optional) — Error message
- `externalReference` (string, optional) — Link to more information
- `details` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaDetailsItems, optional) — Array of errors

### 409 Conflict Error

Collection already exists

- `code` (enum, optional) — Error code
  - Allowed values: `aeo_input_validation`, `analyze_filter_conflict`, `analyze_input_validation`, `analyze_unsupported_filter`, `bad_request`, `batch_too_large`, `before_historical_floor`, `billing_provider_unavailable`, `branch_merge_conflict`, `branch_merge_in_progress`, `branch_not_found`, `branch_publish_failed`, `branch_sync_pending`, `branch_task_not_found`, `branch_update_in_progress`, `brand_not_configured`, `cannot_invite_self`, `cannot_remove_self`, `cannot_update_user_role`, `client_seats_unavailable`, `collection_not_found`, `competitors_not_configured`, `conflict`, `conflicting_scope_filters`, `default_site_role_required`, `duplicate_collection`, `duplicate_member_in_request`, `duplicate_site_in_request`, `duplicate_user_email`, `ecommerce_not_enabled`, `end_time_too_recent`, `enterprise_provisioning_upstream_error`, `enterprise_self_provisioning_not_entitled`, `forbidden`, `forms_require_republish`, `incompatible_webhook_filter`, `insufficient_permissions`, `insufficient_seats`, `internal_error`, `invalid_auth_version`, `invalid_credentials`, `invalid_domain`, `invalid_resolution`, `invalid_site_role`, `invalid_time_range`, `invalid_user_email`, `invalid_workspace_role`, `invite_expired`, `invite_role_conflict`, `item_not_found`, `managed_by_scim`, `member_already_has_access`, `member_has_no_site_access`, `member_is_paying_client`, `member_not_found`, `member_not_removable`, `member_role_conflict`, `missing_scopes`, `no_domains`, `no_members_or_invites`, `not_authorized`, `not_enterprise_plan_site`, `not_enterprise_plan_workspace`, `optimize_before_historical_floor`, `optimize_input_validation`, `optimize_invalid_interval`, `optimize_unknown_dimension`, `optimize_unknown_goal`, `optimize_unknown_optimization`, `optimize_unsupported_group_by`, `order_not_found`, `page_cannot_branch`, `resource_not_found`, `service_unavailable`, `site_access_not_applicable_to_member`, `site_access_not_scopable_for_role`, `site_access_roles_must_match`, `site_not_in_workspace`, `site_role_id_invalid`, `site_role_id_not_allowed`, `site_role_id_required`, `site_specific_access_disabled`, `site_specific_access_not_entitled`, `time_range_too_wide`, `too_many_requests`, `unsupported_bot_provider`, `unsupported_version`, `unsupported_webhook_trigger_type`, `user_limit_reached`, `user_not_found`, `users_not_enabled`, `validation_error`, `workspace_invite_not_found`, `workspace_member_managed_by_scim`, `workspace_member_not_found`, `workspace_member_not_removable`, `workspace_role_not_grantable`
- `message` (string, optional) — Error message
- `externalReference` (string, optional) — Link to more information
- `details` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaDetailsItems, optional) — Array of errors

### 429 Too Many Requests Error

The rate limit of the provided access_token has been reached. Please have your application respect the X-RateLimit-Remaining header we include on API responses.

- `code` (enum, optional) — Error code
  - Allowed values: `aeo_input_validation`, `analyze_filter_conflict`, `analyze_input_validation`, `analyze_unsupported_filter`, `bad_request`, `batch_too_large`, `before_historical_floor`, `billing_provider_unavailable`, `branch_merge_conflict`, `branch_merge_in_progress`, `branch_not_found`, `branch_publish_failed`, `branch_sync_pending`, `branch_task_not_found`, `branch_update_in_progress`, `brand_not_configured`, `cannot_invite_self`, `cannot_remove_self`, `cannot_update_user_role`, `client_seats_unavailable`, `collection_not_found`, `competitors_not_configured`, `conflict`, `conflicting_scope_filters`, `default_site_role_required`, `duplicate_collection`, `duplicate_member_in_request`, `duplicate_site_in_request`, `duplicate_user_email`, `ecommerce_not_enabled`, `end_time_too_recent`, `enterprise_provisioning_upstream_error`, `enterprise_self_provisioning_not_entitled`, `forbidden`, `forms_require_republish`, `incompatible_webhook_filter`, `insufficient_permissions`, `insufficient_seats`, `internal_error`, `invalid_auth_version`, `invalid_credentials`, `invalid_domain`, `invalid_resolution`, `invalid_site_role`, `invalid_time_range`, `invalid_user_email`, `invalid_workspace_role`, `invite_expired`, `invite_role_conflict`, `item_not_found`, `managed_by_scim`, `member_already_has_access`, `member_has_no_site_access`, `member_is_paying_client`, `member_not_found`, `member_not_removable`, `member_role_conflict`, `missing_scopes`, `no_domains`, `no_members_or_invites`, `not_authorized`, `not_enterprise_plan_site`, `not_enterprise_plan_workspace`, `optimize_before_historical_floor`, `optimize_input_validation`, `optimize_invalid_interval`, `optimize_unknown_dimension`, `optimize_unknown_goal`, `optimize_unknown_optimization`, `optimize_unsupported_group_by`, `order_not_found`, `page_cannot_branch`, `resource_not_found`, `service_unavailable`, `site_access_not_applicable_to_member`, `site_access_not_scopable_for_role`, `site_access_roles_must_match`, `site_not_in_workspace`, `site_role_id_invalid`, `site_role_id_not_allowed`, `site_role_id_required`, `site_specific_access_disabled`, `site_specific_access_not_entitled`, `time_range_too_wide`, `too_many_requests`, `unsupported_bot_provider`, `unsupported_version`, `unsupported_webhook_trigger_type`, `user_limit_reached`, `user_not_found`, `users_not_enabled`, `validation_error`, `workspace_invite_not_found`, `workspace_member_managed_by_scim`, `workspace_member_not_found`, `workspace_member_not_removable`, `workspace_role_not_grantable`
- `message` (string, optional) — Error message
- `externalReference` (string, optional) — Link to more information
- `details` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaDetailsItems, optional) — Array of errors

### 500 Internal Server Error

We had a problem with our server. Try again later.

- `code` (enum, optional) — Error code
  - Allowed values: `aeo_input_validation`, `analyze_filter_conflict`, `analyze_input_validation`, `analyze_unsupported_filter`, `bad_request`, `batch_too_large`, `before_historical_floor`, `billing_provider_unavailable`, `branch_merge_conflict`, `branch_merge_in_progress`, `branch_not_found`, `branch_publish_failed`, `branch_sync_pending`, `branch_task_not_found`, `branch_update_in_progress`, `brand_not_configured`, `cannot_invite_self`, `cannot_remove_self`, `cannot_update_user_role`, `client_seats_unavailable`, `collection_not_found`, `competitors_not_configured`, `conflict`, `conflicting_scope_filters`, `default_site_role_required`, `duplicate_collection`, `duplicate_member_in_request`, `duplicate_site_in_request`, `duplicate_user_email`, `ecommerce_not_enabled`, `end_time_too_recent`, `enterprise_provisioning_upstream_error`, `enterprise_self_provisioning_not_entitled`, `forbidden`, `forms_require_republish`, `incompatible_webhook_filter`, `insufficient_permissions`, `insufficient_seats`, `internal_error`, `invalid_auth_version`, `invalid_credentials`, `invalid_domain`, `invalid_resolution`, `invalid_site_role`, `invalid_time_range`, `invalid_user_email`, `invalid_workspace_role`, `invite_expired`, `invite_role_conflict`, `item_not_found`, `managed_by_scim`, `member_already_has_access`, `member_has_no_site_access`, `member_is_paying_client`, `member_not_found`, `member_not_removable`, `member_role_conflict`, `missing_scopes`, `no_domains`, `no_members_or_invites`, `not_authorized`, `not_enterprise_plan_site`, `not_enterprise_plan_workspace`, `optimize_before_historical_floor`, `optimize_input_validation`, `optimize_invalid_interval`, `optimize_unknown_dimension`, `optimize_unknown_goal`, `optimize_unknown_optimization`, `optimize_unsupported_group_by`, `order_not_found`, `page_cannot_branch`, `resource_not_found`, `service_unavailable`, `site_access_not_applicable_to_member`, `site_access_not_scopable_for_role`, `site_access_roles_must_match`, `site_not_in_workspace`, `site_role_id_invalid`, `site_role_id_not_allowed`, `site_role_id_required`, `site_specific_access_disabled`, `site_specific_access_not_entitled`, `time_range_too_wide`, `too_many_requests`, `unsupported_bot_provider`, `unsupported_version`, `unsupported_webhook_trigger_type`, `user_limit_reached`, `user_not_found`, `users_not_enabled`, `validation_error`, `workspace_invite_not_found`, `workspace_member_managed_by_scim`, `workspace_member_not_found`, `workspace_member_not_removable`, `workspace_role_not_grantable`
- `message` (string, optional) — Error message
- `externalReference` (string, optional) — Link to more information
- `details` (list of SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaDetailsItems, optional) — Array of errors

## Types

### SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItems

Details about the field of a collection

### SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldsItems

The details of a field in a collection

- `id` (string, required) — Unique identifier for a Field
- `isRequired` (boolean, required) — define whether a field is required in a collection
- `type` (enum, required) — Choose these appropriate field type for your collection data
  - Allowed values: `Color`, `DateTime`, `Email`, `ExtFileRef`, `File`, `Image`, `Link`, `MultiImage`, `MultiReference`, `Number`, `Option`, `Phone`, `PlainText`, `Reference`, `RichText`, `Switch`, `VideoLink`
- `displayName` (string, required) — The name of a field
- `isEditable` (boolean, optional) — Define whether the field is editable
- `slug` (string, optional) — Slug of Field in Site URL structure. Slugs should be all lowercase with no spaces. Any spaces will be converted to "-."
- `helpText` (string, optional) — Additional text to help anyone filling out this field
- `validations` (SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldsItemsValidations, optional, nullable) — The validations for the field

### SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldGroupsItems

A group of fields within a collection

- `displayName` (string, required) — The display name of the field group
- `fieldIds` (list of string, required) — The IDs of the fields in this group
- `description` (string, optional) — A description of the field group

### SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaDetailsItems

### Static Field

- `type` (enum, required) — Choose these appropriate field type for your collection data
  - Allowed values: `Color`, `DateTime`, `Email`, `File`, `Image`, `Link`, `MultiImage`, `Number`, `Phone`, `PlainText`, `RichText`, `Switch`, `VideoLink`
- `displayName` (string, required) — The name of a field
- `id` (string, optional) — Unique identifier for a Field
- `isEditable` (boolean, optional) — Define whether the field is editable
- `isRequired` (boolean, optional) — define whether a field is required in a collection
- `helpText` (string, optional) — Additional text to help anyone filling out this field

### Option Field

- `type` (enum, required) — The [Option field type](/data/reference/field-types-item-values#option)
  - Allowed values: `Option`
- `displayName` (string, required) — The name of a field
- `metadata` (SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItemsOneOf1Metadata, required) — The metadata for the Option field.
- `id` (string, optional) — Unique identifier for a Field
- `isEditable` (boolean, optional) — Define whether the field is editable
- `isRequired` (boolean, optional) — define whether a field is required in a collection
- `helpText` (string, optional) — Additional text to help anyone filling out this field

### Reference Field

- `type` (enum, required) — Choose these appropriate field type for your collection data
  - Allowed values: `MultiReference`, `Reference`
- `displayName` (string, required) — The name of a field
- `metadata` (SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItemsOneOf2Metadata, required) — The collectionId for the referenced collection. Only applicable for Reference and MultiReference fields.
- `id` (string, optional) — Unique identifier for a Field
- `isEditable` (boolean, optional) — Define whether the field is editable
- `isRequired` (boolean, optional) — define whether a field is required in a collection
- `helpText` (string, optional) — Additional text to help anyone filling out this field

### SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldsItemsValidations

The validations for the field

- `additionalProperties` (SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldsItemsValidationsAdditionalProperties, optional)

### SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItemsOneOf1Metadata

The metadata for the Option field.

- `options` (list of SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItemsOneOf1MetadataOptionsItems, required) — The option values for the Option field.

### SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItemsOneOf2Metadata

The collectionId for the referenced collection. Only applicable for Reference and MultiReference fields.

- `collectionId` (string, required) — The unique identifier of the collection

### SitesSiteIdCollectionsPostResponsesContentApplicationJsonSchemaFieldsItemsValidationsAdditionalProperties

### SitesSiteIdCollectionsPostRequestBodyContentApplicationJsonSchemaFieldsItemsOneOf1MetadataOptionsItems

A single option value for the Option field.

- `name` (string, required) — The name of the option
- `id` (string, optional) — The unique identifier of the option

## Examples

**Request**

```json
{
  "displayName": "Blog Posts",
  "singularName": "Blog Post",
  "slug": "posts",
  "fields": [
    {
      "isRequired": true,
      "type": "PlainText",
      "displayName": "Title",
      "helpText": "The title of the blog post",
      "slug": "title"
    },
    {
      "isRequired": true,
      "type": "RichText",
      "displayName": "Content",
      "helpText": "The content of the blog post",
      "slug": "content"
    },
    {
      "isRequired": true,
      "type": "Reference",
      "displayName": "Author",
      "helpText": "The author of the blog post",
      "metadata": {
        "collectionId": "23cc2d952d4e4631ffd4345d2743db4e"
      },
      "slug": "author"
    }
  ]
}
```

**Response**

```json
{
  "id": "562ac0395358780a1f5e6fbd",
  "displayName": "Blog Posts",
  "singularName": "Blog Post",
  "fields": [
    {
      "id": "string",
      "isRequired": true,
      "type": "PlainText",
      "displayName": "Title",
      "slug": "title",
      "helpText": "The title of the blog post"
    },
    {
      "id": "string",
      "isRequired": true,
      "type": "RichText",
      "displayName": "Content",
      "slug": "content",
      "helpText": "The content of the blog post"
    },
    {
      "id": "string",
      "isRequired": true,
      "type": "Reference",
      "displayName": "Author",
      "slug": "author",
      "helpText": "The author of the blog post",
      "metadata": {
        "collectionId": "23cc2d952d4e4631ffd4345d2743db4e"
      }
    }
  ],
  "slug": "posts",
  "createdOn": "2016-10-24T19:41:48Z",
  "lastUpdated": "2016-10-24T19:42:38Z"
}
```

**SDK Code**

```python collections_create_example
import requests

url = "https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections"

payload = {
    "displayName": "Blog Posts",
    "singularName": "Blog Post",
    "slug": "posts",
    "fields": [
        {
            "isRequired": True,
            "type": "PlainText",
            "displayName": "Title",
            "helpText": "The title of the blog post",
            "slug": "title"
        },
        {
            "isRequired": True,
            "type": "RichText",
            "displayName": "Content",
            "helpText": "The content of the blog post",
            "slug": "content"
        },
        {
            "isRequired": True,
            "type": "Reference",
            "displayName": "Author",
            "helpText": "The author of the blog post",
            "metadata": { "collectionId": "23cc2d952d4e4631ffd4345d2743db4e" },
            "slug": "author"
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript collections_create_example
const url = 'https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"displayName":"Blog Posts","singularName":"Blog Post","slug":"posts","fields":[{"isRequired":true,"type":"PlainText","displayName":"Title","helpText":"The title of the blog post","slug":"title"},{"isRequired":true,"type":"RichText","displayName":"Content","helpText":"The content of the blog post","slug":"content"},{"isRequired":true,"type":"Reference","displayName":"Author","helpText":"The author of the blog post","metadata":{"collectionId":"23cc2d952d4e4631ffd4345d2743db4e"},"slug":"author"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go collections_create_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections"

	payload := strings.NewReader("{\n  \"displayName\": \"Blog Posts\",\n  \"singularName\": \"Blog Post\",\n  \"slug\": \"posts\",\n  \"fields\": [\n    {\n      \"isRequired\": true,\n      \"type\": \"PlainText\",\n      \"displayName\": \"Title\",\n      \"helpText\": \"The title of the blog post\",\n      \"slug\": \"title\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"RichText\",\n      \"displayName\": \"Content\",\n      \"helpText\": \"The content of the blog post\",\n      \"slug\": \"content\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"Reference\",\n      \"displayName\": \"Author\",\n      \"helpText\": \"The author of the blog post\",\n      \"metadata\": {\n        \"collectionId\": \"23cc2d952d4e4631ffd4345d2743db4e\"\n      },\n      \"slug\": \"author\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby collections_create_example
require 'uri'
require 'net/http'

url = URI("https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"displayName\": \"Blog Posts\",\n  \"singularName\": \"Blog Post\",\n  \"slug\": \"posts\",\n  \"fields\": [\n    {\n      \"isRequired\": true,\n      \"type\": \"PlainText\",\n      \"displayName\": \"Title\",\n      \"helpText\": \"The title of the blog post\",\n      \"slug\": \"title\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"RichText\",\n      \"displayName\": \"Content\",\n      \"helpText\": \"The content of the blog post\",\n      \"slug\": \"content\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"Reference\",\n      \"displayName\": \"Author\",\n      \"helpText\": \"The author of the blog post\",\n      \"metadata\": {\n        \"collectionId\": \"23cc2d952d4e4631ffd4345d2743db4e\"\n      },\n      \"slug\": \"author\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java collections_create_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"displayName\": \"Blog Posts\",\n  \"singularName\": \"Blog Post\",\n  \"slug\": \"posts\",\n  \"fields\": [\n    {\n      \"isRequired\": true,\n      \"type\": \"PlainText\",\n      \"displayName\": \"Title\",\n      \"helpText\": \"The title of the blog post\",\n      \"slug\": \"title\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"RichText\",\n      \"displayName\": \"Content\",\n      \"helpText\": \"The content of the blog post\",\n      \"slug\": \"content\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"Reference\",\n      \"displayName\": \"Author\",\n      \"helpText\": \"The author of the blog post\",\n      \"metadata\": {\n        \"collectionId\": \"23cc2d952d4e4631ffd4345d2743db4e\"\n      },\n      \"slug\": \"author\"\n    }\n  ]\n}")
  .asString();
```

```php collections_create_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections', [
  'body' => '{
  "displayName": "Blog Posts",
  "singularName": "Blog Post",
  "slug": "posts",
  "fields": [
    {
      "isRequired": true,
      "type": "PlainText",
      "displayName": "Title",
      "helpText": "The title of the blog post",
      "slug": "title"
    },
    {
      "isRequired": true,
      "type": "RichText",
      "displayName": "Content",
      "helpText": "The content of the blog post",
      "slug": "content"
    },
    {
      "isRequired": true,
      "type": "Reference",
      "displayName": "Author",
      "helpText": "The author of the blog post",
      "metadata": {
        "collectionId": "23cc2d952d4e4631ffd4345d2743db4e"
      },
      "slug": "author"
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp collections_create_example
using RestSharp;

var client = new RestClient("https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"displayName\": \"Blog Posts\",\n  \"singularName\": \"Blog Post\",\n  \"slug\": \"posts\",\n  \"fields\": [\n    {\n      \"isRequired\": true,\n      \"type\": \"PlainText\",\n      \"displayName\": \"Title\",\n      \"helpText\": \"The title of the blog post\",\n      \"slug\": \"title\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"RichText\",\n      \"displayName\": \"Content\",\n      \"helpText\": \"The content of the blog post\",\n      \"slug\": \"content\"\n    },\n    {\n      \"isRequired\": true,\n      \"type\": \"Reference\",\n      \"displayName\": \"Author\",\n      \"helpText\": \"The author of the blog post\",\n      \"metadata\": {\n        \"collectionId\": \"23cc2d952d4e4631ffd4345d2743db4e\"\n      },\n      \"slug\": \"author\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift collections_create_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "displayName": "Blog Posts",
  "singularName": "Blog Post",
  "slug": "posts",
  "fields": [
    [
      "isRequired": true,
      "type": "PlainText",
      "displayName": "Title",
      "helpText": "The title of the blog post",
      "slug": "title"
    ],
    [
      "isRequired": true,
      "type": "RichText",
      "displayName": "Content",
      "helpText": "The content of the blog post",
      "slug": "content"
    ],
    [
      "isRequired": true,
      "type": "Reference",
      "displayName": "Author",
      "helpText": "The author of the blog post",
      "metadata": ["collectionId": "23cc2d952d4e4631ffd4345d2743db4e"],
      "slug": "author"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.webflow.com/beta/sites/580e63e98c9a982ac9b8b741/collections")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```