---
title: "CREATE: Inserts a new document into the collection"
method: POST
path: "/{collection}"
tags: ["generic"]
---

# CREATE: Inserts a new document into the collection

`POST /{collection}`

Using this operation you can insert new documents into collection. Normally the operation ends with 201 HTTP status code, `Last-Modified` and `Location` headers specified. `identifier` is included in response body or it can be parsed from the `Location` response header.

When the document to post is marked as a duplicate (using rules described at `API3_DEDUP_FALLBACK_ENABLED` switch), the update operation takes place instead of inserting. In this case the original document in the collection is found and it gets updated by the actual operation POST body. Finally the operation ends with 200 HTTP status code along with `Last-Modified` and correct `Location` headers. The response body then includes `isDeduplication`=`true` and `deduplicatedIdentifier` fields.

This operation provides autopruning of the collection (if autopruning is enabled).

This operation requires `create` (and/or `update` for deduplication) permission for the API and the collection (e.g. `api:treatments:create` and `api:treatments:update`)

## Request body

- union — Single document
  - object — Shared base for all documents
    - `identifier` string — Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. The server calculates the identifier in such a way that duplicate records are automatically merged (deduplicating is made by `date`, `device` and `eventType` fields). The best practise for all applications is not to loose identifiers from received documents, but save them carefully for other consumer applications/systems. API v3 has a fallback mechanism in place, for documents without `identifier` field the `identifier` is set to internal `_id`, when reading or addressing these documents. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `date` integer, required — Required timestamp when the record or event occured, you can choose from three input formats - Unix epoch in milliseconds (1525383610088) - Unix epoch in seconds (1525383610) - ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') The date is always stored in a normalized form - UTC with zero offset. If UTC offset was present, it is going to be set in the `utcOffset` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `utcOffset` integer — Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the `date` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `app` string, required — Application or system in which the record was entered by human or device for the first time. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `device` string — The device from which the data originated (including serial number of the device, if it is relevant and safe). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `_id` string — Internally assigned database id. This field is for internal server purposes only, clients communicate with API by using identifier field.
    - `srvCreated` integer — The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `subject` string — Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed JWT. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `srvModified` integer — The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `modifiedBy` string — Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isValid` boolean — A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isReadOnly` boolean — A flag set by client that locks the document from any changes. Every document marked with `isReadOnly=true` is forever immutable and cannot even be deleted. Any attempt to modify the read-only document will end with status 422 UNPROCESSABLE ENTITY.
    - `some_property` string — ...
  - object — Shared base for all documents
    - `identifier` string — Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. The server calculates the identifier in such a way that duplicate records are automatically merged (deduplicating is made by `date`, `device` and `eventType` fields). The best practise for all applications is not to loose identifiers from received documents, but save them carefully for other consumer applications/systems. API v3 has a fallback mechanism in place, for documents without `identifier` field the `identifier` is set to internal `_id`, when reading or addressing these documents. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `date` integer, required — Required timestamp when the record or event occured, you can choose from three input formats - Unix epoch in milliseconds (1525383610088) - Unix epoch in seconds (1525383610) - ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') The date is always stored in a normalized form - UTC with zero offset. If UTC offset was present, it is going to be set in the `utcOffset` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `utcOffset` integer — Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the `date` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `app` string, required — Application or system in which the record was entered by human or device for the first time. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `device` string — The device from which the data originated (including serial number of the device, if it is relevant and safe). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `_id` string — Internally assigned database id. This field is for internal server purposes only, clients communicate with API by using identifier field.
    - `srvCreated` integer — The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `subject` string — Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed JWT. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `srvModified` integer — The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `modifiedBy` string — Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isValid` boolean — A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isReadOnly` boolean — A flag set by client that locks the document from any changes. Every document marked with `isReadOnly=true` is forever immutable and cannot even be deleted. Any attempt to modify the read-only document will end with status 422 UNPROCESSABLE ENTITY.
    - `type` string — sgv, mbg, cal, etc
    - `sgv` number — The glucose reading. (only available for sgv types)
    - `direction` string — Direction of glucose trend reported by CGM. (only available for sgv types)
    - `noise` number — Noise level at time of reading. (only available for sgv types)
    - `filtered` number — The raw filtered value directly from CGM transmitter. (only available for sgv types)
    - `unfiltered` number — The raw unfiltered value directly from CGM transmitter. (only available for sgv types)
    - `rssi` number — The signal strength from CGM transmitter. (only available for sgv types)
    - `units` string — The units for the glucose value, mg/dl or mmol/l. It is strongly recommended to fill in this field.
  - object — Shared base for all documents
    - `identifier` string — Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. The server calculates the identifier in such a way that duplicate records are automatically merged (deduplicating is made by `date`, `device` and `eventType` fields). The best practise for all applications is not to loose identifiers from received documents, but save them carefully for other consumer applications/systems. API v3 has a fallback mechanism in place, for documents without `identifier` field the `identifier` is set to internal `_id`, when reading or addressing these documents. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `date` integer, required — Required timestamp when the record or event occured, you can choose from three input formats - Unix epoch in milliseconds (1525383610088) - Unix epoch in seconds (1525383610) - ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') The date is always stored in a normalized form - UTC with zero offset. If UTC offset was present, it is going to be set in the `utcOffset` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `utcOffset` integer — Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the `date` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `app` string, required — Application or system in which the record was entered by human or device for the first time. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `device` string — The device from which the data originated (including serial number of the device, if it is relevant and safe). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `_id` string — Internally assigned database id. This field is for internal server purposes only, clients communicate with API by using identifier field.
    - `srvCreated` integer — The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `subject` string — Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed JWT. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `srvModified` integer — The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `modifiedBy` string — Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isValid` boolean — A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isReadOnly` boolean — A flag set by client that locks the document from any changes. Every document marked with `isReadOnly=true` is forever immutable and cannot even be deleted. Any attempt to modify the read-only document will end with status 422 UNPROCESSABLE ENTITY.
    - `food` string — food, quickpick
    - `category` string — Name for a group of related records
    - `subcategory` string — Name for a second level of groupping
    - `name` string — Name of the food described
    - `portion` number — Number of units (e.g. grams) of the whole portion described
    - `unit` string — Unit for the portion
    - `carbs` number — Amount of carbs in the portion in grams
    - `fat` number — Amount of fat in the portion in grams
    - `protein` number — Amount of proteins in the portion in grams
    - `energy` number — Amount of energy in the portion in kJ
    - `gi` number — Glycemic index (1=low, 2=medium, 3=high)
    - `hideafteruse` boolean — Flag used for quickpick
    - `hidden` boolean — Flag used for quickpick
    - `position` number — Ordering field for quickpick
    - `portions` number — component multiplier if defined inside quickpick compound
    - `foods` Food[] — Neighbour documents (from food collection) that together make a quickpick compound
      - `identifier` string — Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. The server calculates the identifier in such a way that duplicate records are automatically merged (deduplicating is made by `date`, `device` and `eventType` fields). The best practise for all applications is not to loose identifiers from received documents, but save them carefully for other consumer applications/systems. API v3 has a fallback mechanism in place, for documents without `identifier` field the `identifier` is set to internal `_id`, when reading or addressing these documents. Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `date` integer, required — Required timestamp when the record or event occured, you can choose from three input formats - Unix epoch in milliseconds (1525383610088) - Unix epoch in seconds (1525383610) - ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') The date is always stored in a normalized form - UTC with zero offset. If UTC offset was present, it is going to be set in the `utcOffset` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `utcOffset` integer — Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the `date` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `app` string, required — Application or system in which the record was entered by human or device for the first time. Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `device` string — The device from which the data originated (including serial number of the device, if it is relevant and safe). Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `_id` string — Internally assigned database id. This field is for internal server purposes only, clients communicate with API by using identifier field.
      - `srvCreated` integer — The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `subject` string — Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed JWT. Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `srvModified` integer — The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `modifiedBy` string — Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `isValid` boolean — A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) Note&#58; this field is immutable by the client (it cannot be updated or patched)
      - `isReadOnly` boolean — A flag set by client that locks the document from any changes. Every document marked with `isReadOnly=true` is forever immutable and cannot even be deleted. Any attempt to modify the read-only document will end with status 422 UNPROCESSABLE ENTITY.
      - `food` string — food, quickpick
      - `category` string — Name for a group of related records
      - `subcategory` string — Name for a second level of groupping
      - `name` string — Name of the food described
      - `portion` number — Number of units (e.g. grams) of the whole portion described
      - `unit` string — Unit for the portion
      - `carbs` number — Amount of carbs in the portion in grams
      - `fat` number — Amount of fat in the portion in grams
      - `protein` number — Amount of proteins in the portion in grams
      - `energy` number — Amount of energy in the portion in kJ
      - `gi` number — Glycemic index (1=low, 2=medium, 3=high)
      - `hideafteruse` boolean — Flag used for quickpick
      - `hidden` boolean — Flag used for quickpick
      - `position` number — Ordering field for quickpick
      - `portions` number — component multiplier if defined inside quickpick compound
      - `foods` Food[] — Neighbour documents (from food collection) that together make a quickpick compound
  - object — Shared base for all documents
    - `identifier` string — Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. The server calculates the identifier in such a way that duplicate records are automatically merged (deduplicating is made by `date`, `device` and `eventType` fields). The best practise for all applications is not to loose identifiers from received documents, but save them carefully for other consumer applications/systems. API v3 has a fallback mechanism in place, for documents without `identifier` field the `identifier` is set to internal `_id`, when reading or addressing these documents. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `date` integer, required — Required timestamp when the record or event occured, you can choose from three input formats - Unix epoch in milliseconds (1525383610088) - Unix epoch in seconds (1525383610) - ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') The date is always stored in a normalized form - UTC with zero offset. If UTC offset was present, it is going to be set in the `utcOffset` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `utcOffset` integer — Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the `date` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `app` string, required — Application or system in which the record was entered by human or device for the first time. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `device` string — The device from which the data originated (including serial number of the device, if it is relevant and safe). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `_id` string — Internally assigned database id. This field is for internal server purposes only, clients communicate with API by using identifier field.
    - `srvCreated` integer — The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `subject` string — Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed JWT. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `srvModified` integer — The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `modifiedBy` string — Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isValid` boolean — A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isReadOnly` boolean — A flag set by client that locks the document from any changes. Every document marked with `isReadOnly=true` is forever immutable and cannot even be deleted. Any attempt to modify the read-only document will end with status 422 UNPROCESSABLE ENTITY.
    - `some_property` string — ...
  - object — Shared base for all documents
    - `identifier` string — Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. The server calculates the identifier in such a way that duplicate records are automatically merged (deduplicating is made by `date`, `device` and `eventType` fields). The best practise for all applications is not to loose identifiers from received documents, but save them carefully for other consumer applications/systems. API v3 has a fallback mechanism in place, for documents without `identifier` field the `identifier` is set to internal `_id`, when reading or addressing these documents. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `date` integer, required — Required timestamp when the record or event occured, you can choose from three input formats - Unix epoch in milliseconds (1525383610088) - Unix epoch in seconds (1525383610) - ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') The date is always stored in a normalized form - UTC with zero offset. If UTC offset was present, it is going to be set in the `utcOffset` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `utcOffset` integer — Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the `date` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `app` string, required — Application or system in which the record was entered by human or device for the first time. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `device` string — The device from which the data originated (including serial number of the device, if it is relevant and safe). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `_id` string — Internally assigned database id. This field is for internal server purposes only, clients communicate with API by using identifier field.
    - `srvCreated` integer — The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `subject` string — Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed JWT. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `srvModified` integer — The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `modifiedBy` string — Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isValid` boolean — A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isReadOnly` boolean — A flag set by client that locks the document from any changes. Every document marked with `isReadOnly=true` is forever immutable and cannot even be deleted. Any attempt to modify the read-only document will end with status 422 UNPROCESSABLE ENTITY.
    - `some_property` string — ...
  - object — Shared base for all documents
    - `identifier` string — Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. The server calculates the identifier in such a way that duplicate records are automatically merged (deduplicating is made by `date`, `device` and `eventType` fields). The best practise for all applications is not to loose identifiers from received documents, but save them carefully for other consumer applications/systems. API v3 has a fallback mechanism in place, for documents without `identifier` field the `identifier` is set to internal `_id`, when reading or addressing these documents. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `date` integer, required — Required timestamp when the record or event occured, you can choose from three input formats - Unix epoch in milliseconds (1525383610088) - Unix epoch in seconds (1525383610) - ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') The date is always stored in a normalized form - UTC with zero offset. If UTC offset was present, it is going to be set in the `utcOffset` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `utcOffset` integer — Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the `date` field. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `app` string, required — Application or system in which the record was entered by human or device for the first time. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `device` string — The device from which the data originated (including serial number of the device, if it is relevant and safe). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `_id` string — Internally assigned database id. This field is for internal server purposes only, clients communicate with API by using identifier field.
    - `srvCreated` integer — The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `subject` string — Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed JWT. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `srvModified` integer — The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `modifiedBy` string — Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isValid` boolean — A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `isReadOnly` boolean — A flag set by client that locks the document from any changes. Every document marked with `isReadOnly=true` is forever immutable and cannot even be deleted. Any attempt to modify the read-only document will end with status 422 UNPROCESSABLE ENTITY.
    - `eventType` string — The type of treatment event. Note&#58; this field is immutable by the client (it cannot be updated or patched)
    - `glucose` string — Current glucose.
    - `glucoseType` string — Method used to obtain glucose, Finger or Sensor.
    - `units` string — The units for the glucose value, mg/dl or mmol/l. It is strongly recommended to fill in this field when `glucose` is entered.
    - `carbs` number — Amount of carbs given.
    - `protein` number — Amount of protein given.
    - `fat` number — Amount of fat given.
    - `insulin` number — Amount of insulin, if any.
    - `duration` number — Duration in minutes.
    - `preBolus` number — How many minutes the bolus was given before the meal started.
    - `splitNow` number — Immediate part of combo bolus (in percent).
    - `splitExt` number — Extended part of combo bolus (in percent).
    - `percent` number — Eventual basal change in percent.
    - `absolute` number — Eventual basal change in absolute value (insulin units per hour).
    - `targetTop` number — Top limit of temporary target.
    - `targetBottom` number — Bottom limit of temporary target.
    - `profile` string — Name of the profile to which the pump has been switched.
    - `reason` string — For example the reason why the profile has been switched or why the temporary target has been set.
    - `notes` string — Description/notes of treatment.
    - `enteredBy` string — Who entered the treatment.

## Response `200`

Successfully updated a duplicate document in the collection

- object
  - `status` integer
  - `identifier` string — Identifier of created or modified document
  - `isDeduplication` boolean — Flag whether the operation found a duplicate document (to update)
  - `deduplicatedIdentifier` string — The original document that has been marked as a duplicate document and which has been updated

## Other responses

- `201` — Successfully created a new document in collection
- `400` — The request is malformed. There may be some required parameters missing or there are unrecognized parameters present.
- `401` — The request was not successfully authenticated using JWT, so that the request cannot continue due to the security policy.
- `403` — Insecure HTTP scheme used or the request has been successfully authenticated, but the security subject is not authorized for the operation.
- `404` — The collection or document specified was not found.
- `422` — The client request is well formed but a server validation error occured. Eg. when trying to modify or delete a read-only document (having `isReadOnly=true`).

## Changes

- **2026-07-17** `5b0d424433e1` — 1 info
  - the endpoint scheme security `accessToken` was removed from the API
- **2021-01-07** `8252719e8e34` — 1 breaking, 10 info
  - removed the success response with the status `204`
  - the endpoint scheme security `accessToken` was added to the API
  - the endpoint scheme security `jwtoken` was added to the API
  - the endpoint scheme security `apiKeyAuth` was removed from the API
  - …7 more
- **2019-11-02** `6b2eb690f4ab` — 7 info
  - added the new optional request property `oneOf[#/components/schemas/DeviceStatus]/allOf[#/components/schemas/DocumentBase]/isReadOnly`
  - added the new optional request property `oneOf[#/components/schemas/Entry]/allOf[#/components/schemas/DocumentBase]/isReadOnly`
  - added the new optional request property `oneOf[#/components/schemas/Food]/allOf[#/components/schemas/DocumentBase]/isReadOnly`
  - added the new optional request property `oneOf[#/components/schemas/Profile]/allOf[#/components/schemas/DocumentBase]/isReadOnly`
  - …3 more
- **2019-10-09** `e3a793475629` — 6 breaking, 6 warning, 7 info
  - removed the media type `application/json` for the response with the status `201`
  - removed the media type `application/json` for the response with the status `400`
  - removed the media type `application/json` for the response with the status `401`
  - removed the media type `application/json` for the response with the status `403`
  - …15 more

[Change history](https://skmtc.dev/nightscout/apis/nightscout-api/changes/:collection/post.md)

---

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