# Auth

Source: https://opvs.ai/docs/api/auth

## `POST` /api/v1/auth/signup/complete

**Complete Signup**

Complete signup by creating a user profile, brand, and membership.

**Request body**

```bash
curl -X POST 'https://app.opvs.ai/api/v1/auth/signup/complete' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "brand_name": "string",
  "firstname": "string",
  "lastname": "string",
  "fingerprint": {}
}'
```

```python
import httpx

resp = httpx.post(
    "https://app.opvs.ai/api/v1/auth/signup/complete",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"brand_name": "string", "firstname": "string", "lastname": "string", "fingerprint": {}},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/signup/complete", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"brand_name": "string", "firstname": "string", "lastname": "string", "fingerprint": {}})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"brand_name": "string", "firstname": "string", "lastname": "string", "fingerprint": {}}`)
	req, _ := http.NewRequest("POST", "https://app.opvs.ai/api/v1/auth/signup/complete", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `POST` /api/v1/auth/signup/with-invite

**Signup With Invite**

Complete signup using an invitation token.

**Request body**

```bash
curl -X POST 'https://app.opvs.ai/api/v1/auth/signup/with-invite' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "invite_token": "string"
}'
```

```python
import httpx

resp = httpx.post(
    "https://app.opvs.ai/api/v1/auth/signup/with-invite",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"invite_token": "string"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/signup/with-invite", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"invite_token": "string"})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"invite_token": "string"}`)
	req, _ := http.NewRequest("POST", "https://app.opvs.ai/api/v1/auth/signup/with-invite", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `POST` /api/v1/auth/accept-invite

**Accept Invite**

Accept an invitation as an existing user (already logged in).

**Request body**

```bash
curl -X POST 'https://app.opvs.ai/api/v1/auth/accept-invite' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "invite_token": "string"
}'
```

```python
import httpx

resp = httpx.post(
    "https://app.opvs.ai/api/v1/auth/accept-invite",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"invite_token": "string"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/accept-invite", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"invite_token": "string"})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"invite_token": "string"}`)
	req, _ := http.NewRequest("POST", "https://app.opvs.ai/api/v1/auth/accept-invite", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `GET` /api/v1/auth/me/summary

**Get Me Summary**

Return only account-menu identity for an existing session user.

```bash
curl -X GET 'https://app.opvs.ai/api/v1/auth/me/summary' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/auth/me/summary",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/me/summary", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/auth/me/summary", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response

## `GET` /api/v1/auth/me

**Get Me**

Get current user profile with all brand memberships.

```bash
curl -X GET 'https://app.opvs.ai/api/v1/auth/me' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/auth/me",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/me", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/auth/me", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response

## `PATCH` /api/v1/auth/profile

**Update Profile**

Update current user's profile (name, phone).

**Request body**

```bash
curl -X PATCH 'https://app.opvs.ai/api/v1/auth/profile' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "firstname": "string",
  "lastname": "string",
  "mobile": "string"
}'
```

```python
import httpx

resp = httpx.patch(
    "https://app.opvs.ai/api/v1/auth/profile",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"firstname": "string", "lastname": "string", "mobile": "string"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/profile", {
  method: "PATCH",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"firstname": "string", "lastname": "string", "mobile": "string"})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"firstname": "string", "lastname": "string", "mobile": "string"}`)
	req, _ := http.NewRequest("PATCH", "https://app.opvs.ai/api/v1/auth/profile", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `POST` /api/v1/auth/profile/photo

**Upload Profile Photo**

Upload profile picture. Resizes to 256×256 JPEG and stores in Cloudflare R2.

**Request body**

```bash
curl -X POST 'https://app.opvs.ai/api/v1/auth/profile/photo' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "file": "string"
}'
```

```python
import httpx

resp = httpx.post(
    "https://app.opvs.ai/api/v1/auth/profile/photo",
    headers={"Authorization": "Bearer <token>", "Content-Type": "application/json"},
    json={"file": "string"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/profile/photo", {
  method: "POST",
  headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" },
  body: JSON.stringify({"file": "string"})
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{"file": "string"}`)
	req, _ := http.NewRequest("POST", "https://app.opvs.ai/api/v1/auth/profile/photo", body)
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response
- `422` — Validation Error

## `DELETE` /api/v1/auth/profile/photo

**Remove Profile Photo**

Remove profile picture. Cleans up R2 file if stored there.

```bash
curl -X DELETE 'https://app.opvs.ai/api/v1/auth/profile/photo' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.delete(
    "https://app.opvs.ai/api/v1/auth/profile/photo",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/profile/photo", {
  method: "DELETE",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("DELETE", "https://app.opvs.ai/api/v1/auth/profile/photo", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response

## `GET` /api/v1/auth/connectors

**Get Connectors**

List connected OAuth providers for the current user.

```bash
curl -X GET 'https://app.opvs.ai/api/v1/auth/connectors' \
  -H 'Authorization: Bearer <token>'
```

```python
import httpx

resp = httpx.get(
    "https://app.opvs.ai/api/v1/auth/connectors",
    headers={"Authorization": "Bearer <token>"},
)
resp.raise_for_status()
print(resp.json())
```

```javascript
const resp = await fetch("https://app.opvs.ai/api/v1/auth/connectors", {
  method: "GET",
  headers: { "Authorization": "Bearer <token>" }
});
const data = await resp.json();
console.log(data);
```

```go
package main

import (
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://app.opvs.ai/api/v1/auth/connectors", nil)
	req.Header.Set("Authorization", "Bearer <token>")
	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
}
```

**Responses**

- `200` — Successful Response

## Complete Signup

`POST https://app.opvs.ai/api/v1/auth/signup/complete`

Complete signup by creating a user profile, brand, and membership.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Signup With Invite

`POST https://app.opvs.ai/api/v1/auth/signup/with-invite`

Complete signup using an invitation token.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Accept Invite

`POST https://app.opvs.ai/api/v1/auth/accept-invite`

Accept an invitation as an existing user (already logged in).

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Get Me Summary

`GET https://app.opvs.ai/api/v1/auth/me/summary`

Return only account-menu identity for an existing session user.

## Get Me

`GET https://app.opvs.ai/api/v1/auth/me`

Get current user profile with all brand memberships.

## Update Profile

`PATCH https://app.opvs.ai/api/v1/auth/profile`

Update current user's profile (name, phone).

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Upload Profile Photo

`POST https://app.opvs.ai/api/v1/auth/profile/photo`

Upload profile picture. Resizes to 256×256 JPEG and stores in Cloudflare R2.

| Code | When | What to do |
| --- | --- | --- |
| 422 | Validation Error |  |

## Remove Profile Photo

`DELETE https://app.opvs.ai/api/v1/auth/profile/photo`

Remove profile picture. Cleans up R2 file if stored there.

## Get Connectors

`GET https://app.opvs.ai/api/v1/auth/connectors`

List connected OAuth providers for the current user.
