> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getruba.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Approve authorization

> ### Intent

Reads the approve authorization without changing it.

### When to call it

Call this after your application has received or stored the identifier for the approve authorization.

### Access boundary

Use the credential type and authentication scheme shown for this operation.

### Successful result

A successful request returns `200`. The response schema below defines the body your integration receives.

export const RubaSocials = () => {
  if (typeof document === "undefined") {
    return null;
  }
  const inject = () => {
    const footer = document.getElementById("footer");
    if (!footer || document.getElementById("ruba-socials")) {
      return false;
    }
    const isDark = document.querySelector("html.dark") || document.querySelector('html[class*="dark"]');
    const lineColor = isDark ? "#383838" : "#e8e8ed";
    const iconColor = isDark ? "#8e8e93" : "#86868b";
    const markColor = isDark ? "#ffffff" : "#08080c";
    const hoverColor = "#0071e3";
    const div = document.createElement("div");
    div.id = "ruba-socials";
    div.style.cssText = `display:flex;align-items:center;gap:20px;padding-top:20px;margin-top:20px;border-top:1px solid ${lineColor};width:100%`;
    const logo = `<a href="https://getruba.com" style="display:inline-flex;height:24px;align-items:center;gap:8px;text-decoration:none;color:${markColor};line-height:1;"><svg width="24" height="24" viewBox="0 0 120 120" aria-hidden="true" style="display:block;flex:none;"><g transform="translate(2.5 0)"><path d="M19 25h59L65.43 47H19a4 4 0 0 1-4-4V29a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M19 73h31.57L38 95H19a4 4 0 0 1-4-4V77a4 4 0 0 1 4-4Z" fill="${markColor}"/><path d="M85 25h25L70 95H45Z" fill="#007AFF"/></g></svg><span style="display:inline-flex;height:24px;align-items:center;font-weight:600;font-size:15px;color:${markColor};letter-spacing:-0.01em;line-height:1;">Ruba</span></a>`;
    const spacer = `<div style="flex:1"></div>`;
    const ig = `<a href="https://instagram.com/getruba" target="_blank" rel="noopener" aria-label="Instagram" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"/><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/></svg></a>`;
    const li = `<a href="https://linkedin.com/company/getruba" target="_blank" rel="noopener" aria-label="LinkedIn" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"/><rect x="2" y="9" width="4" height="12"/><circle cx="4" cy="4" r="2"/></svg></a>`;
    const x = `<a href="https://x.com/getruba" target="_blank" rel="noopener" aria-label="X" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>`;
    const github = `<a href="https://github.com/rubadot" target="_blank" rel="noopener" aria-label="GitHub" style="display:flex;align-items:center;color:${iconColor};transition:color 0.15s ease;" onmouseover="this.style.color='${hoverColor}'" onmouseout="this.style.color='${iconColor}'"><svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 .7a11.5 11.5 0 0 0-3.64 22.4c.58.1.79-.25.79-.56v-2.24c-3.22.7-3.9-1.37-3.9-1.37-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.16.08 1.78 1.2 1.78 1.2 1.04 1.77 2.72 1.26 3.38.96.1-.75.4-1.26.74-1.55-2.57-.3-5.27-1.29-5.27-5.69 0-1.26.45-2.29 1.19-3.09-.12-.29-.52-1.47.11-3.05 0 0 .97-.31 3.16 1.18A10.96 10.96 0 0 1 12 6.09c.98 0 1.94.13 2.86.39 2.2-1.49 3.16-1.18 3.16-1.18.63 1.58.23 2.76.11 3.05.74.8 1.19 1.83 1.19 3.09 0 4.42-2.7 5.39-5.28 5.68.42.36.79 1.06.79 2.14v3.28c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .7Z"/></svg></a>`;
    div.innerHTML = logo + spacer + ig + li + x + github;
    footer.appendChild(div);
    return true;
  };
  if (!document.documentElement.dataset.rubaSocialsObserver) {
    document.documentElement.dataset.rubaSocialsObserver = "true";
    const observer = new MutationObserver(() => {
      if (!document.getElementById("ruba-socials")) {
        inject();
      }
    });
    observer.observe(document.body, {
      childList: true,
      subtree: true
    });
  }
  setTimeout(() => {
    if (!inject()) {
      const interval = setInterval(() => {
        if (inject()) {
          clearInterval(interval);
        }
      }, 500);
      setTimeout(() => clearInterval(interval), 10000);
    }
  }, 300);
  return null;
};

