By using the PUT API, you can submit content via the API.
Unlike the POST API, it allows you to specify the content ID to create content.
This is the authentication key required for PUT API requests.
Please enable "PUT" with default permissions or individual permissions and include it in the request header when sending.
If the X-MICROCMS-API-KEY is identifiable, it may allow unauthorized manipulation of content by third parties. Please handle it with care. For more details, please refer to "API Key (API Authentication and Authorization Management)".
Specifies the format of the data being sent.
Since microCMS only handles data in JSON format, please specify application/json.
This parameter is used to create content in draft or closed status.
status=draft as a parameter.status=closed as a parameter.Prepare the JSON of the content you want to send according to the API schema and pass it as a string.
Example:
{"title":"Sample Title","category": ["Sample Category"]}Please specify any string.
(Example: "Text 1")
You can specify a multi-line string using newline characters.
(Example: "Input multiple lines of text\nInput multiple lines of text")
You can specify decorations and images using HTML strings. For more details, please refer to the Rich Editor WRITE API.
(Example: "<h1>Heading</h1><p>You can submit in HTML like this</p>")
You can specify a multi-line string using newline characters.
(Example: "Input multiple lines of text\nInput multiple lines of text")
Registration with HTML tags is not supported.
※If HTML is registered, it will be escaped as follows.<p>Text 1</p> → &lt;p&gt;Text 1&lt;/p&gt;
Please specify the URL of the image uploaded to the same service of microCMS.
(Example: "https://images.microcms-assets.io/assets/xxxxxxxx/yyyyyyyy/sample.png")
If a custom domain for media is set, both the custom domain and the default domain (microcms-assets.io) are accepted.
Also, specifying an invalid URL as follows will result in an error.
Please specify the URLs of images uploaded to the same service of microCMS as an array.
(Example: ["https://images.microcms-assets.io/assets/xxxxxxxx/yyyyyyyy/sample1.png", "https://images.microcms-assets.io/assets/xxxxxxxx/yyyyyyyy/sample2.png"])
The specifications for image URLs are the same as for the image field.
Please specify as a string in ISO format (ISO 8601).
(Example: "2024-01-01T00:00:00Z")
Please specify a number.
(Example: 123)
Please specify a boolean value.
(Example: true)
Please specify the elements of the select field as an array.
(Example: ["Element 1","Element 2"])
Please specify the contentId of the referenced content.
(Example: "referenced id")
Please specify the contentIds of the referenced contents as an array.
(Example: ["referenced id1","referenced id2"])
Please specify the target data in object format, including fieldId and the field value.
(Example: { "fieldId": "YOURFIELDID", "some_value": "" })
Please specify the target data as an array of custom fields. Each element of the array must include fieldId and the field value.
Example:
[
{
"fieldId": "YOURFIRSTFIELDID",
"sometext_value": ""
},
{
"fieldId": "YOUR_SECOND_FIELD_ID",
"some_int_value": 10
}
]Please specify the URL of the media uploaded to the same service of microCMS.
(Example: "https://files.microcms-assets.io/assets/xxxxxxxx/yyyyyyyy/manual.pdf")
If a custom domain for media is set, both the custom domain and the default domain (microcms-assets.io) are accepted.
Also, specifying an invalid URL as follows will result in an error.
Please specify the content of the target data (message part) in object format. You can specify only the properties you want to register.
For details on each value, please check the Extended Field.
Example:
{
"id": "some-id",
"title": "some-title",
"description": "some-description",
"imageUrl": "https://images.microcms-assets.io/assets/xxxx/yyyy/{fileName}.png",
"updatedAt": "2024-01-01T00:00:00Z",
"data": { "id": "123" }
}Please specify as a string in ISO format (ISO 8601).
(Example: "2024-01-01T00:00:00Z")
If you want to register a field with an empty value in the PUT API, please make the request without including the key of the relevant field in the request body.
If the content is created successfully, a 201 response will be returned.
If the request is executed successfully, the response body will look like this:
{
"id": "someId"
}Please refer to the Content API Error Response.