> ## 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.

# Link a Provider to an Application

> Use this endpoint to link an existing provider to an application and configure its sign-in and sign-up permissions.



## OpenAPI

````yaml /en/openapi/v3-current/AM-identity.yaml post /v1/applications/{id}/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/applications/{id}/providers:
    post:
      tags:
        - Application Providers API
      summary: Link a Provider to an Application
      description: >-
        Use this endpoint to link an existing provider to an application and
        configure its sign-in and sign-up permissions.
      parameters:
        - $ref: '#/components/parameters/ApplicationId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProviderItemInput'
            example:
              providerId: 019c96a0-1a10-7abc-d1e2-8c9d0e1f2a3b
              canSignIn: true
              canSignUp: true
              canUnlink: false
              prompted: false
      responses:
        '201':
          description: >-
            Indicates that the provider was successfully linked to the
            application.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderItemResponse'
              example:
                providerId: 019c96a0-1a10-7abc-d1e2-8c9d0e1f2a3b
                category: Email
                type: SendGrid
                canSignIn: true
                canSignUp: true
                canUnlink: false
                prompted: false
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0001:
                  $ref: '#/components/examples/Error0001'
                Error0004:
                  $ref: '#/components/examples/Error0004'
                Error0007:
                  $ref: '#/components/examples/Error0007'
          headers: {}
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error1001:
                  $ref: '#/components/examples/Error1001'
                Error1007:
                  $ref: '#/components/examples/Error1007'
          headers: {}
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error1011:
                  $ref: '#/components/examples/Error1011'
          headers: {}
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0006:
                  $ref: '#/components/examples/Error0006'
          headers: {}
      security:
        - bearer: []
components:
  parameters:
    ApplicationId:
      name: id
      in: path
      description: The unique identifier of the application you want to retrieve.
      required: true
      example: 019c96a0-0c0c-7221-8cf3-13313fb60081
      schema:
        type: string
  schemas:
    ProviderItemInput:
      description: Information required to link a provider to an application.
      type: object
      required:
        - providerId
      properties:
        providerId:
          type: string
          description: The unique identifier of the provider to link.
        canSignIn:
          type: boolean
          description: Whether users can sign in using this provider.
          default: false
        canSignUp:
          type: boolean
          description: Whether new users can sign up using this provider.
          default: false
        canUnlink:
          type: boolean
          description: Whether users can unlink this provider from their account.
          default: false
        prompted:
          type: boolean
          description: Whether users are prompted to link this provider on login.
          default: false
        alertType:
          type: string
          description: Alert type configuration for this provider link.
        rule:
          type: string
          description: Custom rule applied to this provider link.
    ProviderItemResponse:
      description: Information about a provider linked to an application.
      type: object
      properties:
        providerId:
          type: string
          description: Unique identifier of the linked provider.
        category:
          type: string
          description: Provider category.
          enum:
            - Email
            - SMS
        type:
          type: string
          description: Provider implementation type.
          enum:
            - SendGrid
            - Twilio
        canSignIn:
          type: boolean
          description: Whether users can sign in using this provider.
        canSignUp:
          type: boolean
          description: Whether new users can sign up using this provider.
        canUnlink:
          type: boolean
          description: Whether users can unlink this provider from their account.
        prompted:
          type: boolean
          description: Whether users are prompted to link this provider on login.
        alertType:
          type: string
          description: Alert type configuration for this provider link.
        rule:
          type: string
          description: Custom rule applied to this provider link.
    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.
    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.
    Error1001:
      summary: Application ID Not Found
      value:
        code: IDE-1001
        title: Application ID Not Found
        message: The provided application ID does not exist in our records.
    Error1007:
      summary: Provider Not Found
      value:
        code: IDE-1007
        title: Provider Not Found
        message: The provided provider ID does not exist in our records.
    Error1011:
      summary: Provider Already Linked
      value:
        code: IDE-1011
        title: Provider Already Linked
        message: The provider is already linked to this application.
    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.

````