These endpoints act on the tenant that owns the API key: who you are, which scopes the key holds, and the credentials your services send with.
Get current tenant
GET/v1/me
Returns tenant identity and API key scopes.
Returns
tenant_idstringTenant UUID.
tenant_namestringTenant name (best-effort).
api_key_idstringAPI key id.
scopesstring[]Scopes on the key.
curl "https://api.sendlib.com/v1/me" \
-H "Authorization: Bearer $SENDLIB_API_KEY"{
"tenant_id": "…",
"tenant_name": "…",
"api_key_id": "…",
"scopes": [
"…"
]
}Create API key
POST/v1/api-keys
Creates a new API key for the current tenant. The raw key is returned once.
Store the raw key securely; it is returned only once.
Body
namestringRequiredDisplay name.
scopesstring[]RequiredScopes for the new key (must be subset of caller scopes).
curl -X POST "https://api.sendlib.com/v1/api-keys" \
-H "Authorization: Bearer $SENDLIB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "prod-sender",
"scopes": ["send:transmissions"]
}'{"api_key_id": "…", "raw_key": "…"}Create SMTP credential
POST/v1/smtp-credentials
Creates a new SMTP credential and returns the password once.
Store the SMTP password securely; it is returned only once.
Body
usernamestringOptional human-friendly username.
curl -X POST "https://api.sendlib.com/v1/smtp-credentials" \
-H "Authorization: Bearer $SENDLIB_API_KEY"{
"smtp_credential_id": "…",
"smtp_user": "…",
"smtp_password": "…"
}Ensure SMTP credential
POST/v1/smtp-credentials/ensure
Ensures an SMTP credential exists for the tenant. Depending on parameters, may create a new credential or return an existing one.
curl -X POST "https://api.sendlib.com/v1/smtp-credentials/ensure" \
-H "Authorization: Bearer $SENDLIB_API_KEY"{
"error": {
"message": "Missing or invalid API key."
}
}curl "https://api.sendlib.com/v1/smtp-credentials" \
-H "Authorization: Bearer $SENDLIB_API_KEY"{
"items": [
{
"smtp_credential_id": "…",
"smtp_user": "…",
"created_at": "…",
"last_used_at": null
}
]
}Next
- Least privilege: Security
- If calls fail: Troubleshooting
