Skip to main content

Manage email campaigns

Create an email campaign

Create a new email campaign by issuing a POST request to the marketing-campaigns endpoint.

POST https://admin-api.phosphor.xyz/v1/marketing-campaigns
Example payload
{
"name": "Lazaro70",
"email_from": "Lazaro70"
}
  • name - A uniquely identifiable name for the campaign.
  • email_from - An optional field to label where the email comes from. The default value is [Your Org Name] via Phosphor.
Example response
{
"created_at": "2023-04-11T03:22:50.579761+00:00",
"email_from": "Lazaro70",
"id": "762f86b9-3a45-43ef-a617-2562839a20ed",
"name": "Lazaro70"
}

Edit an email campaign

Update an email campaign by issuing a PATCH request to the marketing-campaigns/{campaign_id} endpoint.

PATCH https://admin-api.phosphor.xyz/v1​/marketing-campaigns/{campaign_id}
Example payload
{
"name": "Lazaro70",
"email_from": "Lazaro70"
}
Example response
{
"created_at": "2023-04-11T03:22:50.579761+00:00",
"email_from": "Lazaro70",
"id": "762f86b9-3a45-43ef-a617-2562839a20ed",
"name": "Lazaro70"
}

Get email campaigns

To get all email campaigns, issue a GET request to the marketing-campaigns endpoint.

GET https://admin-api.phosphor.xyz/v1​/marketing-campaigns

This is a paginated endpoint that returns results up to a certain limit.

  • Specify the cursor from the previous response to return the next batch of results from the offset.
  • Specify an order_direction of ASC or DESC to sort results in an ascending or descending order.
GET https://admin-api.phosphor.xyz/v1​/marketing-campaigns?limit=1

You can all query the results by specifying a name.

GET https://admin-api.phosphor.xyz/v1/marketing-campaigns?name=Lazaro70
Example response
{
"cursor": "ZHQAMTY4MDI3MzczMi42MjE4Mjk.",
"has_more": false,
"results": [
{
"created_at": "2023-03-31T14:42:12.621829+00:00",
"email_from": "Walter - Fisher",
"id": "62b6fe24-1359-4564-a2a5-100334904098",
"name": "Lazaro70"
}
],
"total_results": 1
}

Delete an email campaign

Delete a new email campaign by issuing a DELETE request to the marketing-campaigns/{campaign_id} endpoint.

caution

Deleting an email campaign will delete all associated customized email templates from this campaign. Existing listings or email claims using this campaign will reset to using platform default templates.

DELETE https://admin-api.phosphor.xyz/v1/marketing-campaigns/{campaign_id}

A response of 204 suggests that the campaign is successfully deleted.