---
title: "POST /collections/{name}"
method: POST
path: "/collections/{name}"
tags: ["document"]
---

# POST /collections/{name}

`POST /collections/{name}`

Add document(s) to a collection

## Path parameters

- `name` string, required

## Request body

- union
  - Document
  - Document[]

## Response `200`

The IDs of the added documents

- string[]

## Other responses

- `400` — error
- `409` — error

## Changes

- **2026-06-29** `225e710a6ad0` — 1 info
  - added the media type `application/json` for the response with the status `200`
- **2026-03-30** `f46903303e53` — 1 info
  - added the non-success response with the status `409`
- **2026-03-02** `8c167ee47363` — 1 info
  - api operation id `document_add` removed and replaced with `add_document`
- **2026-02-26** `e5def1d468f5` — 3 info
  - api operation id `collection_add` removed and replaced with `document_add`
  - api tag `document` added
  - api tag `collection` removed
- **2026-02-24** `598f4d25a175` — 1 info
  - api operation id `collection_create` removed and replaced with `collection_add`

[Full history](https://skmtc.dev/sourcenetwork/apis/defradb-api/changes/collections/:name/post.md)

---

[API](https://skmtc.dev/sourcenetwork/apis/defradb-api.md) · [All operations](https://skmtc.dev/sourcenetwork/apis/defradb-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sourcenetwork/defradb-api/revisions/659e79583f79/schema)
