---
title: "OAuth login"
method: POST
path: "/auth/oauth"
tags: ["Auth"]
---

# OAuth login

`POST /auth/oauth`

Login via OAuth provider and return access/refresh tokens.

## Request body

- CreateUserOrganizationOAuthDto
  - `name` string, required
  - `email` string, email, required
  - `refreshToken` string, required
  - `authProvider` 'credentials' | 'google' | 'github' | 'gitlab' | 'sso', required

## Response `201`

- AuthTokensResponseDto
  - `statusCode` number, required
  - `type` string, required
  - `data` AuthTokensDto, required
    - `accessToken` string, required
    - `refreshToken` string, required

## Other responses

- `400` — Validation error
- `401` — Not authenticated
- `403` — Insufficient permissions
- `500` — Unexpected error

---

[API](https://skmtc.net/kodustech/apis/kodus-api.md) · [All operations](https://skmtc.net/kodustech/apis/kodus-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kodustech/kodus-api/revisions/e2282ac5fb3a/schema)
