Create an email content
Prerequisites: Retrieving the Group ID
Content creation requires an association with a specific group. Before initiating creation, you must retrieve the identifier (group_id) of the group the account has access to via the dedicated endpoint.
Endpoint: GET {subdomain}.api.numberly.com/v1/settings/groups
Request Example
curl -X GET "https://{subdomain}.api.numberly.com/v1/settings/groups" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json"
Response Example
{
"objects": [
{
"id": "65df06372b43d70716133716",
"name": "Groupe Marketing France"
}
],
"metadata": {
"timestamp": 1744375392.0
},
"pagination": {
"total": 1,
"limit": 20,
"page": 1
}
}
Creating Email Content via API
The API allows for the creation of HTML content. You can send raw HTML code as well as graphic assets (images) that need to be hosted on the platform's CDN.
Image Management
- Already hosted images: URLs for images that are already hosted and present in the HTML code are not modified.
- Images to be hosted by NMP: Images can be attached to the payload. The platform will host them on its CDN.
Endpoint
POST /v1/contents
Payload Parameters (PostContentPayload)
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Internal name of the content. |
group_id | String | Yes | Group identifier retrieved previously. |
content | String | Yes | The HTML source code of the template (or raw text). |
type | String | No | Content type, default is html. Only supported value: html. |
usage | String | No | Content usage, default is email. Only supported value: email. |
images | Array | No | List of image objects to be hosted on the CDN. |
Image Object Structure
If you are sending local images, each object in the images array must contain:
filename(String): Name of the file (e.g.,header.jpg).type(String): MIME type (e.g.,image/jpeg).content(String): Content of the image encoded in Base64.
Implementation Example
The example below creates HTML content and requests the hosting of a local image named banner.jpg.
curl -X POST "https://{subdomain}.api.numberly.com/v1/contents" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Newsletter Soldes Hiver 2025",
"group_id": "65df06372b43d70716133716",
"type": "html",
"usage": "email",
"content": "<html><body><h1>Nos Soldes</h1><img src=\"banner.jpg\" alt=\"Bannière\" /><p>Découvrez nos offres.</p></body></html>",
"images": [
{
"filename": "banner.jpg",
"type": "image/jpeg",
"content": "/9j/4AAQSkZJRgABAQEASABIAAD..."
}
]
}'
Success Response
The API returns the unique identifier of the created content (id).
{
"id": 1024
}
Post-Creation Operations
Once the content is created and its id retrieved, you can interact with it via the following endpoints:
- Retrieve the content: Get content details (including image URLs transformed by the CDN) via
GET {subdomain}.api.numberly.com/v1/contents/{content_id}. - Create a campaign: Use the content ID during campaign creation via
POST {subdomain}.api.numberly.com/v1/campaigns.
Conclusion
Content created via the API is centralized and accessible: you can find and edit it directly in the content list within the Factorly interface.
Filtering
Many list endpoints support narrowing results via a company-wide `filter[field][key(optional)][$op]=value` query convention, letting you filter by field, operator and value directly from the query string.
Retrieve email contents
This technical guide details the methods for programmatically retrieving HTML content resources stored on the Numberly Martech Platform (NMP). The API provides access to this content either via a paginated list or individually using a specific identifier.