# auth.md

You are an agent. Let's Work supports **agentic registration** for its public marketing APIs.

Base URL: https://www.letswork.com.br

## Step 1 — Discover

### 1a. Protected Resource Metadata

```http
GET /.well-known/oauth-protected-resource
```

### 1b. Authorization Server Metadata

```http
GET /.well-known/oauth-authorization-server
```

Also available: `/.well-known/openid-configuration` (same issuer metadata).

## Step 2 — Choose an identity type

Supported:

- `anonymous` — register without a user identity (recommended for public lead capture agents)
- `identity_assertion` with `verified_email` — register with a contact email claim

## Step 3 — Register

```http
POST /wp-json/lw/v1/agent/identity
Content-Type: application/json

{"type":"anonymous","client_name":"my-agent","contacts":["agent@example.com"]}
```

Response includes a service-signed `identity_assertion` and optional `claim_token`.

## Step 4 — Exchange for an access token

```http
POST /oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion={identity_assertion}
```

## Step 5 — Call the API

```http
POST /wp-json/lw/v1/lead
Authorization: Bearer {access_token}
Content-Type: application/json
```

Public lead submissions also work without a bearer token (form UX). Registered agents should send the bearer token.

## Human contact

- Sales: https://www.letswork.com.br/contato/
- Email: atendimento@letswork.com.br
- App (customer accounts): https://app.letswork.com.br/