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

# Legal

> Verify a persona's people and form a company with the TypeScript SDK.

Every method takes the identity (an `idn_…` id or its name) as its first argument. Money is integer
micro-USD.

```ts theme={"system"}
const legal = client.identities.legal

const verification = await legal.startVerification(identityId, {
  members: [
    { first_name: "Ava", last_name: "Stone", email: "ava@example.com",
      role: "primary", is_responsible_party: true, ownership_percent: 100 },
  ],
})
// verification.members[0].link_url is set on this response only

const current = await legal.verification(identityId, verification.id)
await legal.resendMemberLink(identityId, verification.id, current.members[0].id)
await legal.completeMember(identityId, verification.id, current.members[0].id, { token })
const cases = await legal.verifications(identityId, { limit: 20 })
```

Once `ready_for_formation` is `true`, form and file a company. The fee is debited from the
organization's credits before anything is filed.

```ts theme={"system"}
const states = await legal.states()
const codes = await legal.naicsCodes({ q: "software" })

const company = await legal.createCompany(identityId, {
  verification_id: verification.id,
  state: "WY",
  name_options: ["Acme Labs"],
  naics_code: "541511",
  description: "Software consulting",
  mailing_address: { line1: "1 Main St", line2: null, city: "Cheyenne", state: "WY", postal_code: "82001", country: "US" },
})
await legal.submitCompany(identityId, company.id)

const companies = await legal.companies(identityId)
const detail = await legal.company(identityId, company.id)
const documents = await legal.documents(identityId, company.id)
const link = await legal.documentLink(identityId, company.id, documents.data[0].id) // short-lived url
```

See the [Legal API](/docs/api/legal) for statuses, scopes and errors.
