Skip to content

OAuth endpoints

7 endpoints at https://api.vaif.studio, generated from the API's OpenAPI document. The REST API page covers authentication, and All endpoints lists every group.

POST /oauth/org/{orgId}/configure

Configure OAuth for an organization

ParameterInTypeRequired
orgIdpathstring (uuid)Yes
Request body (application/json, required)
{
  provider: "google" | "apple" | "github";
  clientId: string;
  clientSecret: string;
  redirectUri: string (uri);
}
Response 200 (application/json)
{
  ok: true;
  message: string;
}

Errors: 400, 401, 403, with the error body.

PATCH /oauth/org/{orgId}/provider/{provider}

Update OAuth provider configuration

ParameterInTypeRequired
orgIdpathstring (uuid)Yes
providerpathstringYes
Request body (application/json, required)
{
  clientId?: string;
  clientSecret?: string;
  redirectUri?: string (uri);
  enabled?: boolean;
}
Response 200 (application/json)
{
  ok: true;
  connection: {
    id: string;
    provider: string;
    clientId: string;
    redirectUri: string;
    enabled: boolean;
  };
}

Errors: 400, 401, 403, 404, with the error body.

DELETE /oauth/org/{orgId}/provider/{provider}

Delete OAuth provider configuration

ParameterInTypeRequired
orgIdpathstring (uuid)Yes
providerpathstringYes
Response 200 (application/json)
{
  ok: true;
}

Errors: 401, 403, with the error body.

GET /oauth/org/{orgId}

List OAuth configurations for an organization

ParameterInTypeRequired
orgIdpathstring (uuid)Yes
Response 200 (application/json)
{
  connections: {
    id: string;
    provider: string;
    clientId: string;
    redirectUri: string;
    enabled: boolean;
    createdAt: string | string (date-time);
  }[];
}

Errors: 401, 403, with the error body.

GET /oauth/org/{orgId}/provider/{provider}/authorize

Generate OAuth authorization URL

ParameterInTypeRequired
orgIdpathstring (uuid)Yes
providerpathstringYes
scopesquerystringNo
Response 200 (application/json)
{
  authorizationUrl: string;
  state: string;
  expiresIn: number;
}

Errors: 400, 401, 403, 404, with the error body.

POST /oauth/callback

Handle OAuth callback and exchange code for tokens

Request body (application/json, required)
{
  code?: string;
  state?: string;
  error?: string;
  error_description?: string;
}
Response 200 (application/json)
{
  ok: boolean;
  provider: string;
  tokens: {
    accessToken: any;
    refreshToken: any;
    expiresIn: any;
    tokenType: any;
    scope: any;
  };
  user: null;
}

POST /oauth/org/{orgId}/provider/{provider}/refresh

Refresh an OAuth token

ParameterInTypeRequired
orgIdpathstring (uuid)Yes
providerpathstringYes
Request body (application/json)
{
  refreshToken: string;
}
Response 200 (application/json)
{
  ok: true;
  tokens: {
    accessToken?: string | null;
    refreshToken?: string | null;
    expiresIn?: number | null;
    tokenType?: string | null;
    scope?: string | null;
  };
}

Errors: 400, 401, 403, 404, 500, with the error body.