---
title: "Storage Oauth Authorize"
method: POST
path: "/storage-connections/oauth/{provider}/authorize"
tags: ["storage-connections"]
---

# Storage Oauth Authorize

`POST /storage-connections/oauth/{provider}/authorize`

## Request

- Base URL: `https://app.zeno-works.ch` (the document declares no server; this is the origin it was published from)
- URL: `https://app.zeno-works.ch/storage-connections/oauth/{provider}/authorize`
- Auth: none declared

Start an interactive OAuth flow (accountant/owner of ``company_id``, scoped): persist
the flow-state row and return the provider authorize URL for the SPA to open. 400 for a
non-OAuth provider.

ZET-434: a company user connects the provider's browser sign-in only (the config is the
provider default); a reconnect (``connection_id``) must name a connection of this company
and provider and re-uses its stored config (422 otherwise). The flow can be completed only
in a browser signed in as the user who started it.

## Path parameters

- `provider` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- StorageOauthAuthorizeRequest: ``POST /storage-connections/oauth/<provider>/authorize`` body (admin, scoped). ``config`` is the provider's non-secret config chosen at authorize time (validated against the provider's ``config_model`` in the service — a raw dict here so a provider's config member need not be a static schema-union member). ``connection_id`` targets a reconnect; omit it to create a new connection on callback.
  - `company_id` string, required
  - `connection_id` string, nullable
  - `config` object

## Response `200`

Successful Response

- StorageOauthAuthorizeResponse: ``POST /storage-connections/oauth/<provider>/authorize`` → the browser authorize URL.
  - `authorize_url` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/zeno-works/apis/zeno-api.md) · [All operations](https://skmtc.dev/zeno-works/apis/zeno-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zeno-works/apis/zeno-api/revisions/1eb93dde146c?raw)
