BlocktionBlocktion Docs

Documentation

Providers

Integrate with external services using OAuth, API keys, or manual authentication

What is a Provider?

A provider manages authentication and credentials for external services.

Providers are the bridge between your workflows and external services. They handle authentication, store credentials securely, and provide a standardized way for blocks and handlers to access third-party APIs without exposing sensitive information.

Key Features

  • Secure credential storage
  • Multiple auth methods (OAuth, API keys, manual)
  • Reusable across blocks
  • Centralized management

Use Cases

  • API integrations (Google, Slack, etc.)
  • Payment processing (Stripe, PayPal)
  • Communication services (Email, SMS)
  • Cloud storage (AWS, Dropbox)

Provider Types

OAuth Providers

OAuth-based service integrations

Examples:

GoogleGitHubSlackMicrosoft

API Key Providers

API key authentication providers

Examples:

StripeSendGridTwilioAWS

Manual Auth

Manual authentication providers

Examples:

Custom APIsInternal ServicesLegacy Systems

Common Provider Categories

Communication

EmailSMSSlackDiscordTeams

Storage

AWS S3Google DriveDropboxOneDrive

Development

GitHubGitLabJiraConfluence

Analytics

Google AnalyticsMixpanelAmplitude

Provider Configuration

Understanding how to configure different types of providers

OAuth Providers

  • • Configure OAuth URLs
  • • Set required scopes
  • • Handle token refresh
  • • Manage user consent

API Key Providers

  • • Store API keys securely
  • • Configure headers
  • • Set rate limits
  • • Handle authentication

Manual Auth

  • • Custom authentication
  • • User credentials
  • • Session management
  • • Legacy system support

Overview

Providers enable integration with external services using OAuth, API keys, or manual authentication.

Provider Types

  • • OAuth - OAuth2-based authentication
  • • API Key - Simple API key authentication
  • • Manual - Manual credential management

Key Features

  • • Secure credential storage
  • • Automatic token refresh
  • • Service discovery and validation
  • • Publishing to marketplace

Endpoints

GET/api/providers

List Providers

List providers with pagination and filters

Query Parameters

category(string)Filter by provider category
include_system(boolean)Include system providers (default: true)
search(string)Search by name or description
page(number)Page number (starts at 1)
limit(number)Items per page (default 10)

Response

{
  "data": [
    {
      "id": "provider_123456",
      "name": "Gmail Provider",
      "description": "Send emails via Gmail API",
      "icon_url": "https://example.com/gmail-icon.png",
      "oauth_enabled": true,
      "oauth_config": {
        "auth_url": "https://accounts.google.com/oauth/authorize",
        "token_url": "https://oauth2.googleapis.com/token",
        "scopes": [
          "https://www.googleapis.com/auth/gmail.send"
        ]
      },
      "manual_auth_enabled": false,
      "connection_fields": null,
      "category": "communication",
      "system": false,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T14:22:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 10,
  "pages": 1
}

cURL Example

curl -X GET "https://api.blocktion.io/api/providers" \
  -H "Authorization: Bearer <your_access_token>"
GET/api/providers/{provider_id}

Get Provider

Get a provider by ID

Response

{
  "data": {
    "id": "provider_123456",
    "name": "Gmail Provider",
    "description": "Send emails via Gmail API",
    "icon_url": "https://example.com/gmail-icon.png",
    "oauth_enabled": true,
    "oauth_config": {
      "auth_url": "https://accounts.google.com/oauth/authorize",
      "token_url": "https://oauth2.googleapis.com/token",
      "scopes": [
        "https://www.googleapis.com/auth/gmail.send"
      ]
    },
    "manual_auth_enabled": false,
    "connection_fields": null,
    "category": "communication",
    "system": false,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-20T14:22:00Z"
  }
}

cURL Example

curl -X GET "https://api.blocktion.io/api/providers/{provider_id}" \
  -H "Authorization: Bearer <your_access_token>"
POST/api/providers

Create Provider

Create a new provider

Request Body

{
  "name": "string (required)",
  "description": "string (optional)",
  "icon_url": "string (optional)",
  "oauth_enabled": "boolean (optional, default: false)",
  "oauth_config": "object (optional)",
  "manual_auth_enabled": "boolean (optional, default: true)",
  "connection_fields": "object (optional)",
  "category": "string (optional)"
}

Response

{
  "data": {
    "id": "provider_123456",
    "name": "Custom API Provider",
    "description": "Integration with custom API",
    "icon_url": null,
    "oauth_enabled": false,
    "oauth_config": null,
    "manual_auth_enabled": true,
    "connection_fields": {
      "api_key": "string"
    },
    "category": "custom",
    "system": false,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}

cURL Example

curl -X POST "https://api.blocktion.io/api/providers" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your_access_token>" \
  -d '{
  "name": "string (required)",
  "description": "string (optional)",
  "icon_url": "string (optional)",
  "oauth_enabled": "boolean (optional, default: false)",
  "oauth_config": "object (optional)",
  "manual_auth_enabled": "boolean (optional, default: true)",
  "connection_fields": "object (optional)",
  "category": "string (optional)"
}'
PUT/api/providers/{provider_id}

Update Provider

Update a provider

Request Body

{
  "name": "string (optional)",
  "description": "string (optional)",
  "icon_url": "string (optional)",
  "oauth_enabled": "boolean (optional)",
  "oauth_config": "object (optional)",
  "manual_auth_enabled": "boolean (optional)",
  "connection_fields": "object (optional)",
  "category": "string (optional)"
}

Response

{
  "data": {
    "id": "provider_123456",
    "name": "Updated Provider",
    "description": "Updated description"
  }
}

cURL Example

curl -X PUT "https://api.blocktion.io/api/providers/{provider_id}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your_access_token>" \
  -d '{
  "name": "string (optional)",
  "description": "string (optional)",
  "icon_url": "string (optional)",
  "oauth_enabled": "boolean (optional)",
  "oauth_config": "object (optional)",
  "manual_auth_enabled": "boolean (optional)",
  "connection_fields": "object (optional)",
  "category": "string (optional)"
}'
DELETE/api/providers/{provider_id}

Delete Provider

Delete a provider

Response

{
  "data": {
    "success": true
  }
}

cURL Example

curl -X DELETE "https://api.blocktion.io/api/providers/{provider_id}" \
  -H "Authorization: Bearer <your_access_token>"
POST/api/providers/{provider_id}/publish

Publish Provider

Publish a provider to the marketplace

Response

{
  "data": {
    "provider_id": "provider_123456",
    "status": "published"
  },
  "message": "Provider published successfully"
}

cURL Example

curl -X POST "https://api.blocktion.io/api/providers/{provider_id}/publish" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your_access_token>"

Best Practices

Guidelines for creating and managing providers effectively

Security

  • • Store credentials securely
  • • Use environment variables for sensitive data
  • • Implement proper token refresh
  • • Validate all input parameters

Integration

  • • Handle rate limits gracefully
  • • Implement proper error handling
  • • Use retry logic for failed requests
  • • Monitor provider health and status