> ## Documentation Index
> Fetch the complete documentation index at: https://ekacare-quickstart-cleanup.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add FCM Credentials

> Store FCM credentials. This endpoint allows clients to store Firebase Cloud Messaging (FCM) credentials by providing the service account key details. The stored credentials will be used for sending notifications to the registered devices. The request body must contain the FCM payload information.




## OpenAPI

````yaml post /notification/fcm-creds
openapi: 3.1.0
info:
  title: Notification Connect
  description: |-
    | **Pipeline** | **Release Date** |
    | --- | --- |
    | Registration API | 12th Aug, 2024 |
  version: 1.0.0
servers:
  - url: https://api.eka.care
  - url: https://api.dev.eka.care
security:
  - bearerAuth: []
paths:
  /notification/fcm-creds:
    post:
      tags:
        - Notifications
      summary: Add FCM Credentials
      description: >
        Store FCM credentials. This endpoint allows clients to store Firebase
        Cloud Messaging (FCM) credentials by providing the service account key
        details. The stored credentials will be used for sending notifications
        to the registered devices. The request body must contain the FCM payload
        information.
      operationId: addFcmCreds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FCMPayload'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
              example:
                message: FCM token added successfully
        '400':
          description: Client error response
          content:
            application/json:
              schema:
                type: object
              example:
                message: Unauthorized access.
                error_code: 401
        '500':
          description: Server error response
          content:
            application/json:
              schema:
                type: object
              example:
                message: Internal server error.
                error_code: 500
      security:
        - bearerAuth: []
components:
  schemas:
    FCMPayload:
      type: object
      properties:
        sa_key:
          type: object
          properties:
            type:
              description: The type of the service account key.
              type: string
            project_id:
              description: The unique identifier for the project.
              type: string
            private_key_id:
              description: The unique identifier for the private key.
              type: string
            private_key:
              description: The private key used for authentication.
              type: string
            client_email:
              description: The email address associated with the client.
              type: string
            client_id:
              description: The unique identifier for the client.
              type: string
            auth_uri:
              description: The URI used for authentication.
              type: string
            token_uri:
              description: The URI used to obtain the token.
              type: string
            auth_provider_x509_cert_url:
              description: The URL for the auth provider's X.509 certificate.
              type: string
            client_x509_cert_url:
              description: The URL for the client's X.509 certificate.
              type: string
            universal_domain:
              description: The universal domain associated with the service account.
              type: string
      required:
        - sa_key
      description: >-
        The request body must contain the FCM payload information. The format
        should be:

        ```json {
          "sa_key": {
            "type": "string",
            "project_id": "string",
            "private_key_id": "string",
            "private_key": "string",
            "client_email": "string",
            "client_id": "string",
            "auth_uri": "string",
            "token_uri": "string",
            "auth_provider_x509_cert_url": "string",
            "client_x509_cert_url": "string",
            "universal_domain": "string"
          }
        } ```
      example:
        sa_key:
          type: service_account
          project_id: example-project
          private_key_id: 1234567890abcdef
          private_key: >-
            -----BEGIN PRIVATE
            KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC...\n-----END PRIVATE
            KEY-----\n
          client_email: example@example.iam.gserviceaccount.com
          client_id: 12345678901234567000
          auth_uri: https://accounts.google.com/o/oauth2/auth
          token_uri: https://oauth2.googleapis.com/token
          auth_provider_x509_cert_url: https://www.googleapis.com/oauth2/v1/certs
          client_x509_cert_url: >-
            https://www.googleapis.com/robot/v1/metadata/x509/example@example.iam.gserviceaccount.com
          universal_domain: example.com
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        The API requires a Bearer token in the Authorization header for
        authentication.

````