<link rel="stylesheet" href="/style.css" />

<RubaSocials />


## OpenAPI

````yaml get /v1/oauth2/authorize
openapi: 3.1.0
info:
  title: Ruba API
  summary: Ruba HTTP and Webhooks API
  description: '**Details:** Read the docs at https://docs.getruba.com/api-reference.'
  version: 2026-04
servers:
  - url: https://api.getruba.com
    description: '**Details:** Production environment.'
    x-speakeasy-server-id: production
  - url: https://sandbox-api.getruba.com
    description: '**Details:** Sandbox environment.'
    x-speakeasy-server-id: sandbox
security: []
tags:
  - name: public
    description: >-
      **Details:** Endpoints shown and documented in the Ruba API documentation
      and available in our SDKs.
  - name: private
    description: >-
      **Details:** Endpoints that should appear in the schema only in
      development to generate our internal JS SDK.
paths:
  /v1/oauth2/authorize:
    get:
      tags:
        - oauth2
        - public
      summary: Approve authorization
      description: >-
        ### Intent


        Reads the approve authorization without changing it.


        ### When to call it


        Call this after your application has received or stored the identifier
        for the approve authorization.


        ### Access boundary


        Use the credential type and authentication scheme shown for this
        operation.


        ### Successful result


        A successful request returns `200`. The response schema below defines
        the body your integration receives.
      operationId: oauth2:authorize
      responses:
        '200':
          description: Request completed successfully
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AuthorizeResponseUser'
                  - $ref: '#/components/schemas/AuthorizeResponseOrganization'
                title: Response Oauth2:Authorize
                discriminator:
                  propertyName: sub_type
                  mapping:
                    user:
                      $ref: '#/components/schemas/AuthorizeResponseUser'
                    organization:
                      $ref: '#/components/schemas/AuthorizeResponseOrganization'
      security:
        - oidc: []
        - pat: []
