Skip to main content

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

ParameterTypeRequiredDescription
contentIdstringYesThe 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:

PropertyTypeRequiredDescription
returnUrlstringYesA URL to redirect to after editing is complete.
expiresbooleanYesWhether the editor link should expire. Defaults to true.
expiresInMinutesnumberYesThe number of minutes until the editor link expires. Defaults to 60.
requiresPasswordbooleanNoWhether the editor should be password protected. Defaults to false.
passwordstringNoThe password for accessing the editor. Required if requiresPassword is true.
onSaveWebhookUrlstringNoA 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 editorUrl for accessing the content editor and a contentEditorId.
  • The expires, expiresInMinutes, requiresPassword, and password fields allow you to control access to the editor.
  • You can specify a returnUrl to redirect users after editing and an onSaveWebhookUrl to be notified when changes are saved.
  • If any error occurs during the process, appropriate error messages and status codes will be returned.