> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.select.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an action



## OpenAPI

````yaml https://api.select.dev/v2/openapi.json post /actions
openapi: 3.1.0
info:
  title: SELECT API (v2)
  version: 0.1.0
servers:
  - url: https://api.select.dev/v2
    description: SELECT API v2
security: []
paths:
  /actions:
    post:
      tags:
        - actions
      summary: Create an action
      operationId: create_action_route_actions_post
      parameters:
        - name: x-tenant-id
          in: header
          required: true
          schema:
            type: string
            description: The organization ID the request is scoped to.
            title: X-Tenant-Id
          description: The organization ID the request is scoped to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionV2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '408':
          $ref: '#/components/responses/RequestTimeout'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - HTTPBearer: []
components:
  schemas:
    ActionCreate:
      properties:
        title:
          type: string
          maxLength: 200
          title: Title
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        user_email:
          type: string
          minLength: 1
          title: User Email
          description: >-
            Email of the person who took this action. Defaults to the calling
            user. Required for an API key, which has no user identity. Cannot be
            `null`.
          x-doit-confidentiality: customer-data
          x-doit-pii: true
        actioned_time:
          type: string
          format: date-time
          title: Actioned Time
          description: >-
            When the action was taken, as an RFC 3339 timestamp. Defaults to
            now. Set it to backdate the action; savings are then measured from
            that day. Converted to UTC; a timestamp with no offset is read as
            UTC. Cannot be `null`.
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
        srn:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          title: Srn
          description: >-
            The canonical SELECT Resource Name (SRN) of the resource this action
            applies to. Resolve one from a resource's identifying details with
            `POST /v2/srn/actions/resolve`. An empty string scopes the action to
            the whole organization. Insight SRNs are rejected — name an insight
            with `insight_id` instead.
        insight_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Insight Id
        savings_type:
          type: string
          enum:
            - manual
            - calculated
            - calculated_smart_suspend
          title: Savings Type
        savings_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Savings Amount
        savings_rate_percent:
          anyOf:
            - type: number
            - type: 'null'
          title: Savings Rate Percent
        select_feature:
          anyOf:
            - type: string
              enum:
                - smart_suspend
                - apc_automated_savings
                - dbx_warehouse_automated_savings
                - jcss_automated_savings
            - type: 'null'
          title: Select Feature
        resource_metadata:
          anyOf:
            - $ref: '#/components/schemas/ResourceMetadata'
            - type: 'null'
        team_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Team Id
      additionalProperties: false
      type: object
      required:
        - title
        - savings_type
      title: ActionCreate
      description: >-
        Create a cost-saving action.


        Name the resource the action applies to with exactly one of `srn` or

        `insight_id`. If you have the resource's identifying details but not its

        SRN, resolve one first with `POST /v2/srn/actions/resolve`. An action on
        an

        insight must name it with `insight_id`.


        `user_email` defaults to the calling user. `actioned_time` defaults to
        now;

        set it to backdate the action. An API key has no user identity, so a

        key-authenticated caller must set `user_email`.
    ActionV2:
      properties:
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        srn:
          type: string
          title: Srn
        comment:
          anyOf:
            - type: string
            - type: 'null'
          title: Comment
        user_email:
          type: string
          title: User Email
          x-doit-confidentiality: customer-data
          x-doit-pii: true
        actioned_time:
          type: string
          title: Actioned Time
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
        insight_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Insight Id
        insight_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Insight Type
        savings_type:
          anyOf:
            - type: string
              enum:
                - calculated
                - manual
            - type: 'null'
          title: Savings Type
        savings_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Savings Amount
        savings_rate_percent:
          anyOf:
            - type: number
            - type: 'null'
          title: Savings Rate Percent
        savings_override_percent:
          anyOf:
            - type: number
            - type: 'null'
          title: Savings Override Percent
        current_daily_savings:
          anyOf:
            - type: number
            - type: 'null'
          title: Current Daily Savings
          readOnly: true
          x-terraform-computed: true
        current_annualized_savings:
          anyOf:
            - type: number
            - type: 'null'
          title: Current Annualized Savings
          readOnly: true
          x-terraform-computed: true
        current_realized_savings:
          anyOf:
            - type: number
            - type: 'null'
          title: Current Realized Savings
          readOnly: true
          x-terraform-computed: true
        savings_status:
          anyOf:
            - type: string
              enum:
                - pending
                - calculated
                - error
                - unsupported
            - type: 'null'
          title: Savings Status
        savings_calculation_metadata:
          anyOf:
            - $ref: '#/components/schemas/SavingsCalculationMetadata'
            - type: 'null'
        savings_materialized_through:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Savings Materialized Through
        select_feature:
          anyOf:
            - type: string
              enum:
                - smart_suspend
                - apc_automated_savings
                - dbx_warehouse_automated_savings
                - jcss_automated_savings
            - type: 'null'
          title: Select Feature
        resource_metadata:
          anyOf:
            - $ref: '#/components/schemas/ResourceMetadata'
            - type: 'null'
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        created_by:
          type: string
          title: Created By
          x-doit-confidentiality: customer-data
          x-doit-pii: true
        updated_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By
          x-doit-confidentiality: customer-data
          x-doit-pii: true
        srn_resource_type:
          type: string
          title: Srn Resource Type
        create_time:
          type: string
          title: Create Time
        update_time:
          type: string
          title: Update Time
        etag:
          type: string
          title: Etag
          description: Opaque strong ETag.
          readOnly: true
          x-terraform-computed: true
      type: object
      required:
        - id
        - title
        - srn
        - user_email
        - actioned_time
        - created_by
        - srn_resource_type
        - create_time
        - update_time
        - etag
      title: Action
      description: >-
        A cost-saving action taken on a Snowflake resource, with its measured
        savings.
    ResourceMetadata:
      properties:
        resource_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Type
        identifying_metadata:
          additionalProperties: true
          type: object
          title: Identifying Metadata
        account_metadata:
          additionalProperties: true
          type: object
          title: Account Metadata
      type: object
      title: ResourceMetadata
    SavingsCalculationMetadata:
      properties:
        avg_daily_before:
          type: number
          title: Avg Daily Before
        avg_daily_after:
          type: number
          title: Avg Daily After
        savings_per_day:
          type: number
          title: Savings Per Day
        after_period_start:
          type: string
          title: After Period Start
        after_period_end:
          type: string
          title: After Period End
        before_period_start:
          type: string
          title: Before Period Start
        before_period_end:
          type: string
          title: Before Period End
        days_in_period:
          type: integer
          title: Days In Period
        sum_spend_before:
          type: number
          title: Sum Spend Before
        sum_spend_after:
          type: number
          title: Sum Spend After
        calculated_at:
          type: string
          title: Calculated At
        savings_rate_percent:
          anyOf:
            - type: number
            - type: 'null'
          title: Savings Rate Percent
        was_capped:
          type: boolean
          title: Was Capped
          default: false
        eligibility:
          anyOf:
            - $ref: '#/components/schemas/EligibilityResult'
            - type: 'null'
        override:
          anyOf:
            - $ref: '#/components/schemas/OverrideInfo'
            - type: 'null'
      type: object
      required:
        - avg_daily_before
        - avg_daily_after
        - savings_per_day
        - after_period_start
        - after_period_end
        - before_period_start
        - before_period_end
        - days_in_period
        - sum_spend_before
        - sum_spend_after
        - calculated_at
      title: SavingsCalculationMetadata
    ProblemDetail:
      additionalProperties: true
      description: >-
        RFC 9457-style error payload, served as ``application/problem+json``.


        ``code`` is the stable, machine-readable identifier — consumers branch
        on it,

        never on ``title``. ``type`` stays ``about:blank``: we keep no per-error

        documentation pages. There is no ``instance``/request-id member (we
        don't run

        access logs). See the flat error-code catalogue in §4 of the standards
        doc.
      properties:
        type:
          default: about:blank
          title: Type
          type: string
        title:
          type: string
          title: Title
        status:
          title: Status
          type: integer
        detail:
          title: Detail
          type: string
        code:
          title: Code
          type: string
        retryable:
          title: Retryable
          type: boolean
        details:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          default: null
          title: Details
      required:
        - title
        - status
        - detail
        - code
        - retryable
      title: ProblemDetail
      type: object
    EligibilityResult:
      properties:
        eligible:
          type: boolean
          title: Eligible
        reasons:
          items:
            type: string
          type: array
          title: Reasons
        insufficient_spend:
          type: boolean
          title: Insufficient Spend
          default: false
        bytes_diff_pct:
          anyOf:
            - type: number
            - type: 'null'
          title: Bytes Diff Pct
        query_diff_pct:
          anyOf:
            - type: number
            - type: 'null'
          title: Query Diff Pct
        config_changes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Config Changes
        multi_cluster:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Multi Cluster
        prior_savings:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Prior Savings
      type: object
      required:
        - eligible
      title: EligibilityResult
      description: >-
        Whether an action qualifies for percentage-of-spend savings and the
        indicators behind that decision.
    OverrideInfo:
      properties:
        applied_percent:
          type: number
          title: Applied Percent
        original_reasons:
          items:
            type: string
          type: array
          title: Original Reasons
      type: object
      required:
        - applied_percent
      title: OverrideInfo
      description: >-
        A manually applied savings percentage override and the original
        ineligibility reasons.
  responses:
    BadRequest:
      description: Bad request
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        WWW-Authenticate:
          description: Authentication challenge for the requested resource.
          required: true
          schema:
            type: string
    Forbidden:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    NotFound:
      description: Not found
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    MethodNotAllowed:
      description: Method not allowed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        Allow:
          description: HTTP methods supported by the requested resource.
          required: true
          schema:
            type: string
    RequestTimeout:
      description: Request Timeout
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    Conflict:
      description: Conflict
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    ValidationFailed:
      description: Validation failed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    RateLimited:
      description: Rate limited
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          required: true
          schema:
            type: integer
            minimum: 0
    InternalError:
      description: Internal error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
    ServiceUnavailable:
      description: Service unavailable
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          required: true
          schema:
            type: integer
            minimum: 0
  securitySchemes:
    HTTPBearer:
      type: http
      description: Organization API key (sl_…).
      scheme: bearer

````