---
title: "Create one or more new messages."
method: POST
path: "/v3/messages/{logId}/_bulk"
tags: ["Messages"]
---

# Create one or more new messages.

`POST /v3/messages/{logId}/_bulk`

Required permission: `messages_write`

## Path parameters

- `logId` string, required

## Request body

- CreateMessage[]
  - `application` string — Used to identify which application logged this message. You can use this if you have multiple applications and services logging to the same log
  - `detail` string — A longer description of the message. For errors this could be a stacktrace, but it's really up to you what to log in there.
  - `hostname` string — The hostname of the server logging the message.
  - `title` string — The textual title or headline of the message to log. The first 50k characters are searchable.
  - `titleTemplate` string — The title template of the message to log. This property can be used from logging frameworks that supports structured logging like: "{user} says {quote}". In the example, titleTemplate will be this string and title will be "Gilfoyle says It's not magic. It's talent and sweat". The first 50k characters are searchable.
  - `source` string — The source of the code logging the message. This could be the assembly name.
  - `statusCode` integer — If the message logged relates to a HTTP status code, you can put the code in this property. This would probably only be relevant for errors, but could be used for logging successful status codes as well.
  - `dateTime` string, date-time — The date and time in UTC of the message. If you don't provide us with a value in dateTime, we will set the current date and time in UTC.
  - `type` string — The type of message. If logging an error, the type of the exception would go into type but you can put anything in there, that makes sense for your domain.
  - `user` string — An identification of the user triggering this message. You can put the users email address or your user key into this property.
  - `severity` string — An enum value representing the severity of this message. The following values are allowed: Verbose, Debug, Information, Warning, Error, Fatal
  - `url` string — If message relates to a HTTP request, you may send the URL of that request. If you don't provide us with an URL, we will try to find a key named URL in serverVariables.
  - `method` string — If message relates to a HTTP request, you may send the HTTP method of that request. If you don't provide us with a method, we will try to find a key named REQUEST_METHOD in serverVariables.
  - `version` string — Versions can be used to distinguish messages from different versions of your software. The value of version can be a SemVer compliant string or any other syntax that you are using as your version numbering scheme.
  - `correlationId` string — CorrelationId can be used to group similar log messages together into a single discoverable batch. A correlation ID could be a session ID from ASP.NET Core, a unique string spanning multiple microsservices handling the same request, or similar.
  - `code` string — Code can be used to include source code related to the log message. The code will typically span from a few lines before the line causing the log message to a few lines after. For now, all lines above 21 will be removed. This makes room for showing 10 lines before the logging line, the logging line, and 10 lines after the logging line. Don't include a very large string in this property since that will quickly make the entire messages exceed the max limit of 256 kb.
  - `category` string — The log message category. Category can be a string of choice but typically contain a logging category set by a logging framework like NLog or Serilog. When logging through a logging framework, this field will be provided by the framework and not something that needs to be set manually.
  - `cookies` Item[] — A key/value pair of cookies. This property only makes sense for logging messages related to web requests.
    - `key` string — The key of the item.
    - `value` string — The value of the item.
  - `form` Item[] — A key/value pair of form fields and their values. This property makes sense if logging message related to users inputting data in a form.
    - `key` string — The key of the item.
    - `value` string — The value of the item.
  - `queryString` Item[] — A key/value pair of query string parameters. This property makes sense if logging message related to a HTTP request.
    - `key` string — The key of the item.
    - `value` string — The value of the item.
  - `serverVariables` Item[] — A key/value pair of server values. Server variables are typically related to handling requests in a webserver but could be used for other types of information as well.
    - `key` string — The key of the item.
    - `value` string — The value of the item.
  - `data` Item[] — A key/value pair of user-defined fields and their values. When logging an exception, the Data dictionary of the exception is copied to this property. You can add additional key/value pairs, by modifying the Data dictionary on the exception or by supplying additional key/values to this API.
    - `key` string — The key of the item.
    - `value` string — The value of the item.
  - `breadcrumbs` Breadcrumb[] — A list of breadcrumbs preceding this log message.
    - `dateTime` string, date-time — The date and time in UTC of the breadcrumb. If no date and time is provided, we will use the current date and time in UTC.
    - `severity` string — An enum value representing the severity of this breadcrumb. The following values are allowed: Verbose, Debug, Information, Warning, Error, Fatal.
    - `action` string — An action representing the breadcrumb. You can set a custom action or use one of the built-in: click, submit, navigation, request, error.
    - `message` string — A message representing the breadcrumb. This should elaborate on the action.

## Response `200`

Zero or more messages where successfully created. Check the response body for details.

- CreateBulkMessageResult[]
  - `statusCode` integer — Status code of the individual messages as if it were being created through the non-bulk endpoint. If a message was succesfully created, the status code will be 201 and location will contain an URL. If a message was ignored, the status code will be 200 and the location will be empty.
  - `location` string, uri — The location of the created message if StatusCode equals Created.

## Other responses

- `400` — Something wrong with the query parameters.
- `401` — API key not valid or no access to resource.
- `402` — Tried to call the logs API but the trial expired.
- `404` — Log not found.
- `429` — A maximum of 500 requests per minute and 3600 requests per hour are permitted

---

[API](https://skmtc.net/elmah/apis/elmah-io-api.md) · [All operations](https://skmtc.net/elmah/apis/elmah-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elmah/elmah-io-api/versions/8e9c6e56e4fa/schema)
