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

# Get a credential

> Fetches a single credential by `packageName` and `credentialName`, including all of its stored fields. Returns not found if no matching credential exists.



## OpenAPI

````yaml /api-reference/phones.yaml get /credentials/packages/{packageName}/credentials/{credentialName}
openapi: 3.1.0
info:
  title: Phones
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /credentials/packages/{packageName}/credentials/{credentialName}:
    get:
      tags:
        - App Credentials
      summary: Get a credential
      description: >-
        Fetches a single credential by `packageName` and `credentialName`,
        including all of its stored fields. Returns not found if no matching
        credential exists.
      operationId: getCredential
      parameters:
        - in: path
          name: packageName
          required: true
          schema:
            maxLength: 200
            minLength: 1
            type: string
        - in: path
          name: credentialName
          required: true
          schema:
            maxLength: 50
            minLength: 3
            pattern: ^[a-z0-9_-]+$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Credential'
                required:
                  - data
                type: object
          description: Credential fetched successfully
        '401':
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                properties:
                  error:
                    type: string
                required:
                  - error
                type: object
          description: Not Found
        '500':
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const credential = await
            client.credentials.packages.credentials.retrieve('26f1kl_-n-71', {
              packageName: 'x',
            });


            console.log(credential.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            credential = client.credentials.packages.credentials.retrieve(
                credential_name="26f1kl_-n-71",
                package_name="x",
            )
            print(credential.data)
components:
  schemas:
    Credential:
      properties:
        createdBy:
          type:
            - string
            - 'null'
        credentialName:
          type: string
        fields:
          items:
            properties:
              fieldType:
                enum:
                  - email
                  - username
                  - password
                  - api_token
                  - phone_number
                  - two_factor_secret
                  - backup_codes
                type: string
              value:
                minLength: 1
                type: string
            required:
              - fieldType
              - value
            type: object
          type: array
        ownerId:
          type: string
        packageName:
          type: string
        secretPath:
          type: string
        userId:
          deprecated: true
          description: >-
            Deprecated: use createdBy (same value — the creating actor). Null
            for credentials created before rollout.
          type:
            - string
            - 'null'
      required:
        - ownerId
        - createdBy
        - userId
        - packageName
        - secretPath
        - credentialName
        - fields
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.