> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trylath.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Every Lath operation is POST https://platform.trylath.com/<operation name with dots replaced by slashes>, with a JSON body and `Authorization: Bearer <key>`. `email.send` is POST /email/send.
> Branch on `error.code`, never on `error.message`. Every refusal also carries `error.fix`, which names the next step.
> Send an `Idempotency-Key` header on any operation that is not retry-safe, so a retry cannot run it twice.
> A `lath_test_` key emails only the account's own members and sends no SMS; a `lath_live_` key reaches real recipients and is billed.
> The OpenAPI document, generated from the same registry as the routes, is at https://platform.trylath.com/openapi.json.

# Quickstart

> From no account to a sent message in three calls. Nothing here needs a dashboard, a credit card, or a person.

<Steps>
  <Step title="Create an account">
    `account.signup` is the only operation that needs no key. It creates an account, a project, and live and test environments, and returns a secret and publishable key for each.

    The keys are returned once and never again by any operation — store the live one before the next call. The owner seat activates when you follow the link it emails; the keys work immediately either way.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://platform.trylath.com/account/signup \
        -H "Content-Type: application/json" \
        -d '{"email":"you@example.com","country":"US"}'
      ```

      ```ts TypeScript theme={null}
      import { createLath } from "@trylath/sdk";

      const lath = createLath();

      const { result } = await lath.account.signup({ email: "you@example.com", country: "US" });
      ```

      ```bash CLI theme={null}
      lath account signup --email you@example.com --country US
      ```
    </CodeGroup>
  </Step>

  <Step title="Cap the month before anything can send">
    A new project has **no** cap. Set one now rather than later: a cap is checked at send time, and until one exists there is nothing to check.

    The cap covers metered sends — emails and SMS segments. Monthly active users are billed monthly and cannot be refused, so they sit outside it.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://platform.trylath.com/billing/cap/set \
        -H "Authorization: Bearer $LATH_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{"monthlyCapCents":500}'
      ```

      ```ts TypeScript theme={null}
      import { createLath } from "@trylath/sdk";

      const lath = createLath({ key: process.env.LATH_API_KEY });

      const { result } = await lath.billing.cap.set({ monthlyCapCents: 500 });
      ```

      ```bash CLI theme={null}
      lath billing cap set --monthlyCapCents 500
      ```
    </CodeGroup>
  </Step>

  <Step title="Send something">
    `sms.send` and `email.send` both ask the audience policy before anything leaves: a recipient who has opted out is recorded as suppressed rather than delivered.

    Read the reply before telling anyone it was sent. A `blocked` object means the message is stored and has not left — today that is what SMS returns, because no carrier registration has been filed yet.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://platform.trylath.com/sms/send \
        -H "Authorization: Bearer $LATH_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{"to":"+14155550100","body":"Spring sale starts today.","topic":"promotions"}'
      ```

      ```ts TypeScript theme={null}
      import { createLath } from "@trylath/sdk";

      const lath = createLath({ key: process.env.LATH_API_KEY });

      const { result } = await lath.sms.send({
        to: "+14155550100",
        body: "Spring sale starts today.",
        topic: "promotions",
      });
      ```

      ```bash CLI theme={null}
      lath sms send --to +14155550100 --body 'Spring sale starts today.' --topic promotions
      ```
    </CodeGroup>
  </Step>
</Steps>