components:
  schemas:
    AuthorizeResponseUser:
      properties:
        client:
          $ref: '#/components/schemas/OAuth2ClientPublic'
        sub_type:
          type: string
          const: user
          title: Sub Type
        sub:
          anyOf:
            - $ref: '#/components/schemas/AuthorizeUser'
            - type: 'null'
        scopes:
          items:
            $ref: '#/components/schemas/Scope'
          type: array
          title: Scopes
        organizations:
          items:
            $ref: '#/components/schemas/AuthorizeOrganization'
          type: array
          title: Organizations
        requires_single_organization:
          type: boolean
          title: Requires Single Organization
          default: false
        scope_display_names:
          additionalProperties:
            type: string
          type: object
          title: Scope Display Names
          default:
            openid: OpenID
            profile: Read your profile
            email: Read your email address
            user:read: Read your user account
            user:write: Manage your user account
            organizations:read: Read your organizations
            organizations:write: Create or modify organizations
            custom_fields:read: Read custom fields
            custom_fields:write: Create or modify custom fields
            discounts:read: Read discounts
            discounts:write: Create or modify discounts
            checkout_links:read: Read checkout links
            checkout_links:write: Create or modify checkout links
            checkouts:read: Read checkout sessions
            checkouts:write: Create or modify checkout sessions
            transactions:read: Read transactions
            transactions:write: Create or modify transactions
            payouts:read: Read payouts
            payouts:write: Create or modify payouts
            products:read: Read products
            products:write: Create or modify products
            benefits:read: Read benefits
            benefits:write: Create or modify benefits
            events:read: Read events
            events:write: Create events
            meters:read: Read meters
            meters:write: Create or modify meters
            files:read: Read file uploads
            files:write: Create or modify file uploads
            subscriptions:read: Read subscriptions made on your organizations
            subscriptions:write: Create or modify subscriptions made on your organizations
            customers:read: Read customers
            customers:write: Create or modify customers
            members:read: Read members
            members:write: Create or modify members
            wallets:read: Read wallets
            wallets:write: Create or modify wallets
            disputes:read: Read disputes
            customer_meters:read: Read customer meters
            customer_sessions:write: Create or modify customer sessions
            member_sessions:write: Create or modify member sessions
            customer_seats:read: Read customer seats
            customer_seats:write: Create or modify customer seats
            orders:read: Read orders made on your organizations
            orders:write: Modify orders made on your organizations
            refunds:read: Read refunds made on your organizations
            refunds:write: Create or modify refunds
            payments:read: Read payments made on your organizations
            metrics:read: Read metrics
            metrics:write: Create or modify metric definitions
            webhooks:read: Read webhooks
            webhooks:write: Create or modify webhooks
            license_keys:read: Read license keys
            license_keys:write: Modify license keys
            customer_portal:read: Read your orders, subscriptions and benefits
            customer_portal:write: Create or modify your orders, subscriptions and benefits
            notifications:read: Read notifications
            notifications:write: Mark notifications as read
            notification_recipients:read: Read notification recipients
            notification_recipients:write: Create or modify notification recipients
            organization_access_tokens:read: Read organization access tokens
            organization_access_tokens:write: Create or modify organization access tokens
      type: object
      required:
        - client
        - sub_type
        - sub
        - scopes
        - organizations
      title: AuthorizeResponseUser
    AuthorizeResponseOrganization:
      properties:
        client:
          $ref: '#/components/schemas/OAuth2ClientPublic'
        sub_type:
          type: string
          const: organization
          title: Sub Type
        sub:
          anyOf:
            - $ref: '#/components/schemas/AuthorizeOrganization'
            - type: 'null'
        scopes:
          items:
            $ref: '#/components/schemas/Scope'
          type: array
          title: Scopes
        organizations:
          items:
            $ref: '#/components/schemas/AuthorizeOrganization'
          type: array
          title: Organizations
        requires_single_organization:
          type: boolean
          title: Requires Single Organization
          default: false
        scope_display_names:
          additionalProperties:
            type: string
          type: object
          title: Scope Display Names
          default:
            openid: OpenID
            profile: Read your profile
            email: Read your email address
            user:read: Read your user account
            user:write: Manage your user account
            organizations:read: Read your organizations
            organizations:write: Create or modify organizations
            custom_fields:read: Read custom fields
            custom_fields:write: Create or modify custom fields
            discounts:read: Read discounts
            discounts:write: Create or modify discounts
            checkout_links:read: Read checkout links
            checkout_links:write: Create or modify checkout links
            checkouts:read: Read checkout sessions
            checkouts:write: Create or modify checkout sessions
            transactions:read: Read transactions
            transactions:write: Create or modify transactions
            payouts:read: Read payouts
            payouts:write: Create or modify payouts
            products:read: Read products
            products:write: Create or modify products
            benefits:read: Read benefits
            benefits:write: Create or modify benefits
            events:read: Read events
            events:write: Create events
            meters:read: Read meters
            meters:write: Create or modify meters
            files:read: Read file uploads
            files:write: Create or modify file uploads
            subscriptions:read: Read subscriptions made on your organizations
            subscriptions:write: Create or modify subscriptions made on your organizations
            customers:read: Read customers
            customers:write: Create or modify customers
            members:read: Read members
            members:write: Create or modify members
            wallets:read: Read wallets
            wallets:write: Create or modify wallets
            disputes:read: Read disputes
            customer_meters:read: Read customer meters
            customer_sessions:write: Create or modify customer sessions
            member_sessions:write: Create or modify member sessions
            customer_seats:read: Read customer seats
            customer_seats:write: Create or modify customer seats
            orders:read: Read orders made on your organizations
            orders:write: Modify orders made on your organizations
            refunds:read: Read refunds made on your organizations
            refunds:write: Create or modify refunds
            payments:read: Read payments made on your organizations
            metrics:read: Read metrics
            metrics:write: Create or modify metric definitions
            webhooks:read: Read webhooks
            webhooks:write: Create or modify webhooks
            license_keys:read: Read license keys
            license_keys:write: Modify license keys
            customer_portal:read: Read your orders, subscriptions and benefits
            customer_portal:write: Create or modify your orders, subscriptions and benefits
            notifications:read: Read notifications
            notifications:write: Mark notifications as read
            notification_recipients:read: Read notification recipients
            notification_recipients:write: Create or modify notification recipients
            organization_access_tokens:read: Read organization access tokens
            organization_access_tokens:write: Create or modify organization access tokens
      type: object
      required:
        - client
        - sub_type
        - sub
        - scopes
        - organizations
      title: AuthorizeResponseOrganization
    OAuth2ClientPublic:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The time Ruba created this record.
        modified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Modified At
          description: The time this record last changed.
        client_id:
          type: string
          title: Client Id
        client_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Name
        client_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Client Uri
        logo_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Logo Uri
        tos_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Tos Uri
        policy_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Policy Uri
      type: object
      required:
        - created_at
        - modified_at
        - client_id
        - client_name
        - client_uri
        - logo_uri
        - tos_uri
        - policy_uri
      title: OAuth2ClientPublic
    AuthorizeUser:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        email:
          type: string
          format: email
          title: Email
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
      type: object
      required:
        - id
        - email
        - avatar_url
      title: AuthorizeUser
    Scope:
      type: string
      enum:
        - openid
        - profile
        - email
        - user:read
        - user:write
        - organizations:read
        - organizations:write
        - custom_fields:read
        - custom_fields:write
        - discounts:read
        - discounts:write
        - checkout_links:read
        - checkout_links:write
        - checkouts:read
        - checkouts:write
        - transactions:read
        - transactions:write
        - payouts:read
        - payouts:write
        - products:read
        - products:write
        - benefits:read
        - benefits:write
        - events:read
        - events:write
        - meters:read
        - meters:write
        - files:read
        - files:write
        - subscriptions:read
        - subscriptions:write
        - customers:read
        - customers:write
        - members:read
        - members:write
        - wallets:read
        - wallets:write
        - disputes:read
        - customer_meters:read
        - customer_sessions:write
        - member_sessions:write
        - customer_seats:read
        - customer_seats:write
        - orders:read
        - orders:write
        - refunds:read
        - refunds:write
        - payments:read
        - metrics:read
        - metrics:write
        - webhooks:read
        - webhooks:write
        - license_keys:read
        - license_keys:write
        - customer_portal:read
        - customer_portal:write
        - notifications:read
        - notifications:write
        - notification_recipients:read
        - notification_recipients:write
        - organization_access_tokens:read
        - organization_access_tokens:write
      title: Scope
      enumNames:
        benefits:read: Read benefits
        benefits:write: Create or modify benefits
        checkout_links:read: Read checkout links
        checkout_links:write: Create or modify checkout links
        checkouts:read: Read checkout sessions
        checkouts:write: Create or modify checkout sessions
        custom_fields:read: Read custom fields
        custom_fields:write: Create or modify custom fields
        customer_meters:read: Read customer meters
        customer_portal:read: Read your orders, subscriptions and benefits
        customer_portal:write: Create or modify your orders, subscriptions and benefits
        customer_seats:read: Read customer seats
        customer_seats:write: Create or modify customer seats
        customer_sessions:write: Create or modify customer sessions
        customers:read: Read customers
        customers:write: Create or modify customers
        discounts:read: Read discounts
        discounts:write: Create or modify discounts
        disputes:read: Read disputes
        email: Read your email address
        events:read: Read events
        events:write: Create events
        files:read: Read file uploads
        files:write: Create or modify file uploads
        license_keys:read: Read license keys
        license_keys:write: Modify license keys
        member_sessions:write: Create or modify member sessions
        members:read: Read members
        members:write: Create or modify members
        meters:read: Read meters
        meters:write: Create or modify meters
        metrics:read: Read metrics
        metrics:write: Create or modify metric definitions
        notification_recipients:read: Read notification recipients
        notification_recipients:write: Create or modify notification recipients
        notifications:read: Read notifications
        notifications:write: Mark notifications as read
        openid: OpenID
        orders:read: Read orders made on your organizations
        orders:write: Modify orders made on your organizations
        organization_access_tokens:read: Read organization access tokens
        organization_access_tokens:write: Create or modify organization access tokens
        organizations:read: Read your organizations
        organizations:write: Create or modify organizations
        payments:read: Read payments made on your organizations
        payouts:read: Read payouts
        payouts:write: Create or modify payouts
        products:read: Read products
        products:write: Create or modify products
        profile: Read your profile
        refunds:read: Read refunds made on your organizations
        refunds:write: Create or modify refunds
        subscriptions:read: Read subscriptions made on your organizations
        subscriptions:write: Create or modify subscriptions made on your organizations
        transactions:read: Read transactions
        transactions:write: Create or modify transactions
        user:read: Read your user account
        user:write: Manage your user account
        wallets:read: Read wallets
        wallets:write: Create or modify wallets
        webhooks:read: Read webhooks
        webhooks:write: Create or modify webhooks
    AuthorizeOrganization:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        slug:
          type: string
          title: Slug
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
      type: object
      required:
        - id
        - slug
        - avatar_url
      title: AuthorizeOrganization
  securitySchemes:
    oidc:
      type: openIdConnect
      openIdConnectUrl: /.well-known/openid-configuration
    pat:
      type: http
      description: >-
        **Authentication:** You can generate a **Personal Access Token** from
        your [settings](https://getruba.com/settings).
      scheme: bearer

````