> ## 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:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
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:
        - schema:
            type: string
            minLength: 1
            maxLength: 200
          required: true
          name: packageName
          in: path
        - schema:
            type: string
            minLength: 3
            maxLength: 50
            pattern: ^[a-z0-9_-]+$
          required: true
          name: credentialName
          in: path
      responses:
        '200':
          description: Credential fetched successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Credential'
                required:
                  - data
        '401':
          description: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '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)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcredential, err := client.Credentials.Packages.Credentials.Get(\n\t\tcontext.TODO(),\n\t\t\"26f1kl_-n-71\",\n\t\tmobileruncloud.CredentialPackageCredentialGetParams{\n\t\t\tPackageName: \"x\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", credential.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud credentials:packages:credentials retrieve \
              --api-key 'My API Key' \
              --package-name x \
              --credential-name 26f1kl_-n-71
components:
  schemas:
    Credential:
      type: object
      properties:
        userId:
          type: string
        packageName:
          type: string
        secretPath:
          type: string
        credentialName:
          type: string
        fields:
          type: array
          items:
            type: object
            properties:
              fieldType:
                type: string
                enum:
                  - email
                  - username
                  - password
                  - api_token
                  - phone_number
                  - two_factor_secret
                  - backup_codes
              value:
                type: string
                minLength: 1
            required:
              - fieldType
              - value
      required:
        - userId
        - packageName
        - secretPath
        - credentialName
        - fields
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````