Timbrix OAuth API

OAuth2 authentication and authorization

GitHub OpenAPI

Operations 14

POST /oauth/apps Create a new OAuth application #
GET /oauth/apps/{clientId} Get OAuth application by client ID #
PUT /oauth/apps/{clientId} Update OAuth application #
DELETE /oauth/apps/{clientId} Delete OAuth application #
GET /oauth/apps/organization/{organizationId} List OAuth applications for organization #
POST /oauth/token Generate OAuth access token #
GET /oauth/authorize OAuth2 Authorization Endpoint (redirects to consent screen) #
GET /oauth/authorize/details Get authorization details for consent screen #
POST /oauth/authorize/approve Approve authorization and generate code #
POST /oauth/authorize/deny Deny authorization request #
POST /oauth/token/exchange Exchange authorization code for access token #
POST /oauth/token/refresh Refresh OAuth access token #
DELETE /oauth/token/{tokenId} Revoke access token #
GET /oauth/apps/{clientId}/tokens List tokens for OAuth application #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/timbrix-mx:timbrix-mx-oauth-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

timbrix-mx-oauth-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Timbrix OAuth API
  description: 'API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2 para gestionar organizaciones, miembros y webhooks. Compatible con agentes de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and webhooks.'
  version: '1.0'
  contact: {}
servers: []
tags:
- name: OAuth
  description: OAuth2 authentication and authorization
