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

# Query Actions

> Query actions for a user.



## OpenAPI

````yaml server-api GET /users/{userId}/actions
openapi: 3.0.0
info:
  description: Authsignal's Server API.
  version: 1.0.0
  title: Server API
  termsOfService: https://www.authsignal.com/legal/terms-of-service
  contact:
    email: hello@authsignal.com
servers:
  - url: https://api.authsignal.com/v1
  - url: https://au.api.authsignal.com/v1
  - url: https://eu.api.authsignal.com/v1
  - url: https://ca.api.authsignal.com/v1
security:
  - basicAuth: []
tags:
  - name: users
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: challenge
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: authenticator configurations
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: actions
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: query
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: email
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: sms
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: verify
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: challenges
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: sessions
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
  - name: devices
    description: ''
    externalDocs:
      description: Find out more
      url: https://docs.authsignal.com
externalDocs:
  description: Find out more about Authsignal
  url: https://docs.authsignal.com
paths:
  /users/{userId}/actions:
    get:
      tags:
        - users
        - actions
        - query
      summary: Query actions
      description: Query actions for a user.
      operationId: queryActions
      parameters:
        - $ref: '#/components/parameters/userId'
        - in: query
          name: codes
          schema:
            type: string
            description: >-
              A comma-separated list of action codes to include in your query.
              If omitted, all action codes will be included.
        - in: query
          name: fromDate
          schema:
            type: string
            description: >-
              If provided, the query will include actions from this date. Must
              be specified in ISO 8601 format - e.g. `2020-01-01T00:00:00Z`. The
              default and maximum value is 30 days ago.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/QueryActionsResponseBody'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    userId:
      name: userId
      in: path
      description: The ID of the user.
      required: true
      schema:
        type: string
  schemas:
    QueryActionsResponseBody:
      type: object
      properties:
        actionCode:
          type: string
          description: The action code.
        idempotencyKey:
          type: string
          description: The idempotency key for the user action.
        createdAt:
          type: string
          format: date-time
          description: The time in ISO 8061 format when the action was first created.
        updatedAt:
          type: string
          format: date-time
          description: The time in ISO 8061 format when the action was last updated.
        state:
          $ref: '#/components/schemas/ActionState'
        stateUpdatedAt:
          type: string
          format: date-time
          description: >-
            The time in ISO 8061 format when the state of the action was last
            updated.
        verificationMethod:
          $ref: '#/components/schemas/VerificationMethod'
        verifiedByAuthenticatorId:
          type: string
          description: >-
            The ID of the authenticator which was used to complete the challenge
            associated with the action.
        userAgent:
          type: string
          description: The user agent provided when the action was tracked.
        ipAddress:
          type: string
          description: The IP address provided when the action was tracked.
        countryCode:
          type: string
          description: The country code derived from the IP address if provided.
    ActionState:
      type: string
      enum:
        - ALLOW
        - BLOCK
        - CHALLENGE_REQUIRED
        - CHALLENGE_FAILED
        - CHALLENGE_SUCCEEDED
        - REVIEW_REQUIRED
        - REVIEW_FAILED
        - REVIEW_SUCCEEDED
      description: The current state of the action.
    VerificationMethod:
      type: string
      enum:
        - SMS
        - AUTHENTICATOR_APP
        - EMAIL_MAGIC_LINK
        - EMAIL_OTP
        - PUSH
        - DEVICE
        - SECURITY_KEY
        - PASSKEY
        - VERIFF
        - IPROOV
        - PALM_BIOMETRICS_RR
        - IDVERSE
    Error:
      type: object
      properties:
        error:
          type: string
        errorDescription:
          type: string
      required:
        - error
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Use your Authsignal Server API secret key as the username and leave the
        password empty. The secret key can be found in the API Keys section of
        the Authsignal Portal settings page.

````