Skip to main content

2 posts tagged with "breaking"

View All Tags

Email API enforces API key scopes

The Email API now checks the scopes of the key, as the dashboard has always described them:

  • Sending (POST /emails, POST /emails/batch, the SMTP relay) and changing a scheduled send (PATCH /emails/{id}, POST /emails/{id}/cancel) need email:send.
  • Reading emails (GET /emails, GET /emails/{id}, GET /emails/{id}/events) needs email:read; email:send and email:write include it.

Before, any valid key could call these endpoints. A key without the scope now gets 401 restricted_api_key (550 5.7.1 over SMTP). Keys with full access (*), email:* or email:send are not affected. If a key that sends email has only other scopes, such as email:write or chat:*, add email:send to it under API Keys in the dashboard.

@hatang/sdk 0.4.0: production by default, templates, global contacts, automations

@hatang/sdk 0.4.0 calls https://api.hatang.dev by default. Before, a client created without baseUrl or HATANG_BASE_URL called http://localhost:3001; local development now passes baseUrl (or sets HATANG_BASE_URL) instead.

New calls:

  • Templates: templates.create/get/list/update/remove/publish/duplicate, and emails.send({ to, template: { id, variables } }).
  • Global contacts: contacts.* without audience_id, by id or email, with properties, segments and topics; new segments, topics and contactProperties namespaces. audience_id still uses the older audience routes.
  • Automations: events.*, automations.* and automations.runs.*.
  • Insights: emails.metrics(), logs.list/get and usage.get.

The blog namespace is removed. See the Node.js guide.