# Create a list of actions and allocations for a line item

Creates an ordered list of actions to be taken when a condition is met.

Endpoint: POST /api/v1.1/instances/{instanceId}/line-items/{lineItemId}/actions
Version: v1.1
Security: AdministrationAccess, ClientAccess

## Security:

  - `AdministrationAccess` (unknown)
    http bearer JWT

  - `ClientAccess` (unknown)
    http bearer JWT

## Path parameters:

  - `instanceId` (string, required)
    The UUID of the Dynamic Monetization instance.

  - `lineItemId` (string, required)
    Line item ID. 
Note: This is also known as the activation ID.

## Request fields (application/json):

  - `actions` (array)

  - `actions.name` (string)
    A human readable name to help a user identify the action. The same name may be re-used in other line items.

  - `actions.conditionId` (string)
    The unique identifier of the condition that triggers this action.

Required, unless defining a default action. Only one default action may be defined per line item.

  - `actions.action` (string, required)
    The action to take when the condition is met.
    Enum: "ALLOW", "DENY"

  - `actions.allocation` (number)
    The maximum number of tokens that may be consumed from the stated line item by requests satisfying the condition.

Required for ALLOW, but may be omitted at most once per line item to create a default ALLOW action.
Not used for DENY.
    Example: 1000

## Response 200:

  - `200` (unknown)
    A list of actions that were created.

## Response 200 fields (application/json):

  - `id` (string)
    A generated identifier to uniquely identify the action.

  - `name` (string)
    A human readable name to help a user identify the action. The same name may be re-used in other line items.

  - `conditionId` (string)
    The unique identifier of the condition that triggers this action.

Required, unless defining a default action. Only one default action may be defined per line item.

  - `action` (string, required)
    The action to take when the condition is met.
    Enum: "ALLOW", "DENY"

  - `allocation` (number)
    The maximum number of tokens that may be consumed from the stated line item by requests satisfying the condition.

Required for ALLOW, but may be omitted at most once per line item to create a default ALLOW action.
Not used for DENY.
    Example: 1000

  - `used` (number)
    The total count that has been consumed from the allocation by access requests.

This field is only present for actions which have an allocation.

## Response 400:

  - `400` (unknown)
    Bad Request. Check the request for any errors in the input.

## Response 401:

  - `401` (unknown)
    Unauthorized. Check authentication details.

## Response 500:

  - `500` (unknown)
    Internal Server Error. There was an internal error processing the request. If you need to contact support, please include the reference number provided in the response.

