> For the complete documentation index, see [llms.txt](https://docs.tnid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tnid.com/getting-started-guide.md).

# Getting Started Guide

The five steps from nothing to a working TNID integration: user login, company creation, company credentials, first calls, and where to point requests.

## What you will use

* **Auth endpoints:** `/auth/create-user-otp`, `/auth/token`, `/auth/refresh-token`
* **GraphQL servers:** `/user` (for people) and `/company` (for businesses)
* **Hosts:** `https://api.staging.v2.tnid.com` for staging, `https://api.zero.v2.tnid.com` for the zero (pre-production) environment. See [API Quick Reference](/api-quick-reference.md) for the full picture.

You can try everything with Postman first: see [Accessing via Postman](/authentication/accessing-via-postman-graphql-schema-examples.md).

***

## 1) Create (or claim) your individual profile

Think of this as getting your user login.

**Step A: request a one-time code (OTP).** Send your phone number or email (and, if you are creating a new user, first name, last name and email) to `/auth/create-user-otp`. You receive an OTP.

**Step B: exchange the OTP for a Bearer token.** Send your `telephone_number` (or `email`) and `otp_code` to `/auth/token`. You get an `access_token` that lets you call the `/user` GraphQL API, plus a `refresh_token`. Save both securely.

Details and code: [User Authentication](/authentication/user-authentication.md).

**Optional: update your user profile.** With your user token, call the `updateUser` mutation on `/user` to set `firstName`, `lastName`, `username` or `aboutMe`. See [Update User profile](/user/update-user-profile.md).

***

## 2) Create your company (as that user)

Once you have a user token, you can create a company and mint credentials for it.

**Step A: create the company profile.** Call the `createCompany` mutation on `/user` with the basics (`legalName`, `profileName`, optional `brandName`, `taxId`, and so on). If you include `provisionCompanyClientSecret: true`, TNID also returns a `clientId` and `clientSecret` for company-level API calls. See [Create company profile](/user/company-features/create-company-profile.md).

**Step B (alternative): generate company credentials later.** Call [Create Company Client Secret](/user/company-features/create-company-client-secret.md) or use Client Secrets in the TNID app, then exchange `client_id` and `client_secret` at `/auth/token` for a company Bearer token. Use that token with `/company`. See [Company Authentication](/authentication/company-authentication.md).

**Optional: update your company profile.** Use the `updateCompany` mutation with your company token. See [Update Company Profile](/company/update-company-profile.md).

***

## 3) Common first calls after setup

**Find companies** (to connect with, or to avoid duplicates): query `companies` by name, tax ID, email, telephone number or webpage on `/company`. See [Search Companies](/company/search-companies.md).

**Invite another company or request a B2B connection:**

* Invite by details (legal name plus a representative's email) with `createB2bInvite`. See [Invite Company](/company/invite-company.md).
* Or send a connection request by `invitedCompanyId` with `createB2bConnectionRequest`. See [Send B2B Connection Request](/company/b2b-features/send-b2b-connection-request.md).

**Search for people and see your consumer connections:** use `users` and `b2cConnections` on `/company`. See [Search People](/company/b2c-features/search-people.md) and [B2C Features](/company/b2c-features.md).

**User-side spam reporting:** as a user, call `createSpamReport` and `spamReports` on `/user` so your customers can report unwanted communications. See [Spam Reporting Features](/user/spam-reporting-features.md).

**Get notified instead of polling:** register a company webhook so TNID calls you when connection requests, subscriptions and opt-outs change. See Webhooks.

**Register for 10DLC:** brands and campaigns are submitted through TNID. See [10DLC Brands](/10dlc/brands.md).

***

## 4) Where to point your requests

| Purpose                                       | Path                         |
| --------------------------------------------- | ---------------------------- |
| People GraphQL                                | `POST /user`                 |
| Companies GraphQL                             | `POST /company`              |
| Request an OTP                                | `POST /auth/create-user-otp` |
| Exchange OTP or client credentials for tokens | `POST /auth/token`           |
| Refresh tokens                                | `POST /auth/refresh-token`   |

Prefix each path with the environment host, for example `https://api.staging.v2.tnid.com/company`.

***

## 5) Quick mental model

1. **Become a user** (OTP, token, `/user`).
2. **Create your company** as that user and **mint company credentials**.
3. **Act as the company** (company token, `/company`) for B2B and B2C connections, subscriptions, profile updates, invites, webhooks and 10DLC.

Every query and mutation, including the ones this guide does not cover, is documented in the [API Reference](https://docs.tnid.com/api-reference/).
