Create Content Editor
Endpoint
POST /content/:contentId/edit
Description
This endpoint allows you to create a new content editor for an existing piece of content. It generates a unique URL for editing the content and optionally sets expiration and password protection.
Authentication
Authentication is required for this endpoint. Include an API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
contentId | string | Yes | The ID of the content to be edited. This should be provided in the URL path. |
Request Body
The request body should be a JSON object with the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
returnUrl | string | Yes | A URL to redirect to after editing is complete. |
expires | boolean | Yes | Whether the editor link should expire. Defaults to true. |
expiresInMinutes | number | Yes | The number of minutes until the editor link expires. Defaults to 60. |
requiresPassword | boolean | No | Whether the editor should be password protected. Defaults to false. |
password | string | No | The password for accessing the editor. Required if requiresPassword is true. |
onSaveWebhookUrl | string | No | A webhook URL to be called when the content is saved. |
Response
Success Response
Code: 200 OK
Content example:
{
"success": true,
"editorUrl": "https://example.com/content/t/00000000-0000-0000-0000-000000000000",
"contentEditorId": "00000000-0000-0000-0000-000000000000"
}
Error Responses
Missing Content ID or Authorization Error
Code: 400 Bad Request
Content example:
{
"error": "No contentId provided or missing Authorization header"
}
Unauthorized Error
Code: 401 Unauthorized
Content example:
{
"error": "Unauthorized"
}
Content Not Found Error
Code: 404 Not Found
Content example:
{
"error": "Content not found"
}
Server Error
Code: 500 Internal Server Error
Content example:
{
"error": "Failed to create content editor"
}
Notes
- If successful, the response includes a unique
editorUrlfor accessing the content editor and acontentEditorId. - The
expires,expiresInMinutes,requiresPassword, andpasswordfields allow you to control access to the editor. - You can specify a
returnUrlto redirect users after editing and anonSaveWebhookUrlto be notified when changes are saved. - If any error occurs during the process, appropriate error messages and status codes will be returned.