---
updatedAt: 2025-06-02T21:52:23.000Z
agentTools:
  projectIndex: https://developers.evrythng.com/llms.txt
---

# Test Actions

Test Actions is a way to test redirections configured in the EVT platform without data being generated in the platform.

> ❗️ Warning
>
> Test Actions API is for testing purpose only

## TestActionDocument Data Model

An object representing a Test Action. This document has same content as regular Action document with a few tweaks:

* It is possible to provide `id` field, and it will be used instead of generated one
* It is possible to provide `createdAt` timestamp and it will be used instead of generated one
* It is possible to override `timestamp` field

```text Fields
.type (string, required)
    The action type.

.id (string)
    The ID of this resource.

.user (string, read-only)
    The EVRYTHNG ID of the user who has performed this action.

.createdAt (integer)
    Timestamp when the resource was created.

.createdByProject (string, read-only)
    The EVRYTHNG ID of the project who has performed this 
    action.

.createdByApp (string, read-only)
    The EVRYTHNG ID of the application who has performed this 
    action.

.thng (string)
    The EVRYTHNG ID of the Thng this action was carried out on.

.product (string)
    The EVRYTHNG product ID associated with the Thng this action 
    was carried out on.

.collection (string)
    The EVRYTHNG ID of the collection this action was carried 
    out on. Custom action types only.

.timestamp (integer)
    The timestamp when the action took place. Filled 
    automatically if unspecified.

.identifiers (IdentifiersDocument)
    Various identifiers (EPC, GTIN, etc.) as a JSON object with 
    one or more key-value pairs.

.location (LocationDocument)
    An object representing a location. Either 'position' or 
    'place' us required.

.locationSource (string, one of 'sensor', 'geoIp', 'unknown', 'place')
    The method used to find the location where the action took 
    place, and requires `location` to also be set. If a GPS was 
    used (with user permission granted), `sensor` is specified. 
    Otherwise an estimate is made based on the apparent 
    location, which may not be the device itself.

.context (ActionContextDocument)
    Object containing contextual data about the action creator.

.customFields (CustomFieldsDocument)
    Object of case-sensititve key-value pairs of custom fields 
    associated with the resource.

.scopes (ScopesDocument)
    Project and user scopes arrays.

.tags (array of string)
    Array of string tags associated with this resource.

.reactions (array of ReactionDocument)
    An array of Redirector reactions that occurred from this 
    action.

.url (string)
    The URL to the triggering scan, added in some cases.

.consumerId (string)
    App-specific ID id to identify a user that has scanned a 
    given product.
```
```json Schema
{
  "additionalProperties": false,
  "type": "object",
  "description": "An object representing a Platform action.",
  "required": ["type"],
  "properties": {
    "type": {
      "type": "string",
      "description": "The action type."
    },
    "id": {
      "type": "string",
      "description": "The ID of this resource.",
      "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$",
      "readOnly": false
    },
    "user": {
      "type": "string",
      "description": "The EVRYTHNG ID of the user who has performed this action.",
      "readOnly": true,
      "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$"
    },
    "createdAt": {
      "type": "integer",
      "description": "Timestamp when the resource was created.",
      "readOnly": false,
      "minimum": 0
    },
    "createdByProject": {
      "type": "string",
      "description": "The EVRYTHNG ID of the project who has performed this action.",
      "readOnly": true,
      "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$"
    },
    "createdByApp": {
      "type": "string",
      "description": "The EVRYTHNG ID of the application who has performed this action.",
      "readOnly": true,
      "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$"
    },
    "thng": {
      "type": "string",
      "description": "The EVRYTHNG ID of the Thng this action was carried out on.",
      "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$"
    },
    "product": {
      "type": "string",
      "description": "The EVRYTHNG product ID associated with the Thng this action was carried out on.",
      "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$"
    },
    "collection": {
      "type": "string",
      "description": "The EVRYTHNG ID of the collection this action was carried out on. Custom action types only.",
      "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$"
    },
    "timestamp": {
      "type": "integer",
      "description": "The timestamp when the action took place. Filled automatically if unspecified.",
      "readOnly": false,
      "minimum": 0
    },
    "identifiers": {
      "type": "object",
      "description": "Various identifiers (EPC, GTIN, etc.) as a JSON object with one or more key-value pairs."
    },
    "location": {
      "additionalProperties": false,
      "type": "object",
      "description": "An object representing a location. Either 'position' or 'place' us required.",
      "properties": {
        "position": {
          "type": "object",
          "description": "A GeoJSON Point object. The coordinate order is longitude, then latitude.",
          "required": ["type", "coordinates"],
          "properties": {
            "type": {
              "type": "string",
              "description": "The type of the point.",
              "enum": ["Point"]
            },
            "coordinates": {
              "type": "array",
              "description": "The point coordinates",
              "items": {
                "type": "number",
                "minimum": -180,
                "maximum": 180
              }
            }
          }
        },
        "createdAt": {
          "type": "integer",
          "description": "Timestamp when the resource was created.",
          "readOnly": true,
          "minimum": 0
        },
        "timestamp": {
          "type": "integer",
          "description": "The time the location update occurred, or filled automatically by the Platform if omitted.",
          "readOnly": true
        },
        "longitude": {
          "type": "number",
          "description": "The longitude."
        },
        "latitude": {
          "type": "number",
          "description": "The latitude."
        },
        "place": {
          "type": "string",
          "description": "The place ID.",
          "pattern": "^[abcdefghkmnpqrstwxyABCDEFGHKMNPQRSTUVWXY0123456789]{24}$"
        },
        "scopes": {
          "additionalProperties": false,
          "type": "object",
          "description": "Project and user scopes arrays.",
          "required": ["users", "projects"],
          "properties": {
            "users": {
              "type": "array",
              "description": "An array of Application User IDs this resource is scoped to.",
              "items": { "type": "string" }
            },
            "projects": {
              "type": "array",
              "description": "An array of project IDs this resource is scoped to.",
              "items": { "type": "string" }
            }
          }
        }
      }
    },
    "locationSource": {
      "type": "string",
      "description": "The method used to find the location where the action took place, and requires `location` to also be set. If a GPS was used (with user permission granted), `sensor` is specified. Otherwise an estimate is made based on the apparent location, which may not be the device itself.",
      "enum": []
        "geoIp",
        "unknown",
        "place"
      ]
    },
    "context": {
      "additionalProperties": false,
      "type": "object",
      "description": "Object containing contextual data about the action creator.",
      "properties": {
        "ipAddress": {
          "type": "string",
          "description": "The geolocation IP address of the action.",
          "readOnly": true
        },
        "city": {
          "type": "string",
          "description": "The geolocation city of the action, based on the IP address.",
          "readOnly": true
        },
        "region": {
          "type": "string",
          "description": "The wider region of the action.",
          "readOnly": true
        },
        "countryCode": {
          "type": "string",
          "description": "The country of the action.",
          "readOnly": true
        },
        "userAgentName": {
          "type": "string",
          "description": "The user agent name of the action creator's browser or other client.",
          "readOnly": true
        },
        "userAgent": {
          "type": "string",
          "description": "The user agent of the action creator's browser or other client.",
          "readOnly": true
        },
        "operatingSystemName": {
          "type": "string",
          "description": "Name of the action creator's client operating system.",
          "readOnly": true
        },
        "timeZone": {
          "type": "string",
          "description": "The timezone string, such as Europe/Paris",
          "readOnly": true
        }
      }
    },
    "customFields": {
      "type": "object",
      "description": "Object of case-sensititve key-value pairs of custom fields associated with the resource."
    },
    "scopes": {
      "additionalProperties": false,
      "type": "object",
      "description": "Project and user scopes arrays.",
      "required": ["users", "projects"],
      "properties": {
        "users": {
          "type": "array",
          "description": "An array of Application User IDs this resource is scoped to.",
          "items": { "type": "string" }
        },
        "projects": {
          "type": "array",
          "description": "An array of project IDs this resource is scoped to.",
          "items": { "type": "string" }
        }
      }
    },
    "tags": {
      "type": "array",
      "description": "Array of string tags associated with this resource.",
      "items": {
        "type": "string",
        "maxLength": 256,
        "maximum": 60
      }
    },
    "reactions": {
      "type": "array",
      "description": "An array of Redirector reactions that occurred from this action.",
      "items": {
        "additionalProperties": false,
        "type": "object",
        "description": "A single reaction from Redirector.",
        "properties": {
          "type": {
            "type": "string",
            "description": "The reaction type.",
            "enum": ["redirection"],
            "readOnly": true
          },
          "redirectUrl": {
            "type": "string",
            "description": "The redirection URL.",
            "readOnly": true
          },
          "redirectRuleName": {
            "type": "string",
            "description": "The name of redirector rule.",
            "readOnly": true
          },
          "redirectionContext": {
            "type": "object",
            "description": "Object of redirection context values.",
            "readOnly": true
          }
        }
      }
    },
    "url": {
      "type": "string",
      "description": "The URL to the triggering scan, added in some cases."
    },
    "consumerId": {
      "type": "string",
      "description": "App-specific ID id to identify a user that has scanned a given product.",
      "minimum": 3,
      "maximum": 128
    }
  }
}
```
```json Example
{
  "id": "U4aPKKSEWy9nQQRaaghRasaa",
  "createdAt": 1510914839892,
  "customFields": {
    "region_code": "en_gb"
  },
  "tags": [
    "example",
    "actions"
  ],
  "timestamp": 1510914839892,
  "type": "scans",
  "user": "UnRPKGnUMQtVEPaaageq5ehk",
  "location": {
    "latitude": 51.4333,
    "longitude": 0.1833,
    "position": {
      "type": "Point",
      "coordinates": [
        0.1833,
        51.4333
      ]
    }
  },
  "locationSource": "geoIp",
  "context": {
    "city": "Crayford",
    "region": "England",
    "countryCode": "GB",
    "userAgentName": "Unknown",
    "operatingSystemName": "Unknown",
    "timeZone": "Europe/London"
  },
  "reactions": [
    {
      "type": "redirection",
      "redirectRuleName": "Redirector Rule",
      "redirectUrl": "https://google.com",
      "redirectionContext": {
        "constants": {
          "region_code": "en_gb"
        }
      }
    }
  ],
  "createdByProject": "UmxHK6K8BXsa9KawRh4bTbqc",
  "createdByApp": "U3pxRQh2eD8RtKwaRgerfQgc",
  "identifiers": {
    "ean_13": "786432786349"
  },
  "thng": "U4wpchcBqm8hhqwwag8kgnqc"
}
```

