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

# Create a Provider

> Use this endpoint to register a new communication provider (email or SMS) for use in authentication and notification flows.



## OpenAPI

````yaml /en/openapi/v3-current/AM-identity.yaml post /v1/providers
openapi: 3.1.0
info:
  title: Identity Plugin
  description: ''
  version: 2.4.2
servers:
  - url: https://identity.sandbox.lerian.net
security: []
tags:
  - name: Groups API
  - name: Applications API
  - name: Users API
  - name: MFA API
  - name: Providers API
  - name: Application Providers API
paths:
  /v1/providers:
    post:
      tags:
        - Providers API
      summary: Create a Provider
      description: >-
        Use this endpoint to register a new communication provider (email or
        SMS) for use in authentication and notification flows.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProviderInput'
            example:
              name: sendgrid-primary
              category: Email
              type: SendGrid
              clientId: SG.your_api_key_here
              clientSecret: your_secret
              host: smtp.sendgrid.net
              port: 587
              disableSsl: false
      responses:
        '201':
          description: >-
            Indicates that the provider was successfully created and the
            operation was completed as expected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderResponse'
              example:
                id: 019c96a0-1a10-7abc-d1e2-8c9d0e1f2a3b
                name: sendgrid-primary
                category: Email
                type: SendGrid
                host: smtp.sendgrid.net
                port: 587
                disableSsl: false
                createdAt: '2025-04-08T08:01:30.000Z'
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0001:
                  $ref: '#/components/examples/Error0001'
                Error0002:
                  $ref: '#/components/examples/Error0002'
                Error0004:
                  $ref: '#/components/examples/Error0004'
                Error0007:
                  $ref: '#/components/examples/Error0007'
                Error1009:
                  $ref: '#/components/examples/Error1009'
                Error1010:
                  $ref: '#/components/examples/Error1010'
          headers: {}
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error1008:
                  $ref: '#/components/examples/Error1008'
          headers: {}
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0006:
                  $ref: '#/components/examples/Error0006'
          headers: {}
      security:
        - bearer: []
components:
  schemas:
    ProviderInput:
      description: Information required to create a new communication provider.
      type: object
      required:
        - name
        - category
        - type
      properties:
        name:
          type: string
          description: A unique name to identify the provider.
        category:
          type: string
          description: The provider category.
          enum:
            - Email
            - SMS
        type:
          type: string
          description: The provider implementation type.
          enum:
            - SendGrid
            - Twilio
        subType:
          type: string
          description: Provider sub-type, if applicable.
        method:
          type: string
          description: Authentication or delivery method.
        clientId:
          type: string
          description: Client ID or API key for authenticating with the provider.
        clientSecret:
          type: string
          description: Client secret or API secret for authenticating with the provider.
        clientId2:
          type: string
          description: Secondary client ID, if applicable.
        clientSecret2:
          type: string
          description: Secondary client secret, if applicable.
        host:
          type: string
          description: SMTP or API host address (Email providers).
        port:
          type: integer
          description: SMTP port (Email providers).
        disableSsl:
          type: boolean
          description: Set to true to disable SSL/TLS (not recommended for production).
          default: false
        title:
          type: string
          description: Default email or SMS title/subject.
        content:
          type: string
          description: Default message content template.
        receiver:
          type: string
          description: Default receiver address for testing.
        regionId:
          type: string
          description: Cloud region ID (provider-specific).
        signName:
          type: string
          description: SMS signature name (provider-specific).
        templateCode:
          type: string
          description: SMS template code (provider-specific).
        appId:
          type: string
          description: Application ID (provider-specific).
        endpoint:
          type: string
          description: Provider API endpoint URL.
        intranetEndpoint:
          type: string
          description: Intranet endpoint for private network access.
        domain:
          type: string
          description: Provider domain.
    ProviderResponse:
      description: Information about a communication provider.
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the provider.
        name:
          type: string
          description: Name of the provider.
        category:
          type: string
          description: Provider category.
          enum:
            - Email
            - SMS
        type:
          type: string
          description: Provider implementation type.
          enum:
            - SendGrid
            - Twilio
        subType:
          type: string
          description: Provider sub-type, if applicable.
        method:
          type: string
          description: Authentication or delivery method.
        clientId:
          type: string
          description: Client ID or API key (secret is never returned).
        clientId2:
          type: string
          description: Secondary client ID, if applicable.
        host:
          type: string
          description: SMTP or API host address.
        port:
          type: integer
          description: SMTP port.
        disableSsl:
          type: boolean
          description: Indicates whether SSL/TLS is disabled.
        title:
          type: string
          description: Default email or SMS title/subject.
        content:
          type: string
          description: Default message content template.
        receiver:
          type: string
          description: Default receiver address for testing.
        regionId:
          type: string
          description: Cloud region ID (provider-specific).
        signName:
          type: string
          description: SMS signature name (provider-specific).
        templateCode:
          type: string
          description: SMS template code (provider-specific).
        appId:
          type: string
          description: Application ID (provider-specific).
        endpoint:
          type: string
          description: Provider API endpoint URL.
        intranetEndpoint:
          type: string
          description: Intranet endpoint for private network access.
        domain:
          type: string
          description: Provider domain.
        providerUrl:
          type: string
          description: Provider-specific URL.
        createdAt:
          type: string
          format: date-time
          description: Timestamp marking when the provider was created.
    ErrorMessage:
      description: The response message error.
      type: object
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
  examples:
    Error0001:
      summary: Missing Fields in Request
      value:
        code: IDE-0001
        title: Missing Fields in Request
        message: Your request is missing one or more required fields.
    Error0002:
      summary: Invalid Field Type in Request
      value:
        code: IDE-0002
        title: Invalid Field Type in Request
        message: The provided field type in the request is invalid.
    Error0004:
      summary: Unexpected Fields in the Request
      value:
        code: IDE-0004
        title: Unexpected Fields in the Request
        message: >-
          The request body contains more fields than expected. Please send only
          the allowed fields.
    Error0007:
      summary: Bad Request
      value:
        code: IDE-0007
        title: Bad Request
        message: The server could not understand the request due to malformed syntax.
    Error1009:
      summary: Invalid Provider Type
      value:
        code: IDE-1009
        title: Invalid Provider Type
        message: >-
          The provided provider type is invalid. Accepted values are SendGrid
          and Twilio.
    Error1010:
      summary: Invalid Provider Category
      value:
        code: IDE-1010
        title: Invalid Provider Category
        message: >-
          The provided provider category is invalid. Accepted values are Email
          and SMS.
    Error1008:
      summary: Provider Already Exists
      value:
        code: IDE-1008
        title: Provider Already Exists
        message: >-
          A provider with the same name already exists. Please use a different
          name and try again.
    Error0006:
      summary: Internal Server Error
      value:
        code: IDE-0006
        title: Internal Server Error
        message: The server encountered an unexpected error. Please try again later.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: The authorization token in the 'Bearer <token>' format.

````