> ## 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:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
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':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Action'
                required:
                  - data
                type: object
          description: Action created
        '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)
components:
  schemas:
    CreateActionBody:
      properties:
        catalogEntryId:
          format: uuid
          type: string
        description:
          maxLength: 2048
          type: string
        name:
          maxLength: 256
          minLength: 1
          type: string
        params:
          additionalProperties: {}
          type: object
      required:
        - name
        - catalogEntryId
      type: object
    Action:
      properties:
        catalogEntryId:
          format: uuid
          type: string
        createdAt:
          type:
            - string
            - 'null'
        createdBy:
          format: uuid
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        method:
          type: string
        name:
          type: string
        ownerId:
          format: uuid
          type: string
        params: {}
        paramsSchema: {}
        service:
          enum:
            - tasks_api
            - devices_api
            - agents_api
            - webhooks
          type: string
        updatedAt:
          type:
            - string
            - 'null'
        userId:
          deprecated: true
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          format: uuid
          type: string
      required:
        - id
        - userId
        - ownerId
        - createdBy
        - catalogEntryId
        - name
        - description
        - service
        - method
        - createdAt
        - updatedAt
      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.