See also: [`LocationDocument`](#section-locationdocument-data-model), [`ActionContextDocument`](#section-actioncontextdocument-data-model), [`ScopesDocument`](#section-scopesdocument-data-model), [`ReactionDocument`](#section-reactiondocument-data-model)

***

**API Status**\
General Availability:\
`/testActions`

***

## Create a Test Action

Submit Test Action

> 🚧 Notes
>
> * No action will be created
>
> * Reactor wouldn't be triggered

```http
POST /actions/:type
Content-Type: application/json
Authorization: $APP_USER_API_KEY

TestActionDocument
```
```curl
curl -i -H "Content-Type: application/json" \
  -H "Authorization: $APP_USER_API_KEY" \
  -X POST "https://$EVT_API_DOMAIN/testActions" \
  -d '{
    "product": "UmAkSdqe69QVhswwRYNdbxna",
    "type": "implicitScans"
  }'
```

```http Response
HTTP/1.1 201 Created
Content-Type: application/json
Location: https://$EVT_API_DOMAIN/testActins

{
  "id": "UGByEXMEq9QBE8aRaYNeYnkb",
  "createdAt": 1497528007035,
  "timestamp": 1497528007035,
  "type": "implicitScans",
  "user": "UmAFxMDnqQ9VEsRwaErAxfrr",
  "location": {
    "latitude": 48.86,
    "longitude": 2.34,
    "position": {
      "type": "Point",
      "coordinates": [
        2.34,
        48.86
      ]
    }
  },
  "reactions": [
  	{
  		"type": "redirection",
  		"redirectUrl": "https://www.google.com",
  		"redirectRuleName": "Redirect rule",
  		"redirectionContext": {
  			"locationSource": "geoIp"
  		}
  	}
  ],
  "locationSource": "geoIp",
  "createdByProject": "UGdkbcyhqQtVEsaaRhrASatf",
  "createdByApp": "UmAFxcdSMt9VE8awRE7dba9n",
  "product": "UmAkSdqe69QVhswwRYNdbxna"
}
```

***