paths:
  /oauth/apps:
    post:
      description: '⚠️ SECURITY: Creates an OAuth2 application. Only OWNERS and ADMINS can create OAuth apps. Returns client secret ONCE - store it securely!'
      operationId: OAuthController_createApp
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOAuthAppDto'
      responses:
        '201':
          description: OAuth application created successfully. Client secret returned only once - save it immediately!
        '400':
          description: Invalid input data. Check validation errors.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can create OAuth applications.
      security:
      - bearer: []
      summary: Create a new OAuth application
      tags:
      - OAuth
  /oauth/apps/{clientId}:
    get:
      description: '⚠️ SECURITY: Only OWNERS and ADMINS can view OAuth application details. Returns application configuration without exposing the client secret.'
      operationId: OAuthController_getApp
      parameters:
      - name: clientId
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: Application retrieved successfully with configuration details (client secret is never returned after creation).
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can view OAuth applications.
        '404':
          description: OAuth application not found with the provided client ID.
      security:
      - bearer: []
      summary: Get OAuth application by client ID
      tags:
      - OAuth
    put:
      description: '⚠️ SECURITY: Only OWNERS and ADMINS can update OAuth applications. Allows updating name, scopes, redirect URIs, and status. Client ID and secret cannot be changed.'
      operationId: OAuthController_updateApp
      parameters:
      - name: clientId
        required: true
        in: path
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOAuthAppDto'
      responses:
        '200':
          description: Application updated successfully with new configuration.
        '400':
          description: Invalid input data. Check validation errors.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can update OAuth applications.
        '404':
          description: OAuth application not found with the provided client ID.
      security:
      - bearer: []
      summary: Update OAuth application
      tags:
      - OAuth
    delete:
      description: '⚠️ SECURITY: Only OWNERS and ADMINS can delete OAuth applications. This action is PERMANENT. All tokens associated with this application will be revoked.'
      operationId: OAuthController_deleteApp
      parameters:
      - name: clientId
        required: true
        in: path
        schema:
          type: string
      responses:
        '204':
          description: Application deleted successfully. All associated tokens have been revoked.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can delete OAuth applications.
        '404':
          description: OAuth application not found with the provided client ID.
      security:
      - bearer: []
      summary: Delete OAuth application
      tags:
      - OAuth
  /oauth/apps/organization/{organizationId}:
    get:
      description: '⚠️ SECURITY: Only OWNERS and ADMINS can list OAuth applications. Returns all OAuth apps created for the organization.'
      operationId: OAuthController_listApps
      parameters:
      - name: organizationId
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: Applications retrieved successfully. Returns array of OAuth applications without client secrets.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can list OAuth applications.
      security:
      - bearer: []
      summary: List OAuth applications for organization
      tags:
      - OAuth
  /oauth/token:
    post:
      description: '🔓 PUBLIC ENDPOINT: Generates an OAuth2 access token using client credentials flow. Requires valid client_id and client_secret. Token scopes are validated against application configuration. Rate limit: 10 requests per minute.'
      operationId: OAuthController_generateToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateTokenDto'
      responses:
        '201':
          description: Access token generated successfully. Returns token, type (Bearer), expiration time, and granted scopes.
        '400':
          description: 'Invalid request. Check required fields: client_id, client_secret, scopes.'
        '401':
          description: Invalid client credentials. Check client_id and client_secret.
        '429':
          description: Rate limit exceeded. Maximum 10 requests per minute for token generation.
      summary: Generate OAuth access token
      tags:
      - OAuth
  /oauth/authorize:
    get:
      description: '🔓 PUBLIC ENDPOINT: Standard OAuth2 authorization endpoint. Validates request parameters and redirects to the consent screen. Supports PKCE for enhanced security. This is the entry point for Authorization Code Flow - compatible with standard OAuth2 clients.'
      operationId: OAuthController_authorize
      parameters:
      - name: client_id
        required: true
        in: query
        description: OAuth application client ID
        schema:
          example: app_abc123...
          type: string
      - name: redirect_uri
        required: true
        in: query
        description: Redirect URI registered with the application
        schema:
          example: https://example.com/oauth/callback
          type: string
      - name: scope
        required: true
        in: query
        description: Comma-separated list of requested scopes
        schema:
          example: read:user,read:organization
          type: string
      - name: state
        required: true
        in: query
        description: CSRF protection state parameter. Client should generate a random value and verify it on callback.
        schema:
          example: random_state_abc123
          type: string
      - name: response_type
        required: true
        in: query
        description: Response type (must be 'code' for Authorization Code Flow)
        schema:
          default: code
          example: code
          type: string
      - name: code_challenge
        required: false
        in: query
        description: PKCE code challenge (optional, for enhanced security). Base64-URL encoded SHA256 hash of code_verifier.
        schema:
          example: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
          type: string
      - name: code_challenge_method
        required: false
        in: query
        description: PKCE code challenge method. Use 'S256' for SHA256 hashing (recommended) or 'plain' for no hashing.
        schema:
          example: S256
          type: string
          enum:
          - S256
          - plain
      responses:
        '302':
          description: Redirects to consent screen with validated parameters. User will be prompted to authorize or deny the application.
        '400':
          description: Invalid request parameters. Check client_id, redirect_uri, scope, state, and response_type.
      summary: OAuth2 Authorization Endpoint (redirects to consent screen)
      tags:
      - OAuth
  /oauth/authorize/details:
    get:
      description: '⚠️ SECURITY: Returns OAuth application details and requested scopes for displaying a consent screen. User must be authenticated. Validates client_id, redirect_uri, and scopes.'
      operationId: OAuthController_getAuthorizationDetails
      parameters:
      - name: client_id
        required: true
        in: query
        description: OAuth application client ID
        schema:
          example: app_abc123...
          type: string
      - name: redirect_uri
        required: true
        in: query
        description: Redirect URI for the authorization flow
        schema:
          example: https://example.com/oauth/callback
          type: string
      - name: scope
        required: true
        in: query
        description: Requested OAuth scopes (comma-separated)
        schema:
          example: read:user,read:organization
          type: string
      - name: state
        required: true
        in: query
        description: State parameter for CSRF protection
        schema:
          example: random_state_abc123
          type: string
      - name: response_type
        required: false
        in: query
        description: Response type (should be 'code')
        schema:
          example: code
          type: string
      responses:
        '200':
          description: Authorization details retrieved successfully. Returns application info and requested scopes with descriptions.
        '401':
          description: Authentication required or invalid client_id/redirect_uri/scopes.
      security:
      - bearer: []
      summary: Get authorization details for consent screen
      tags:
      - OAuth
  /oauth/authorize/approve:
    post:
      description: '⚠️ SECURITY: User approves OAuth authorization request. Generates an authorization code for the client application. Rate limit: 20 requests per minute.'
      operationId: OAuthController_approveAuthorization
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApproveAuthorizationDto'
      responses:
        '201':
          description: Authorization approved. Returns authorization code, state, and redirect_uri for client redirect.
        '400':
          description: Invalid request parameters.
        '401':
          description: Authentication required or invalid authorization request.
      security:
      - bearer: []
      summary: Approve authorization and generate code
      tags:
      - OAuth
  /oauth/authorize/deny:
    post:
      description: '⚠️ SECURITY: User denies OAuth authorization request. Returns error information for client redirect.'
      operationId: OAuthController_denyAuthorization
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DenyAuthorizationDto'
      responses:
        '200':
          description: Authorization denied. Returns error, error_description, state, and redirect_uri.
        '401':
          description: Authentication required.
      security:
      - bearer: []
      summary: Deny authorization request
      tags:
      - OAuth
  /oauth/token/exchange:
    post:
      description: '🔓 PUBLIC ENDPOINT: Exchanges an authorization code for access and refresh tokens (Authorization Code Flow). Requires valid code, client_id, client_secret, and redirect_uri. Rate limit: 15 requests per minute.'
      operationId: OAuthController_exchangeCode
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExchangeCodeDto'
      responses:
        '201':
          description: Code exchanged successfully. Returns access_token, refresh_token, token_type (Bearer), expiration time, and scopes.
        '400':
          description: 'Invalid request. Check required fields: code, client_id, client_secret, redirect_uri, grant_type.'
        '401':
          description: Invalid authorization code, client credentials, or redirect URI mismatch.
        '429':
          description: Rate limit exceeded. Maximum 15 requests per minute for code exchange.
      summary: Exchange authorization code for access token
      tags:
      - OAuth
  /oauth/token/refresh:
    post:
      description: '🔓 PUBLIC ENDPOINT: Exchanges a refresh token for a new access token and refresh token pair. The old refresh token is automatically revoked. Rate limit: 20 requests per minute.'
      operationId: OAuthController_refreshToken
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshTokenDto'
      responses:
        '201':
          description: Token refreshed successfully. Returns new access_token, refresh_token, token_type (Bearer), expiration time, and scopes.
        '400':
          description: Invalid request. Refresh token is required.
        '401':
          description: Invalid or expired refresh token. The refresh token may have been used already or has expired.
        '429':
          description: Rate limit exceeded. Maximum 20 requests per minute for token refresh.
      summary: Refresh OAuth access token
      tags:
      - OAuth
  /oauth/token/{tokenId}:
    delete:
      description: '⚠️ SECURITY: Revokes an OAuth access token. Requires OAuth authentication with scope "write:oauth-apps". Revoked tokens cannot be used for API access.'
      operationId: OAuthController_revokeToken
      parameters:
      - name: tokenId
        required: true
        in: path
        schema:
          type: string
      responses:
        '204':
          description: Token revoked successfully. The token can no longer be used for authentication.
        '401':
          description: Authentication required. Provide a valid OAuth token.
        '403':
          description: 'Insufficient scope. Required scope: write:oauth-apps'
        '404':
          description: Token not found with the provided token ID.
      security:
      - bearer: []
      summary: Revoke access token
      tags:
      - OAuth
  /oauth/apps/{clientId}/tokens:
    get:
      description: '⚠️ SECURITY: Lists all active tokens for an OAuth application. Only OWNERS and ADMINS can view tokens. Useful for auditing and token management.'
      operationId: OAuthController_listTokens
      parameters:
      - name: clientId
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: Tokens retrieved successfully. Returns array of tokens with scopes, expiration, and usage info.
        '401':
          description: Authentication required. Provide a valid bearer token.
        '403':
          description: Access denied. Only owners and admins can view tokens.
        '404':
          description: OAuth application not found with the provided client ID.
      security:
      - bearer: []
      summary: List tokens for OAuth application
      tags:
      - OAuth
