API v1currentBase URLhttps://api.sendlib.com/v1Bearer API key

API

Account

Introspect the current tenant and manage API keys and SMTP credentials.

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.

Scope
Any API key

Returns

  • tenant_idstring

    Tenant UUID.

  • tenant_namestring

    Tenant name (best-effort).

  • api_key_idstring

    API 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.

Scope
manage:api-keys

Store the raw key securely; it is returned only once.

Body

  • namestringRequired

    Display name.

  • scopesstring[]Required

    Scopes 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.

Scope
manage:smtp-credentials

Store the SMTP password securely; it is returned only once.

Body

  • usernamestring

    Optional 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.

Scope
manage:smtp-credentials
curl -X POST "https://api.sendlib.com/v1/smtp-credentials/ensure" \
  -H "Authorization: Bearer $SENDLIB_API_KEY"
{
  "error": {
    "message": "Missing or invalid API key."
  }
}

List SMTP credentials

GET/v1/smtp-credentials

List active SMTP credentials for the current tenant.

Scope
manage:smtp-credentials
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