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

# Initialize a new package/app

> Creates a new package (identified by `packageName`) under which credentials can be grouped. Returns a conflict if a package with the same name already exists for the user.



## OpenAPI

````yaml /api-reference/phones.yaml post /credentials/packages
openapi: 3.1.0
info:
  title: Phones
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /credentials/packages:
    post:
      tags:
        - App Credentials
      summary: Initialize a new package/app
      description: >-
        Creates a new package (identified by `packageName`) under which
        credentials can be grouped. Returns a conflict if a package with the
        same name already exists for the user.
      operationId: initializePackage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PackageSchema'
      responses:
        '200':
          description: Package initialized
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  message:
                    type: string
                  data:
                    $ref: '#/components/schemas/PackageSchema'
                required:
                  - success
                  - message
                  - data
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '409':
          description: Conflict
        '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 _package = await client.credentials.packages.create({
            packageName: 'x' });


            console.log(_package.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
            )
            package = client.credentials.packages.create(
                package_name="x",
            )
            print(package.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\tpackage_, err := client.Credentials.Packages.New(context.TODO(), mobileruncloud.CredentialPackageNewParams{\n\t\tPackageName: \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", package_.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud credentials:packages create \
              --api-key 'My API Key' \
              --package-name x
components:
  schemas:
    PackageSchema:
      type: object
      properties:
        packageName:
          type: string
          minLength: 1
          maxLength: 200
      required:
        - packageName
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````