components:
  schemas:
    UpdateOAuthAppDto:
      type: object
      properties:
        name:
          type: string
          description: Application name
          example: My Integration
          maxLength: 100
        description:
          type: string
          description: Application description
          example: Integration for managing organization data
          maxLength: 500
        redirectUri:
          type: string
          description: Redirect URI for OAuth flow
          example: https://example.com/callback
        scopes:
          description: OAuth scopes requested
          example:
          - read:organization
          - write:organization
          type: array
          items:
            type: array
        isActive:
          type: boolean
          description: Whether the application is active
          example: true
    RefreshTokenDto:
      type: object
      properties:
        refreshToken:
          type: string
          description: Refresh token obtained from token generation
          example: rt_abc123xyz...
      required:
      - refreshToken
    GenerateTokenDto:
      type: object
      properties:
        clientId:
          type: string
          description: Client ID of the OAuth application
          example: app_1234567890abcdef
        clientSecret:
          type: string
          description: Client secret of the OAuth application
          example: cs_1234567890abcdef
        scopes:
          description: OAuth scopes requested
          example:
          - read:organization
          type: array
          items:
            type: array
        userId:
          type: string
          description: User ID for user-specific tokens
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
      - clientId
      - clientSecret
      - scopes
    ExchangeCodeDto:
      type: object
      properties:
        code:
          type: string
          description: Authorization code received from the authorization endpoint
          example: code_abc123...
        clientId:
          type: string
          description: OAuth application client ID
          example: app_abc123...
        clientSecret:
          type: string
          description: OAuth application client secret
          example: cs_abc123...
        redirectUri:
          type: string
          description: Redirect URI that was used in the authorization request (must match exactly)
          example: https://example.com/oauth/callback
        grantType:
          type: string
          description: Grant type (authorization_code for code exchange)
          example: authorization_code
          default: authorization_code
        codeVerifier:
          type: string
          description: PKCE code verifier (required if code_challenge was provided during authorization). Random string used to generate the code_challenge.
          example: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
      required:
      - code
      - clientId
      - clientSecret
      - redirectUri
      - grantType
    ApproveAuthorizationDto:
      type: object
      properties:
        clientId:
          type: string
          description: OAuth application client ID
          example: app_abc123...
        redirectUri:
          type: string
          description: Redirect URI registered with the application
          example: https://example.com/oauth/callback
        scopes:
          description: Approved OAuth scopes
          example:
          - read:user
          - read:organization
          type: array
          items:
            type: string
        state:
          type: string
          description: CSRF protection state parameter
          example: random_state_abc123
        codeChallenge:
          type: string
          description: PKCE code challenge (optional, from authorization request)
          example: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
        codeChallengeMethod:
          type: string
          description: PKCE code challenge method (optional, from authorization request)
          example: S256
          enum:
          - S256
          - plain
      required:
      - clientId
      - redirectUri
      - scopes
      - state
    CreateOAuthAppDto:
      type: object
      properties:
        organizationId:
          type: string
          description: Organization that owns the application. You must be its owner or admin.
          example: 8f6c2a3e-1b4d-4c5e-9f7a-2d3b4c5e6f70
          format: uuid
        name:
          type: string
          description: Application name
          example: My Integration
          minLength: 1
          maxLength: 100
        description:
          type: string
          description: Application description
          example: Integration for managing organization data
          maxLength: 500
        redirectUri:
          type: string
          description: Redirect URI for OAuth flow
          example: https://example.com/callback
        scopes:
          type: array
          description: OAuth scopes requested
          example:
          - read:organization
          - write:organization
          items:
            type: string
            enum:
            - read:user
            - write:user
            - read:organization
            - write:organization
            - read:members
            - write:members
            - read:webhooks
            - write:webhooks
            - admin:organization
            - admin:all
      required:
      - organizationId
      - name
      - scopes
    DenyAuthorizationDto:
      type: object
      properties:
        clientId:
          type: string
          description: OAuth application client ID
          example: app_abc123...
        redirectUri:
          type: string
          description: Redirect URI to return the error
          example: https://example.com/oauth/callback
        state:
          type: string
          description: State parameter to return with error
          example: random_state_abc123
      required:
      - clientId
      - redirectUri
      - state
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API Key for authentication (sk_test_... for sandbox, sk_live_... for production)
x-ai-agent-friendly: true