# Start signing in through an organisation's identity provider

> Page: https://docs.plotwork.dev/api/post-auth-sso-start. Index of every page: https://docs.plotwork.dev/llms.txt

Answers the provider's address and sets the flow cookie that binds the sign-in to this browser for ten minutes.

`POST /auth/sso/start`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Start signing in through an organisation's identity provider. |
| What does it take? | A JSON body of type [`SsoStartBody`](https://docs.plotwork.dev/api/schemas.md#ssostartbody). |
| What does it return? | Status 200 with a body of type [`SsoStart`](https://docs.plotwork.dev/api/schemas.md#ssostart). |
| What can go wrong? | `400` the address is not valid; `403` the request came from an origin that may not sign in, or sent none; `404` the address does not sign in with single sign-on (sso.not_configured); `429` too many requests; `503` the portal's address is not set on this server. Every failure uses the one error envelope. |

## What it does

Answers the provider's address and sets the flow cookie that binds the sign-in to this browser for ten minutes. OpenID Connect: authorization code with PKCE (S256), state and nonce. SAML: an AuthnRequest on the redirect binding with a RelayState. `returnTo` is kept only when its origin is Plotwork's. 404 sso.not_configured otherwise.

## Request body

The body has the type [`SsoStartBody`](https://docs.plotwork.dev/api/schemas.md#ssostartbody).

| Field | Type | Required | Description |
|---|---|---|---|
| `email` | `string` | yes | at least 3 characters; at most 254 characters. |
| `returnTo` | `string` | no | Where to send the browser after signing in. Kept only when its origin is one of Plotwork's; otherwise the portal. at most 2000 characters. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The provider's address. | [`SsoStart`](https://docs.plotwork.dev/api/schemas.md#ssostart) |
| 400 | The address is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | The request came from an origin that may not sign in, or sent none. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | The address does not sign in with single sign-on (sso.not_configured). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | The portal's address is not set on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`SsoStart`](https://docs.plotwork.dev/api/schemas.md#ssostart).

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | `string` | yes | The identity provider's authorization address to send the browser to. |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
