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

# Set Default Application Provider

> Use this endpoint to set a provider as the default for an application. The default provider is used when no specific provider is requested.



## OpenAPI

````yaml /en/openapi/v3-current/AM-identity.yaml patch /v1/applications/{id}/providers/{providerId}/default
openapi: 3.1.0
info:
  title: Identity Plugin
  description: ''
  version: 2.4.4
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/{providerId}/default:
    patch:
      tags:
        - Application Providers API
      summary: Set Default Application Provider
      description: >-
        Use this endpoint to set a provider as the default for an application.
        The default provider is used when no specific provider is requested.
      parameters:
        - $ref: '#/components/parameters/ApplicationId'
        - $ref: '#/components/parameters/ProviderId'
      responses:
        '200':
          description: Indicates that the provider was successfully set as default.
          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:
                Error0003:
                  $ref: '#/components/examples/Error0003'
                Error0007:
                  $ref: '#/components/examples/Error0007'
          headers: {}
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error1001:
                  $ref: '#/components/examples/Error1001'
                Error1012:
                  $ref: '#/components/examples/Error1012'
          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
    ProviderId:
      name: providerId
      in: path
      description: The unique identifier of the provider.
      required: true
      example: 019c96a0-1a10-7abc-d1e2-8c9d0e1f2a3b
      schema:
        type: string
  schemas:
    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:
    Error0003:
      summary: Invalid Path Parameter
      value:
        code: IDE-0003
        title: Invalid Path Parameter
        message: One or more path parameters are in an incorrect format.
    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.
    Error1012:
      summary: Provider Not Linked
      value:
        code: IDE-1012
        title: Provider Not Linked
        message: The provider is not 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.

````