Hi @IHaida,
I don’t think the endpoint you are calling is valid. Or at least it’s certainly not one that I am familiar with. I cannot find it documented anywhere on the HubSpot Developer site. It’s true you can create marketing emails via API but this is done using the v1 endpoint here and it does not require you to specify an owner ID. For instance:
curl --location --request POST 'https://api.hubapi.com/marketing-emails/v1/emails' --header 'Authorization: Bearer XXXXXXXXXXXX' --header 'Content-Type: application/json' --data-raw '{"name": "My first API marketing email!","subject": "Sample subject line"}'
Returns the below and for the most part if you include any of the below in your initial POST request you can set create the email with various pieces of information preset and ready to go.
{"ab": false,"abHoursToWait": 4,"abSampleSizeDefault": null,"abSamplingDefault": null,"abSuccessMetric": null,"abTestPercentage": 50,"abVariation": false,"absoluteUrl": "http://xxxxxx.hs-sites-eu1.com/-temporary-slug-bc511b85-a54d-40dd-933a-b77f16bd2956","allEmailCampaignIds": [],"analyticsPageId": "51526178296","analyticsPageType": "email","archived": false,"archivedAt": 0,"archivedInDashboard": false,"audienceAccess": "PUBLIC","blogRssSettings": null,"canSpamSettingsId": 51418157807,"categoryId": 2,"contentAccessRuleIds": [],"contentAccessRuleTypes": [],"contentTypeCategory": 2,"createPage": false,"created": 1659701891943,"createdById": 46163190,"currentState": "DRAFT","currentlyPublished": false,"customReplyTo": "","customReplyToEnabled": false,"domain": "","emailBody": "{% content_attribute \"email_body\" %}{{ default_email_body }}{% end_content_attribute %}","emailNote": "","emailTemplateMode": "DESIGN_MANAGER","emailType": "BATCH_EMAIL","feedbackSurveyId": null,"flexAreas": {},"freezeDate": 1659701891943,"fromName": "","hasContentAccessRules": false,"htmlTitle": "","id": 51526178296,"isGraymailSuppressionEnabled": true,"isPublished": false,"isRecipientFatigueSuppressionEnabled": null,"language": "en","layoutSections": {},"liveDomain": "xxxxxxx.hs-sites-eu1.com","mailingListsExcluded": [],"mailingListsIncluded": [],"maxRssEntries": 5,"metaDescription": "","name": "My first API marketing email!","pageExpiryEnabled": false,"pageRedirected": false,"pastMabExperimentIds": [],"portalId":xxxxxxx,"previewKey": "VsCBuisB","processingStatus": "","publishDate": 1659701892042,"publishImmediately": true,"publishedUrl": "","replyTo": "","resolvedDomain": "xxxxxxx.hs-sites-eu1.com","rssEmailByText": "By","rssEmailClickThroughText": "Read more »","rssEmailCommentText": "Comment »","rssEmailEntryTemplateEnabled": false,"rssEmailImageMaxWidth": 0,"rssEmailUrl": "","sections": {},"securityState": "NONE","slug": "-temporary-slug-bc511b85-a54d-40dd-933a-b77f16bd2956","smartEmailFields": null,"state": "DRAFT","styleSettings": null,"subcategory": "batch","subject": "Sample subject line","subscription": 148019002,"subscriptionName": "test","teamPerms": [],"templatePath": "","transactional": false,"translations": {},"unpublishedAt": 0,"updated": 1659701891943,"updatedById": 46163190,"url": "http://xxxxxxx.hs-sites-eu1.com/-temporary-slug-bc511b85-a54d-40dd-933a-b77f16bd2956","useRssHeadlineAsSubject": false,"userPerms": [],"vidsExcluded": [],"vidsIncluded": [],"widgets": {}}