Create Email Folder
POST
/api/v1/workspaces/{workspace_id}/email_folders
const url = 'https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/email_folders';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Newsletters","project_id":1,"parent_id":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/email_folders \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Newsletters", "project_id": 1, "parent_id": 1 }'Creates a new email folder.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”workspace_id
required
integer
Workspace ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
Folder name
string
Example
Newslettersproject_id
required
The ID of the project the folder belongs to.
integer
Example
1parent_id
The ID of the parent folder. Omit or pass null to create the folder at the root of the project.
integer | null
Example
1Responses
Section titled “ Responses ”Successful
Media typeapplication/json
object
id
required
integer
name
required
string
project_id
required
integer
parent_id
required
The parent folder ID, or null for a folder at the root of the project.
integer | null
organization_id
required
integer
email_count
required
integer
folder_count
required
integer
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{ "id": 12345, "name": "Newsletters", "project_id": 12345, "parent_id": 12345, "organization_id": 12345, "email_count": 4, "folder_count": 2, "created_at": "2023-08-23T10:30:00.000Z", "updated_at": "2023-08-23T10:30:00.000Z"}Unauthorized
Media typeapplication/json
object
message
required
string
code
string
Example
{ "message": "Record not found", "code": "share_link_expired"}Forbidden
Media typeapplication/json
object
message
required
string
code
string
Example
{ "message": "Record not found", "code": "share_link_expired"}Not Found
Media typeapplication/json
object
message
required
string
code
string
Example
{ "message": "Record not found", "code": "share_link_expired"}Unprocessable Entity
Media typeapplication/json
object
message
required
string
errors
required
object
key
additional properties
Array<string>
Example
{ "errors": { "username": [ "Username is required.", "Username must be unique." ], "email": [ "Invalid email format." ] }}