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

# Create an action

> Create a reusable action from a catalog entry (`catalogEntryId`), with an optional `params` object supplying the values for that entry's service method. Returns 400 if the params are invalid for the chosen catalog entry.



## OpenAPI

````yaml /api-reference/workflows.yaml post /actions
openapi: 3.1.0
info:
  title: Workflows
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /actions:
    post:
      tags:
        - Actions
      summary: Create an action
      description: >-
        Create a reusable action from a catalog entry (`catalogEntryId`), with
        an optional `params` object supplying the values for that entry's
        service method. Returns 400 if the params are invalid for the chosen
        catalog entry.
      operationId: createAction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateActionBody'
      responses:
        '201':
          description: Action created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Action'
                required:
                  - data
        '400':
          description: Bad Request
      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 action = await client.workflows.actions.create({
              catalogEntryId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              name: 'x',
            });

            console.log(action.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
            )
            action = client.workflows.actions.create(
                catalog_entry_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="x",
            )
            print(action.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\taction, err := client.Workflows.Actions.New(context.TODO(), mobileruncloud.WorkflowActionNewParams{\n\t\tCatalogEntryID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tName:           \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", action.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud workflows:actions create \
              --api-key 'My API Key' \
              --catalog-entry-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --name x
components:
  schemas:
    CreateActionBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        description:
          type: string
          maxLength: 2048
        catalogEntryId:
          type: string
          format: uuid
        params:
          type: object
          additionalProperties: {}
      required:
        - name
        - catalogEntryId
    Action:
      type: object
      properties:
        id:
          type: string
          format: uuid
        userId:
          type: string
          format: uuid
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          deprecated: true
        ownerId:
          type: string
          format: uuid
        createdBy:
          type:
            - string
            - 'null'
          format: uuid
        catalogEntryId:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        service:
          type: string
          enum:
            - tasks_api
            - devices_api
            - agents_api
            - webhooks
        method:
          type: string
        params: {}
        paramsSchema: {}
        createdAt:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - catalogEntryId
        - name
        - description
        - service
        - method
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````